public static void Input(string MemID, string RFID) { string sql = "update MemberRFID_table set MemberID = '" + MemID + "' where RFIDID = '" + RFID + "'"; Datameans.getsqlcom(sql); //在RFID表中输入会员号和rfid号 }
public static void PanDian(MODEL.Inventory inventory) { string sql = "update stockgoods_table set GoodNum = '" + inventory.Amount + "' where GoodsID = '" + inventory.GoodID + "'"; Datameans.getsqlcom(sql); //根据inventory.GoodID改变inventory.Amount }
public static void DeleteMem(String MemId) { String sql = "update member_table set is_use='停用' where MemberID='" + MemId + "'"; Datameans.getsqlcom(sql); //依据MemId在数据库中删除会员信息 }
public static void ChangeNum(MODEL.InStockdetail instockdetail) { string sql = "select distinct GoodsID from stockgoods_table where GoodsID='" + instockdetail.GoodID + "'"; DataSet a = Datameans.getDataSet(sql); if (a.Tables[0].Rows.Count == 0) { string sql1 = "insert into stockgoods_table(GoodsID,Storename,GoodNum) values('" + instockdetail.GoodID + "','" + instockdetail.Inventory + "','" + instockdetail.Amount + "')"; Datameans.getsqlcom(sql1); } //如果表中有ID,根据入库单商品ID在库存表里增加相应数量Amount else { string sql2 = "update stockgoods_table set GoodNum = GoodNum + '" + instockdetail.Amount + "' where GoodsID='" + instockdetail.GoodID + "'"; Datameans.getsqlcom(sql2); } //如果表中没有该商品ID插入以下信息 //Datameans.getsqlcom(sql1); }
public static void InputMember(Member m) { // id card 改为 phone number String sql = "insert into member_table(MemberID,Name,Sex,Password,email,identitycard,balance,enrolldate,operateStaff) values('" + m.MemCardID + "','" + m.MemName + "','" + m.MemSex + "','" + m.MemPd + "','" + m.Memtel + "','" + m.IDCard + "','" + m.Memacount + "','" + m.Registtime + "','" + m.operateStaff + "')"; Datameans.getsqlcom(sql); //插入m的八项内容 //m.MemCardID; //m.MemName // m.Memtel //m.MemSex //m.Memacount //m.IDCard //m.Registtime //m.operateStaff }
public static bool updateMemBalance(string memID, double bal) { String sql = "update member_table set balance = '" + bal + "' where MemberID='" + memID + "'"; Datameans.getsqlcom(sql); return(true); //更新会员卡内余额,通过memID进行,bal为新会员卡余额,成功返回true,失败返回false }
public static bool updateLockInfo(lockerInfo locker) { string sql = "update LockBox_table set MemberID = '" + locker.userID + "', is_locked='" + (locker.isLocked == true ? 1 : 0) + "' where LockNumber='" + locker.LockNumber + "'"; Datameans.getsqlcom(sql); //更新箱柜信息 return(true); }
public static void refreshRFIDInfo(string RFIDID, string goodID, int isSold) // 更新RFID表 { string sql = "update GoodsRFID set IS_SOLD = 1 where RFID_ID ='" + RFIDID + "'"; Datameans.getsqlcom(sql); string sql1 = "update stockgoods set GoodNum = GoodNum -1"; Datameans.getsqlcom(sql1); //更新RFID表 }
public static void InPutGoodsRFID(string goodID, string RFID) { String sql = "insert into GoodsRFID(RFID_ID,Good_ID,IS_SOLD) values('" + RFID + "','" + goodID + "','" + "0')"; Datameans.getsqlcom(sql); //插入goodsrfid表 }
public static bool updateMemCostDetail(costInfo cost) // 商品销售,添加销售信息 , 商品销售表 { DataSet a = new DataSet(); String sql = "select distinct Goodsname,Suppliername from stockdetail_table where GoodsID = '" + cost.goodID + "'"; a = Datameans.getDataSet(sql); String Goodname = a.Tables[0].Rows[0][0].ToString(); String suppliername = a.Tables[0].Rows[0][1].ToString(); String sql1 = "insert into selldetail_table(SellId,GoodsName,MemberID,Goodsnum,Sellprice,Totalprice,Selltime) values('" + cost.billNumber + "','" + Goodname + "','" + cost.memID + "','" + cost.goodNum + "','" + cost.cost + "','" + cost.total + "','" + cost.date + "')"; Datameans.getsqlcom(sql1); //更新销售汇总表 string sql2 = "select distinct GoodsID from selltotal_table where GoodsID='" + cost.goodID + "' and Date = '" + cost.date.Split(' ')[0] + "'"; DataSet b = Datameans.getDataSet(sql2); if (b.Tables[0].Rows.Count == 0) { string sql3 = "insert into selltotal_table(GoodsID,Goodname,suppliername,amount,Date) values('" + cost.goodID + "','" + Goodname + "','" + suppliername + "','" + cost.goodNum + "','" + cost.date.Split(' ')[0] + "')"; Datameans.getsqlcom(sql3); } //如果表中有ID,根据入库单商品ID在库存表里增加相应数量Amount else { string sql4 = "update selltotal_table set amount = amount + '" + cost.goodNum + "' where GoodsID='" + cost.goodID + "'"; Datameans.getsqlcom(sql4); } return(true); }
public static void UpdateMem(MODEL.Member m) { String sql = "update member_table set Name = '" + m.MemName + "',Sex='" + m.MemSex + "', Password='******',email='" + m.Memtel + "',Identitycard='" + m.IDCard + "',balance='" + m.Memacount + "', enrolldate='" + m.Registtime + "', operateStaff='" + m.operateStaff + "' where MemberID='" + m.MemCardID + "'"; //依据m.MemCardID修改所有内容 Datameans.getsqlcom(sql); }
///质检单系列 public static void InputQAmain(MODEL.QAmain qamain) { String sql = "insert into qualitymain_table(qualityID,Suppliername,StaffID,checkdate) values('" + qamain.QAID + "','" + qamain.Supplier + "','" + qamain.Operator + "','" + qamain.Date + "')";//依据qamain.QAID即质检单号插入质检单号、 //qamain.Supplier供应商 //qamain.Operator操作员号 // qamain.Date日期 Datameans.getsqlcom(sql); }
public static void InPutMain(MODEL.InStockMain instockmain) { String sql = "insert into stockmain_table(GoodinID,qualityID,Indate,Handlepeople) values('" + instockmain.InID + "','" + instockmain.QAID + "','" + instockmain.Date + "','" + instockmain.Operator + "')"; Datameans.getsqlcom(sql); //插入instockmain.InID入库单号 //instockmain.QAID质检单号 //instockmain.Date入库日期 //instockmain.Operator入库员 }
public static void InputQAdetail(MODEL.QAdetail qadetail) { String sql = "insert into qualitydetail_table(qualityID,GoodsID,Goodsname,unit,GoodsNum,is_check) values('" + qadetail.QAID + "','" + qadetail.GoodID + "','" + qadetail.GoodName + "','" + qadetail.Unit + "','" + qadetail.Amount + "','" + qadetail.Check + "')";//依据QAID插入商品号、名、单位、数量、类型、是否合格 Datameans.getsqlcom(sql); }
public static void InputRecord(MODEL.RechargeRecord record) { string sql1 = "insert into payrecord_table(PayId,MemberID,amount,Paydate,OperateStaff) values('" + "','" + record.MemCardID + "','" + record.RechargeAmount + "','" + record.RechargeTime + "','" + record.Operator + "')"; Datameans.getsqlcom(sql1); //插入ID、姓名、充值金额、操作员、时间 //record.MemCardID; //record.RechargeAmount; //record.Operator; //record.RechargeTime; }
public static void InputDetail(MODEL.InStockdetail instockdetail) { String sql = "insert into stockdetail_table(GoodinID,GoodsID,Goodsname,Suppliername,Storename,GoodsinNum,Goodsinprice) values('" + instockdetail.InID + "','" + instockdetail.GoodID + "','" + instockdetail.GoodName + "','" + instockdetail.Supplier + "','" + instockdetail.Inventory + "','" + instockdetail.Amount + "','" + instockdetail.goodinprice + "')"; Datameans.getsqlcom(sql); //插入入库单从表 }