/// <summary> /// 根据ID查询购物车信息 /// </summary> /// <param name="con"></param> /// <returns></returns> public Shop_Table GetShopTableByConn(string attrName, string con) { string name = "@" + attrName; Shop_Table obj = null; SqlDataReader dr = DBHerlper.ExecuteReader( "Select * from Shop_Table where " + attrName + "=" + name, CommandType.Text, new SqlParameter[] { new SqlParameter(name, con) }); if (dr.Read()) { obj = new Shop_Table() { P_No = dr["P_No"].ToString(), Shop_Date = dr["Shop_Date"].ToString(), Shop_Id = Convert.ToInt32(dr["Shop_Id"]), Shop_Number = dr["Shop_Number"].ToString(), Shop_User = dr["Shop_User"].ToString() }; } dr.Close(); DBHerlper.CloseConn(); return(obj); }
/// <summary> /// 获取全部的证件类型 /// </summary> /// <returns></returns> public List <IDType_Table> GetIDTypeTableAll() { List <IDType_Table> list = new List <IDType_Table>(); SqlDataReader dr = DBHerlper.ExecuteReader(GetSqlString("Select"), CommandType.StoredProcedure); while (dr.Read()) { IDType_Table obj = new IDType_Table() { IDT_Name = dr["IDT_Name"].ToString(), IDT_id = Convert.ToInt32(dr["IDT_id"]) }; list.Add(obj); } dr.Close(); DBHerlper.CloseConn(); return(list); }
/// <summary> /// 根据ID查询证件类型信息 /// </summary> /// <param name="con"></param> /// <returns></returns> public IDType_Table GetIDTypeTableByConn(string con) { IDType_Table obj = null; SqlDataReader dr = DBHerlper.ExecuteReader( "Select * from IDType_Table where IDT_id=@IDT_id", CommandType.Text, new SqlParameter[] { new SqlParameter("@IDT_id", con) }); if (dr.Read()) { obj = new IDType_Table() { IDT_Name = dr["IDT_Name"].ToString(), IDT_id = Convert.ToInt32(dr["IDT_id"]) }; } dr.Close(); DBHerlper.CloseConn(); return(obj); }
/// <summary> /// 获取全部的购物车 /// </summary> /// <returns></returns> public List <Shop_Table> GetShopTableAll() { List <Shop_Table> list = new List <Shop_Table>(); SqlDataReader dr = DBHerlper.ExecuteReader(GetSqlString("Select"), CommandType.StoredProcedure); while (dr.Read()) { Shop_Table obj = new Shop_Table() { P_No = dr["P_No"].ToString(), Shop_Date = dr["Shop_Date"].ToString(), Shop_Id = Convert.ToInt32(dr["Shop_Id"]), Shop_Number = dr["Shop_Number"].ToString(), Shop_User = dr["Shop_User"].ToString() }; list.Add(obj); } dr.Close(); DBHerlper.CloseConn(); return(list); }
/// <summary> /// 根据ID查询员工信息 /// </summary> /// <param name="con"></param> /// <returns></returns> public Employee_Table GetEmployeeTableByConn(string con) { Employee_Table obj = null; SqlDataReader dr = DBHerlper.ExecuteReader( "Select * from Employee_Table where E_id=@E_id", CommandType.Text, new SqlParameter[] { new SqlParameter("@E_id", con) }); if (dr.Read()) { obj = new Employee_Table() { Dep_id = Convert.ToInt32(dr["Dep_id"]), E_Address = dr["E_Address"].ToString(), E_Date = Convert.ToDateTime(dr["E_Date"]), E_Education = dr["E_Education"].ToString(), E_id = Convert.ToInt32(dr["E_id"]), E_IdS = dr["E_IdS"].ToString(), E_LastLoginAddress = dr["E_LastLoginAddress"].ToString(), E_LastLoginDate = Convert.ToDateTime(dr["E_LastLoginDate"]), E_LoginAddress = dr["E_LoginAddress"].ToString(), E_LoginDate = Convert.ToDateTime(dr["E_LoginDate"]), E_Name = dr["E_Name"].ToString(), E_Pay = Convert.ToDouble(dr["E_Pay"]), E_Phone = dr["E_Phone"].ToString(), E_School = dr["E_School"].ToString(), E_Sex = dr["E_Sex"].ToString(), E_UserName = dr["E_UserName"].ToString(), E_UserPwd = dr["E_UserPwd"].ToString(), IDT_id = Convert.ToInt32(dr["IDT_id"]), LS_ID = Convert.ToInt32(dr["LS_ID"]), Post_id = Convert.ToInt32(dr["Post_id"]) }; } dr.Close(); DBHerlper.CloseConn(); return(obj); }