⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 product.cs

📁 本论文叙述了联机考试系统的现状以及C#语言的概况。重点介绍了联机考试系统的实现过程:包括系统分析、 系统调查、 数据流程分析、功能设计、 数据库设计、 系统物理配置方案、 系统实现、 系统测试和调试。
💻 CS
字号:
using System;
using System.Data;
using System.Data.OleDb;

namespace SupermarketProject
{
	/// <summary>
	/// Summary description for Product.
	/// </summary>
	public class Product
	{
		public Product()
		{
			
		}

		public void AddProduct(DataRow drPrd)
		{

		string str="Insert into Products values('"+
		drPrd["ProductId"]+"','"+drPrd["ProductName"]+"','"+drPrd["ProductNo"]+"','"+drPrd["ProductDesc"]+"',"+drPrd["QOH"]+",'"+drPrd["Units"]+"','"+drPrd["CatCode"]+"');";
		Console.WriteLine(str);
		DataConnection.commnd.CommandText=str;
		DataConnection.commnd.ExecuteNonQuery ();
		Console.WriteLine("added");

		}

		public void ModifyProduct(DataRow drPrd)
	{
			string str="Update Products set ProductName='"+drPrd["ProductName"]+"', ProductNo='"+drPrd["ProductNo"]+"', ProductDesc='"+drPrd["ProductDesc"]+"',QOH="+drPrd["QOH"]+",Units='"+drPrd["Units"]+"' where ProductId='"+drPrd["ProductId"]+"';";			

            DataConnection.commnd.CommandText = str;
			DataConnection.commnd.ExecuteNonQuery(); 

		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -