WinformMobileSale/DataBL.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections;

namespace mobilesale
{
	/// <summary>
	/// DataBL 的摘要说明。
	/// </summary>
	public class DataBL
	{
		public DataBL()
		{
			//
			// TODO: 在此处添加构造函数逻辑
			//
		}
		public static SqlConnection getConn()
		{
			SqlConnection sqlCon= new SqlConnection("server=.;Integrated Security=True;Database=MTSSystem");
			return sqlCon;
		}

		public static DataTable selectMobile()
		{
			SqlConnection con=DataBL.getConn();
			String strSelect="select mobileModelID as '手机编号',mobileModel as '手机型号',mobileFactory as '手机厂家',totalPrice as '手机全价',maxDisccunt as '最大折扣' from mobileModel";
			SqlDataAdapter adapter=new SqlDataAdapter(strSelect,con);
			DataTable tab=new DataTable();
			adapter.Fill(tab);
			return tab;
		}

		public static DataTable selectSales()
		{
			SqlConnection con=DataBL.getConn();
			String strSelect="select saleID as '营业员编号',saleName as '姓名',salesVolume as '销售额' from mobileSales";
			SqlDataAdapter adapter=new SqlDataAdapter(strSelect,con);
			DataTable tab=new DataTable();
			adapter.Fill(tab);
			return tab;
		}

		public static ArrayList selectSaleNames()
		{
			SqlConnection con=DataBL.getConn();
			String strSelect="select saleName as '姓名'from mobileSales";
			SqlCommand cmd=new SqlCommand(strSelect,con);
			con.Open();
			SqlDataReader reader=cmd.ExecuteReader();
			ArrayList data=new ArrayList();
			while(reader.Read())
			{
				data.Add(reader.GetString(0));
			}
			con.Close();
			return data;
		}

后面还有 76 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。