public int tb_SellGoodsUpdate(_SellGoods tbChGood) { int intFalg = 0; try { string str_Add = "update tb_SellGoods set "; str_Add += "KcID='" + tbChGood.strKcID + "',GoodsID='" + tbChGood.strGoodsID + "',"; str_Add += "EmpId='" + tbChGood.strEmpId + "',GoodsName='" + tbChGood.strGoodsName + "',SellGoodsNum=" + tbChGood.strSellGoodsNum + ","; str_Add += "SellGoodsTime='" + tbChGood.daSellGoodsTime + "',SellPrice=" + tbChGood.deSellPrice + ","; str_Add += "SellNeedPay=" + tbChGood.deSellNeedPay + ",SellHasPay=" + tbChGood.deSellHasPay + ",SellRemark='" + tbChGood.strSellRemark + "',SellFalg=" + tbChGood.intSellFalg + ""; str_Add += " where SellID= '" + tbChGood.strSellID + "'"; _getSqlConnection getConnection = new _getSqlConnection(); conn = getConnection.GetCon(); cmd = new SqlCommand(str_Add, conn); intFalg = cmd.ExecuteNonQuery(); conn.Dispose(); return(intFalg); } catch (Exception ee) { MessageBox.Show(ee.ToString()); return(intFalg); } }
public int tb_SellGoodsDelete(_SellGoods tbChGood) { int intFalg = 0; try { string str_Add = "update tb_SellGoods set "; str_Add += "SellFalg=" + tbChGood.intSellFalg + ""; str_Add += " where SellID= '" + tbChGood.strSellID + "'"; _getSqlConnection getConnection = new _getSqlConnection(); conn = getConnection.GetCon(); cmd = new SqlCommand(str_Add, conn); intFalg = cmd.ExecuteNonQuery(); conn.Dispose(); return(intFalg); } catch (Exception ee) { MessageBox.Show(ee.ToString()); return(intFalg); } }
public int tb_SellGoodsAdd(_SellGoods tbChGood) { int intFalg = 0; try { string str_Add = "insert into tb_SellGoods values( "; str_Add += "'" + tbChGood.strSellID + "','" + tbChGood.strKcID + "','" + tbChGood.strGoodsID + "',"; str_Add += "'" + tbChGood.strEmpId + "','" + tbChGood.strGoodsName + "'," + tbChGood.strSellGoodsNum + ","; str_Add += "'" + tbChGood.daSellGoodsTime + "'," + tbChGood.deSellPrice + ","; str_Add += "" + tbChGood.deSellNeedPay + "," + tbChGood.deSellHasPay + ",'" + tbChGood.strSellRemark + "'," + tbChGood.intSellFalg + ")"; _getSqlConnection getConnection = new _getSqlConnection(); conn = getConnection.GetCon(); cmd = new SqlCommand(str_Add, conn); intFalg = cmd.ExecuteNonQuery(); conn.Dispose(); return(intFalg); } catch (Exception ee) { MessageBox.Show(ee.ToString()); return(intFalg); } }