public int ThGoodsUpdate(getTuihuo tbChGood) { int intFalg = 0; try { string str_Update = "update tb_ThGoodsInfo set "; str_Update += "KcID='" + tbChGood.strKcID + "',GoodsID='" + tbChGood.strGoodsID + "',"; str_Update += "SellID='" + tbChGood.strSellID + "',EmpId='" + tbChGood.intEmpId + "',ThGoodsName='" + tbChGood.strThGoodsName + "',"; str_Update += "ThGoodsNum=" + tbChGood.intThGoodsNum + ",ThGoodsTime='" + tbChGood.daThGoodsTime + "',ThGoodsPrice=" + tbChGood.deThGoodsPrice + ","; str_Update += "ThHasPay=" + tbChGood.deThHasPay + ",ThNeedPay=" + tbChGood.deThNeedPay + ",ThGoodsResult='" + tbChGood.deThGoodsResult + "' where ThGoodsID='" + tbChGood.strThGoodsID + "'"; getSqlConnection getConnection = new getSqlConnection(); conn = getConnection.GetCon(); cmd = new SqlCommand(str_Update, conn); intFalg = cmd.ExecuteNonQuery(); conn.Dispose(); return(intFalg); } catch (Exception ee) { MessageBox.Show(ee.ToString()); return(intFalg); } }
public int ThGoodsAdd(getTuihuo tbChGood) { int intFalg = 0; try { string str_Add = "insert into tb_ThGoodsInfo values( "; str_Add += "'" + tbChGood.strThGoodsID + "','" + tbChGood.strKcID + "','" + tbChGood.strGoodsID + "',"; str_Add += "'" + tbChGood.strSellID + "','" + tbChGood.intEmpId + "','" + tbChGood.strThGoodsName + "',"; str_Add += "" + tbChGood.intThGoodsNum + ",'" + tbChGood.daThGoodsTime + "'," + tbChGood.deThGoodsPrice + ","; str_Add += "" + tbChGood.deThHasPay + "," + tbChGood.deThNeedPay + ",'" + tbChGood.deThGoodsResult + "')"; 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); } }