public bool InsertInfo(SupplierEntity obj) { con = Connectionsql.Connection(); bool term = SelectMysql.result("insert into tb_supplier(supplierId,businessName,contacts,phone,address,settlementMethod)" + " values(" + "'" + obj.SupplierId + "'" + "," + "'" + obj.Merchantname + "'" + "," + "'" + obj.Contacts + "'" + "," + "'" + obj.Phone + "'" + "," + "'" + obj.Address + "'" + "," + "'" + obj.Settlement + "')"); try { if (term == true) { return(term); } } catch (MySqlException e) { MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK); } finally { con.Close(); } return(term); }
public bool UpdateInfo(WorkerEntity obj, string jobnumber) { con = Connectionsql.Connection(); bool term = SelectMysql.result("update tb_zhigong set Password='******'," + "Name='" + obj.Name + "',Shenfenzhenghao='" + obj.Idnumber + "',Sex='" + obj.Sex + "',Address=" + "'" + obj.Address + "',Phone='" + obj.Phone + "'" + ",Birth='" + obj.Birth + "',Ruyongriqi='" + obj.Hiredate + "'where Gonghao='" + jobnumber + "'"); try { if (term == true) { return(term); } } catch (MySqlException e) { MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK); } finally { con.Close(); } return(term); }
public bool UpdateInfo(SaleEntity obj, string jobnumber) { con = Connectionsql.Connection(); bool term = SelectMysql.result("update tb_sale set saleId='" + obj.SalesrecordsId + "'," + "commodityName='" + obj.Productname + "',saleDate='" + obj.Saledate + "',saleNumber='" + obj.Salenumber + "',payMethod=" + "'" + obj.Paymethod + "',workerName='" + obj.Workername + "'" + ",Gonghao='" + obj.Jobnumber + "' where saleId='" + jobnumber + "'"); try { if (term == true) { return(term); } } catch (MySqlException e) { MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK); } finally { con.Close(); } return(term); }
public bool InsertInfo(SaleEntity obj) { con = Connectionsql.Connection(); bool term = SelectMysql.result("insert into tb_sale(saleId,commodityName,saleDate,saleNumber,payMethod,workerName" + ",Gonghao) values(" + "'" + obj.SalesrecordsId + "'" + "," + "'" + obj.Productname + "'" + "," + "'" + obj.Saledate + "'" + "," + "'" + obj.Salenumber + "'" + "," + "'" + obj.Paymethod + "'" + "," + "'" + obj.Workername + "'" + "," + "'" + obj.Jobnumber + "')"); try { if (term == true) { return(term); } } catch (MySqlException e) { MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK); } finally { con.Close(); } return(term); }
public bool UpdateInfo(ProductInfoEntity obj, string jobnumber) { con = Connectionsql.Connection(); bool term = SelectMysql.result("update tb_commodityInfo set commodityId='" + obj.ProductId + "'," + "commodityName='" + obj.Productname + "',businessName='" + obj.Merchantname + "',costPrice='" + obj.Costprice + "',unitPrice=" + "'" + obj.Unitprice + "',commodityNumber='" + obj.Merchantinventory + "'" + ",remarks='" + obj.Remarks + "' where purchaseId='" + jobnumber + "'"); try { if (term == true) { return(term); } } catch (MySqlException e) { MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK); } finally { con.Close(); } return(term); }
public bool UpdateInfo(SupplierEntity obj, string jobnumber) { con = Connectionsql.Connection(); bool term = SelectMysql.result("update tb_supplier set businessName='" + obj.Merchantname + "'," + "contacts='" + obj.Contacts + "',phone='" + obj.Phone + "',address='" + obj.Address + "',settlementMethod=" + "'" + obj.Settlement + "' where supplierId='" + jobnumber + "'"); try { if (term == true) { return(term); } } catch (MySqlException e) { MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK); } finally { con.Close(); } return(term); }
public bool InsertInfo(WorkerEntity obj) { con = Connectionsql.Connection(); bool term = SelectMysql.result("insert into tb_zhigong(Gonghao,Password,Name,Shenfenzhenghao,Sex,Address" + ",Gongzuodanwei,Phone,Birth,Ruyongriqi) values(" + "'" + obj.Jobnumber + "'" + "," + "'" + obj.Password + "'" + "," + "'" + obj.Name + "'" + "," + "'" + obj.Idnumber + "'" + "," + "'" + obj.Sex + "'" + "," + "'" + obj.Address + "'" + "," + "'" + obj.Workunit + "'" + "," + "'" + obj.Phone + "'" + "," + "'" + obj.Birth + "'" + "," + "'" + obj.Hiredate + "'" + ")"); try { if (term == true) { return(term); } } catch (MySqlException e) { MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK); } finally { con.Close(); } return(term); }
//登录 public bool SelectInfo(WorkerEntity obj) { bool term = false; con = Connectionsql.Connection(); MySqlDataReader reader = SelectMysql.reader("select Gonghao,Password,Gongzuodanwei from tb_zhigong"); try { while (reader.Read()) { if ((obj.Jobnumber == reader.GetString("Gonghao")) && (obj.Password == reader.GetString("Password")) && (obj.Workunit == reader.GetString("Gongzuodanwei"))) { term = true; } } } catch (MySqlException e) { MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK); } finally { con.Close(); } return(term); }
public bool UpdateInfo(PurchaseEntity obj, string jobnumber) { con = Connectionsql.Connection(); bool term = SelectMysql.result("update tb_purchase set purchaseId='" + obj.PurchaseId + "'," + "commodityName='" + obj.Productname + "',purchaseNumber='" + obj.Purchasenumber + "',costPrice='" + obj.Costprice + "',total=" + "'" + obj.Total + "',purchaseDate='" + obj.Purchasedate + "'" + ",handler='" + obj.Experience + "',purchaseStatus='" + obj.Purchasestate + "' where purchaseId='" + jobnumber + "'"); try { if (term == true) { return(term); } } catch (MySqlException e) { MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK); } finally { con.Close(); } return(term); }
public bool InsertInfo(PurchaseEntity obj) { con = Connectionsql.Connection(); bool term = SelectMysql.result("insert into tb_purchase(purchaseId,commodityName,purchaseNumber,costPrice,total,purchaseDate" + ",handler,purchaseStatus) values(" + "'" + obj.PurchaseId + "'" + "," + "'" + obj.Productname + "'" + "," + "'" + obj.Purchasenumber + "'" + "," + "'" + obj.Costprice + "'" + "," + "'" + obj.Total + "'" + "," + "'" + obj.Purchasedate + "'" + "," + "'" + obj.Experience + "'" + "," + "'" + obj.Purchasestate + "')"); try { if (term == true) { return(term); } } catch (MySqlException e) { MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK); } finally { con.Close(); } return(term); }
public bool InsertInfo(ProductInfoEntity obj) { con = Connectionsql.Connection(); bool term = SelectMysql.result("insert into tb_commodityInfo(commodityId,commodityName,businessName,costPrice,unitPrice,commodityNumber" + ",remarks) values(" + "'" + obj.ProductId + "'" + "," + "'" + obj.Productname + "'" + "," + "'" + obj.Merchantname + "'" + "," + "'" + obj.Costprice + "'" + "," + "'" + obj.Unitprice + "'" + "," + "'" + obj.Merchantinventory + "'" + "," + "'" + obj.Remarks + "')"); try { if (term == true) { return(term); } } catch (MySqlException e) { MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK); } finally { con.Close(); } return(term); }
public List <string> SelectColumn(string column, string tableName) { List <string> list = null; try { con = Connectionsql.Connection(); list = SelectMysql.selectlist("select distinct " + column + " from " + tableName, column); } catch (MySqlException e) { MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK); } finally { con.Close(); } return(list); }
public DataTable SelectAllInfo() { DataTable data = null; try { con = Connectionsql.Connection(); data = SelectMysql.datatable("select Gonghao as '工号',Password as '密码',Name as '职工姓名',Shenfenzhenghao as '身份证号',Sex as '性别',Address as '地址',Gongzuodanwei as '工作单位'," + "Phone as '联系方式',Birth as '出生日期',Ruyongriqi as '录用日期' from tb_zhigong"); } catch (MySqlException e) { MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK); } finally { con.Close(); } return(data); }
public DataTable SelectAllInfo() { DataTable data = null; try { con = Connectionsql.Connection(); data = SelectMysql.selectnew("select commodityId as '商品ID',commodityName as '产品名称',businessName as '商家名称',costPrice as '成本价'" + ",unitPrice as '单价',commodityNumber as '库存量',remarks as '备注'" + " from tb_commodityInfo"); } catch (MySqlException e) { MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK); } finally { con.Close(); } return(data); }
public DataTable SelectAllInfo() { DataTable data = null; try { con = Connectionsql.Connection(); data = SelectMysql.selectnew("select saleId as '销售ID',commodityName as '产品名称',saleDate as '销售日期',saleNumber as '销售数量'" + ",payMethod as '支付方式',workerName as '销售员姓名',Gonghao as '工号'" + " from tb_sale"); } catch (MySqlException e) { MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK); } finally { con.Close(); } return(data); }
public DataTable SelectAllInfo() { DataTable data = null; try { con = Connectionsql.Connection(); data = SelectMysql.datatable("select purchaseId as '进货ID',commodityName as '产品名称',purchaseNumber as '进货数量',costPrice as '成本价'" + ",total as '总额',purchaseDate as '进货日期',handler as '经手人'," + "purchaseStatus as '进货状态' from tb_purchase"); } catch (MySqlException e) { MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK); } finally { con.Close(); } return(data); }
public DataTable SelectAllInfo() { DataTable data = null; try { con = Connectionsql.Connection(); data = SelectMysql.datatable("select supplierId as '供货商ID'," + "businessName as '商家名称',contacts as '联系人'," + "phone as '电话号码',address as '公司地址'" + ",settlementMethod as '结算方式'" + " from tb_supplier"); } catch (MySqlException e) { MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK); } finally { con.Close(); } return(data); }
public bool DeleteInfo(string jobnumber) { con = Connectionsql.Connection(); bool term = SelectMysql.result("delete from tb_purchase where purchaseId='" + jobnumber + "'"); try { if (term == true) { return(term); } } catch (MySqlException e) { MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK); } finally { con.Close(); } return(term); }
public bool SelectUniqueInfo(WorkerEntity obj) { con = Connectionsql.Connection(); bool term = SelectMysql.result("select Gonghao from tb_zhigong where Gonghao='" + obj.Jobnumber + "'"); try { if (term == true) { return(term); } } catch (MySqlException e) { MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK); } finally { con.Close(); } return(term); }
//注册 public bool InsertInfo(WorkerEntity obj) { con = Connectionsql.Connection(); bool term = SelectMysql.result("insert into tb_zhigong(Gonghao,Password,Gongzuodanwei) values(" + "'" + obj.Jobnumber + "'" + "," + "'" + obj.Password + "'" + "," + "'" + obj.Workunit + "')"); try { if (term == true) { return(term); } } catch (MySqlException e) { MessageBox.Show(e.Message, "提示", MessageBoxButtons.OK); } finally { con.Close(); } return(term); }