public DataTable SelectLittleInfo(string name) { DataTable data = null; try { con = Connectionsql.Connection(); data = SelectMysql.datatable("select commodityId as '商品ID',commodityName as '产品名称',businessName as '商家名称',costPrice as '成本价'" + ",unitPrice as '单价',commodityNumber as '库存量',remarks as '备注'" + " from tb_commodityInfo where commodityName like '%" + name + "%'"); } 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 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 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); }