/// <summary> /// 根据条件查询用户信息 /// </summary> /// <param name="con"></param> /// <param name="type">[id,name,phone]选其一(必填)</param> /// <returns></returns> public User_Table GetUserTableByConn(string con, string type) { string sql = ""; User_Table obj = null; SqlDataReader dr = null; switch (type.ToLower()) { case "id": sql = "Select * from User_Table where U_id=@U_id"; dr = DBHerlper.ExecuteReader( sql, CommandType.Text, new SqlParameter[] { new SqlParameter("@U_id", con) }); break; case "name": sql = "Select * from User_Table where U_UserName=@U_UserName"; dr = DBHerlper.ExecuteReader( sql, CommandType.Text, new SqlParameter[] { new SqlParameter("@U_UserName", con) }); break; case "phone": sql = "Select * from User_Table where U_Phone=@U_Phone"; dr = DBHerlper.ExecuteReader( sql, CommandType.Text, new SqlParameter[] { new SqlParameter("@U_Phone", con) }); break; } if (dr.Read()) { obj = new User_Table() { U_PhoneVerify = dr["U_PhoneVerify"].ToString(), IDT_id = Convert.ToInt32(dr["IDT_id"]), U_ComPanyAddress = dr["U_ComPanyAddress"].ToString(), U_Company = dr["U_Company"].ToString(), M_id = Convert.ToInt32(dr["M_id"]), U_CreateUserDate = dr["U_CreateUserDate"].ToString(), U_Head = dr["U_Head"].ToString(), U_id = Convert.ToInt32(dr["U_id"]), U_IDS = dr["U_IDS"].ToString(), U_LastLoginAddress = dr["U_LastLoginAddress"].ToString(), U_LastLoginDatetime = dr["U_LastLoginDatetime"].ToString(), U_LoginAddress = dr["U_LoginAddress"].ToString(), U_LoginDatetime = dr["U_LoginDatetime"].ToString(), U_Sex = dr["U_Sex"].ToString(), U_Name = dr["U_Name"].ToString(), U_Phone = dr["U_Phone"].ToString(), U_UserName = dr["U_UserName"].ToString(), U_UserPwd = dr["U_UserPwd"].ToString(), LS_id = Convert.ToInt32(dr["LS_id"]) }; } dr.Close(); return(obj); }
/// <summary> /// 获取全部的产品 /// </summary> /// <returns></returns> public List <Product_Table> GetProductTableAll() { List <Product_Table> list = new List <Product_Table>(); SqlDataReader dr = DBHerlper.ExecuteReader(GetSqlString("Select"), CommandType.StoredProcedure); while (dr.Read()) { Product_Table obj = new Product_Table() { E_id = Convert.ToInt32(dr["E_id"]), HP_id = Convert.ToInt32(dr["HP_id"]), NP_id = Convert.ToInt32(dr["NP_id"]), PT_id = Convert.ToInt32(dr["PT_id"]), P_Company = dr["P_Company"].ToString(), P_Date = Convert.ToDateTime(dr["P_Date"]), P_id = Convert.ToInt32(dr["P_id"]), P_Name = dr["P_Name"].ToString(), P_No = dr["P_No"].ToString(), P_Price = Convert.ToDouble(dr["P_Price"]), P_CoverImage = dr["P_CoverImage"].ToString(), P_Introduce = dr["P_Introduce"].ToString() }; list.Add(obj); } dr.Close(); return(list); }
/// <summary> /// 根据输入的属性名称查询产品信息 /// </summary> /// <param name="con"></param> /// <returns></returns> public Product_Table GetProductTableByConn(string tyepAttrName, string con) { Product_Table obj = null; string attrName = "@" + tyepAttrName; SqlDataReader dr = DBHerlper.ExecuteReader( "Select * from Product_Table where " + tyepAttrName + "=" + attrName, CommandType.Text, new SqlParameter[] { new SqlParameter(attrName, con) }); if (dr.Read()) { obj = new Product_Table() { E_id = Convert.ToInt32(dr["E_id"]), HP_id = Convert.ToInt32(dr["HP_id"]), NP_id = Convert.ToInt32(dr["NP_id"]), PT_id = Convert.ToInt32(dr["PT_id"]), P_Company = dr["P_Company"].ToString(), P_Date = Convert.ToDateTime(dr["P_Date"]), P_id = Convert.ToInt32(dr["P_id"]), P_Name = dr["P_Name"].ToString(), P_No = dr["P_No"].ToString(), P_Price = Convert.ToDouble(dr["P_Price"]), P_CoverImage = dr["P_CoverImage"].ToString(), P_Introduce = dr["P_Introduce"].ToString() }; } dr.Close(); return(obj); }
/// <summary> /// 根据ID查询招聘职位信息 /// </summary> /// <param name="con"></param> /// <returns></returns> public JoinUs_Table GetJoinUsTableByConn(string con) { JoinUs_Table obj = null; SqlDataReader dr = DBHerlper.ExecuteReader( "Select * from JoinUs_Table where JU_id=@JU_id", CommandType.Text, new SqlParameter[] { new SqlParameter("@JU_id", con) }); if (dr.Read()) { obj = new JoinUs_Table() { JUP_id = Convert.ToInt32(dr["JUP_id"]), JU_id = Convert.ToInt32(dr["JU_id"]), JU_Name = dr["JU_Name"].ToString(), JU_Address = dr["JU_Address"].ToString(), JU_SubmitDateTime = Convert.ToDateTime(dr["JU_SubmitDateTime"]), JU_Phone = dr["JU_Phone"].ToString(), JU_Sex = dr["JU_Sex"].ToString() }; } dr.Close(); return(obj); }
/// <summary> /// 更改用户 /// </summary> /// <param name="obj">带入参数</param> /// <returns></returns> public int Update_UserTableData(User_Table obj) { return(DBHerlper.ExecuteNonQuery(GetSqlString("Update"), CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@U_PhoneVerify", obj.U_PhoneVerify), new SqlParameter("@IDT_id", obj.IDT_id), new SqlParameter("@U_ComPanyAddress", obj.U_ComPanyAddress), new SqlParameter("@U_Company", obj.U_Company), new SqlParameter("@M_id", obj.M_id), new SqlParameter("@U_CreateUserDate", obj.U_CreateUserDate), new SqlParameter("@U_Head", obj.U_Head), new SqlParameter("@U_id", obj.U_id), new SqlParameter("@U_IDS", obj.U_IDS), new SqlParameter("@U_LastLoginAddress", obj.U_LastLoginAddress), new SqlParameter("@U_LastLoginDatetime", obj.U_LastLoginDatetime), new SqlParameter("@U_LoginAddress", obj.U_LoginAddress), new SqlParameter("@U_LoginDatetime", obj.U_LoginDatetime), new SqlParameter("@U_Sex", obj.U_Sex), new SqlParameter("@U_Name", obj.U_Name), new SqlParameter("@U_Phone", obj.U_Phone), new SqlParameter("@U_UserName", obj.U_UserName), new SqlParameter("@U_UserPwd", obj.U_UserPwd), new SqlParameter("@LS_id", obj.LS_id) })); }
/// <summary> /// 获取全部的用户 /// </summary> /// <returns></returns> public List <User_Table> GetUserTableAll() { List <User_Table> list = new List <User_Table>(); SqlDataReader dr = DBHerlper.ExecuteReader(GetSqlString("Select"), CommandType.StoredProcedure); while (dr.Read()) { User_Table obj = new User_Table() { U_PhoneVerify = dr["U_PhoneVerify"].ToString(), IDT_id = Convert.ToInt32(dr["IDT_id"]), U_ComPanyAddress = dr["U_ComPanyAddress"].ToString(), U_Company = dr["U_Company"].ToString(), M_id = Convert.ToInt32(dr["M_id"]), U_CreateUserDate = dr["U_CreateUserDate"].ToString(), U_Head = dr["U_Head"].ToString(), U_id = Convert.ToInt32(dr["U_id"]), U_IDS = dr["U_IDS"].ToString(), U_LastLoginAddress = dr["U_LastLoginAddress"].ToString(), U_LastLoginDatetime = dr["U_LastLoginDatetime"].ToString(), U_LoginAddress = dr["U_LoginAddress"].ToString(), U_LoginDatetime = dr["U_LoginDatetime"].ToString(), U_Sex = dr["U_Sex"].ToString(), U_Name = dr["U_Name"].ToString(), U_Phone = dr["U_Phone"].ToString(), U_UserName = dr["U_UserName"].ToString(), U_UserPwd = dr["U_UserPwd"].ToString(), LS_id = Convert.ToInt32(dr["LS_id"]) }; list.Add(obj); } dr.Close(); return(list); }
/// <summary> /// 获取全部的产品试用申请 /// </summary> /// <returns></returns> public List <ProductTryOur_Table> GetProductTryOurTableAll() { List <ProductTryOur_Table> list = new List <ProductTryOur_Table>(); SqlDataReader dr = DBHerlper.ExecuteReader(GetSqlString("Select"), CommandType.StoredProcedure); while (dr.Read()) { ProductTryOur_Table obj = new ProductTryOur_Table() { E_id = Convert.ToInt32(dr["E_id"]), PTO_Activate = Convert.ToInt32(dr["PTO_Activate"]), PTO_ApplyFor = Convert.ToDateTime(dr["PTO_ApplyFor"]), PTO_AuditDate = Convert.ToDateTime(dr["PTO_AuditDate"]), PTO_ExpireDate = Convert.ToDateTime(dr["PTO_ExpireDate"]), PTO_id = Convert.ToInt32(dr["PTO_id"]), TO_id = Convert.ToInt32(dr["TO_id"]), PTO_Remark = dr["PTO_Remark"].ToString(), PTO_Name = dr["TO_id"].ToString(), U_id = Convert.ToInt32(dr["U_id"]) }; list.Add(obj); } dr.Close(); return(list); }
/// <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 <Order_Table> GetOrderTableAll() { List <Order_Table> list = new List <Order_Table>(); SqlDataReader dr = DBHerlper.ExecuteReader(GetSqlString("Select"), CommandType.StoredProcedure); while (dr.Read()) { Order_Table obj = new Order_Table() { O_id = Convert.ToInt32(dr["O_id"]), OState_id = (int)dr["OState_id"], O_DateTime = (DateTime)dr["O_DateTime"], E_id = (int)dr["E_id"], O_DealWay = dr["O_DealWay"].ToString(), O_LeaveWords = dr["O_LeaveWords"].ToString(), O_Remark = dr["O_Remark"].ToString(), P_id = (int)dr["P_id"], U_id = (int)dr["U_id"] }; list.Add(obj); } dr.Close(); return(list); }
/// <summary> /// 根据条件查询订单信息 /// </summary> /// <param name="con"></param> /// <returns></returns> public List <Order_Table> GetOrderTableByConn(string attr, string con) { List <Order_Table> list = new List <Order_Table> (); string attrs = "@" + attr; SqlDataReader dr = DBHerlper.ExecuteReader( "Select * from Order_Table where " + attr + "=" + attrs, CommandType.Text, new SqlParameter[] { new SqlParameter(attrs, con) }); if (dr.Read()) { Order_Table obj = new Order_Table() { O_id = Convert.ToInt32(dr["O_id"]), OState_id = (int)dr["OState_id"], O_DateTime = (DateTime)dr["O_DateTime"], E_id = (int)dr["E_id"], O_DealWay = dr["O_DealWay"].ToString(), O_LeaveWords = dr["O_LeaveWords"].ToString(), O_Remark = dr["O_Remark"].ToString(), P_id = (int)dr["P_id"], U_id = (int)dr["U_id"] }; list.Add(obj); } dr.Close(); return(list); }
/// <summary> /// 根据ID查询密保信息 /// </summary> /// <param name="con"></param> /// <returns></returns> public IssueAnswer_Table GetIssueAnswerTableByConn(string con) { IssueAnswer_Table obj = null; SqlDataReader dr = DBHerlper.ExecuteReader( "Select * from IssueAnswer_Table where IA_id=@IA_id", CommandType.Text, new SqlParameter[] { new SqlParameter("@IA_id", con) }); if (dr.Read()) { obj = new IssueAnswer_Table() { IA_Answer1 = dr["IA_Answer1"].ToString(), IA_Answer2 = dr["IA_Answer2"].ToString(), IA_Answer3 = dr["IA_Answer3"].ToString(), IA_id = Convert.ToInt32(dr["IA_id"]), IA_Issue1 = dr["IA_Issue1"].ToString(), IA_Issue2 = dr["IA_Issue2"].ToString(), IA_Issue3 = dr["IA_Issue3"].ToString(), U_UserName = dr["U_UserName"].ToString() }; } dr.Close(); return(obj); }
/// <summary> /// 根据条件查询订单信息并且进行分页 /// </summary> /// <param name="id">用户ID</param> /// <param name="pageNo">当前页(用户选中的页数)</param> /// <param name="pageSize">显示数据</param> /// <returns></returns> public List <Order_Table> GetOrderTableByConn_Page(int id, int pageNo, int pageSize) { List <Order_Table> list = new List <Order_Table>(); SqlDataReader dr = DBHerlper.ExecuteReader( "proc_OrderPage", CommandType.Text, new SqlParameter[] { new SqlParameter("@U_id", id), new SqlParameter("@PageNo", pageNo), new SqlParameter("@PageSize", pageSize) }); if (dr.Read()) { Order_Table obj = new Order_Table() { O_id = Convert.ToInt32(dr["O_id"]), OState_id = (int)dr["OState_id"], O_DateTime = (DateTime)dr["O_DateTime"], E_id = (int)dr["E_id"], O_DealWay = dr["O_DealWay"].ToString(), O_LeaveWords = dr["O_LeaveWords"].ToString(), O_Remark = dr["O_Remark"].ToString(), P_id = (int)dr["P_id"], U_id = (int)dr["U_id"] }; list.Add(obj); } dr.Close(); return(list); }
/// <summary> /// 根据ID查询产品试用申请信息 /// </summary> /// <param name="con"></param> /// <returns></returns> public ProductTryOur_Table GetProductTryOurTableByConn(string con) { ProductTryOur_Table obj = null; SqlDataReader dr = DBHerlper.ExecuteReader( "Select * from ProductTryOur_Table where PTO_id=@PTO_id", CommandType.Text, new SqlParameter[] { new SqlParameter("@PTO_id", con) }); if (dr.Read()) { obj = new ProductTryOur_Table() { E_id = Convert.ToInt32(dr["E_id"]), PTO_Activate = Convert.ToInt32(dr["PTO_Activate"]), PTO_ApplyFor = Convert.ToDateTime(dr["PTO_ApplyFor"]), PTO_AuditDate = Convert.ToDateTime(dr["PTO_AuditDate"]), PTO_ExpireDate = Convert.ToDateTime(dr["PTO_ExpireDate"]), PTO_id = Convert.ToInt32(dr["PTO_id"]), TO_id = Convert.ToInt32(dr["TO_id"]), PTO_Remark = dr["PTO_Remark"].ToString(), PTO_Name = dr["TO_id"].ToString(), U_id = Convert.ToInt32(dr["U_id"]) }; } dr.Close(); return(obj); }
/// <summary> /// 移除公司信息 /// </summary> /// <param name="con">参数条件</param> /// <returns></returns> public int Delete_CompanyTableData(string con) { return(DBHerlper.ExecuteNonQuery(GetSqlString("Update"), CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@Com_id", con) })); }
/// <summary> /// 更改员工 /// </summary> /// <param name="obj">带入参数</param> /// <returns></returns> public int Update_EmployeeTableData(Employee_Table obj) { return(DBHerlper.ExecuteNonQuery(GetSqlString("Update"), CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@E_id", obj.E_id), new SqlParameter("@Dep_id", obj.Dep_id), new SqlParameter("@E_Address", obj.E_Address), new SqlParameter("@E_Date", obj.E_Date), new SqlParameter("@E_Education", obj.E_Education), new SqlParameter("@E_IdS", obj.E_IdS), new SqlParameter("@E_LastLoginAddress", obj.E_LastLoginAddress), new SqlParameter("@E_LastLoginDate", obj.E_LastLoginDate), new SqlParameter("@E_LoginAddress", obj.E_LoginAddress), new SqlParameter("@E_LoginDate", obj.E_LoginDate), new SqlParameter("@E_Name", obj.E_Name), new SqlParameter("@E_Pay", obj.E_Pay), new SqlParameter("@E_Phone", obj.E_Phone), new SqlParameter("@E_School", obj.E_School), new SqlParameter("@E_Sex", obj.E_Sex), new SqlParameter("@E_UserName", obj.E_UserName), new SqlParameter("@IDT_id", obj.IDT_id), new SqlParameter("@LS_ID", obj.LS_ID), new SqlParameter("@Post_id", obj.Post_id), new SqlParameter("@E_UserPwd", obj.E_UserPwd) })); }
/// <summary> /// 移除部门 /// </summary> /// <param name="con">参数条件</param> /// <returns></returns> public int Delete_DepartmentTableData(string con) { return(DBHerlper.ExecuteNonQuery(GetSqlString("Delete"), CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@Dep_id", con) })); }
/// <summary> /// 添加登录状态 /// </summary> /// <param name="obj">带入参数</param> /// <returns></returns> public int Insert_LoginStateTableData(LoginState_Table obj) { return(DBHerlper.ExecuteNonQuery(GetSqlString("Insert"), CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@LS_Name", obj.LS_Name) })); }
/// <summary> /// 添加职位 /// </summary> /// <param name="obj">带入参数</param> /// <returns></returns> public int Insert_PostTableData(Post_Table obj) { return(DBHerlper.ExecuteNonQuery(GetSqlString("Insert"), CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@Post_Name", obj.Post_Name) })); }
/// <summary> /// 更改试用审核状态 /// </summary> /// <param name="obj">带入参数</param> /// <returns></returns> public int Update_TryOutTableData(TryOut_Table obj) { return(DBHerlper.ExecuteNonQuery(GetSqlString("Update"), CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@TO_id", obj.TO_id), new SqlParameter("@TO_Name", obj.TO_Name) })); }
/// <summary> /// 更改证件类型 /// </summary> /// <param name="obj">带入参数</param> /// <returns></returns> public int Update_IDTypeTableData(IDType_Table obj) { return(DBHerlper.ExecuteNonQuery(GetSqlString("Update"), CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@IDT_Name", obj.IDT_Name), new SqlParameter("@IDT_id", obj.IDT_id) })); }
/// <summary> /// 更改是否热门产品 /// </summary> /// <param name="obj">带入参数</param> /// <returns></returns> public int Update_HotProductTableData(HotProduct_Table obj) { return(DBHerlper.ExecuteNonQuery(GetSqlString("Update"), CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@HP_Name", obj.HP_Name), new SqlParameter("@HP_id", obj.HP_id) })); }
/// <summary> /// 更改订单状态 /// </summary> /// <param name="obj">带入参数</param> /// <returns></returns> public int Update_OrderStateTableData(OrderState_Table obj) { return(DBHerlper.ExecuteNonQuery(GetSqlString("Update"), CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@OState_id", obj.OState_id), new SqlParameter("@OState_Name", obj.OState_Name) })); }
/// <summary> /// 添加招聘职位 /// </summary> /// <param name="obj">带入参数</param> /// <returns></returns> public int Insert_JoinUsPostTableData(JoinUsPost_Table obj) { return(DBHerlper.ExecuteNonQuery(GetSqlString("Insert"), CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@JUP_Name", obj.JUP_Name), new SqlParameter("@JUP_Number", obj.JUP_Number) })); }
/// <summary> /// 更改部门 /// </summary> /// <param name="obj">带入参数</param> /// <returns></returns> public int Update_DepartmentTableData(Department_Table obj) { return(DBHerlper.ExecuteNonQuery(GetSqlString("Update"), CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@Dep_Name", obj.Dep_Name), new SqlParameter("@Dep_id", obj.Dep_id) })); }
/// <summary> /// 添加邮箱 /// </summary> /// <param name="obj">带入参数</param> /// <returns></returns> public int Insert_MailTableData(Mail_Table obj) { return(DBHerlper.ExecuteNonQuery(GetSqlString("Insert"), CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@M_Mail", obj.M_Mail), new SqlParameter("@M_YesNo", obj.M_YesNo) })); }
/// <summary> /// 添加解决方案 /// </summary> /// <param name="obj">带入参数</param> /// <returns></returns> public int Insert_SolutionTableData(Solution_Table obj) { return(DBHerlper.ExecuteNonQuery(GetSqlString("Insert"), CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@P_id", obj.P_id), new SqlParameter("@S_Content", obj.S_Content), new SqlParameter("@S_Datetime", obj.S_Datetime), new SqlParameter("@S_tatle", obj.S_tatle) })); }
/// <summary> /// 添加新闻 /// </summary> /// <param name="obj">带入参数</param> /// <returns></returns> public int Insert_NewsTableData(News_Table obj) { return(DBHerlper.ExecuteNonQuery(GetSqlString("Insert"), CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@News_Content", obj.News_Content), new SqlParameter("@News_Date", obj.News_Date), new SqlParameter("@News_Anthor", obj.News_Anthor), new SqlParameter("@News_Name", obj.News_Name) })); }
/// <summary> /// 添加购物车 /// </summary> /// <param name="obj">带入参数</param> /// <returns></returns> public int Insert_ShopTableData(Shop_Table obj) { return(DBHerlper.ExecuteNonQuery(GetSqlString("Insert"), CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@P_No", obj.P_No), new SqlParameter("@Shop_Date", obj.Shop_Date), new SqlParameter("@Shop_Number", obj.Shop_Number), new SqlParameter("@Shop_User", obj.Shop_User) })); }
/// <summary> /// 添加评价 /// </summary> /// <param name="obj">带入参数</param> /// <returns></returns> public int Insert_EvaluateTableData(Evaluate_Table obj) { return(DBHerlper.ExecuteNonQuery(GetSqlString("Insert"), CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@U_id", obj.U_id), new SqlParameter("@P_id", obj.P_id), new SqlParameter("@Eva_Datetime", obj.Eva_Datetime), new SqlParameter("@Eva_Content", obj.Eva_Content) })); }
/// <summary> /// 更改反馈 /// </summary> /// <param name="obj">带入参数</param> /// <returns></returns> public int Update_FeedbackTableData(Feedback_Table obj) { return(DBHerlper.ExecuteNonQuery(GetSqlString("Update"), CommandType.StoredProcedure, new SqlParameter[] { new SqlParameter("@U_id", obj.U_id), new SqlParameter("@P_id", obj.P_id), new SqlParameter("@Feed_id", obj.Feed_id), new SqlParameter("@Feed_Datetime", obj.Feed_Datetime), new SqlParameter("@Feed_Content", obj.Feed_Content) })); }