以下是引用片段:
C票据购买审核管理 //1、现货购买的,看库存数量,如果数量充足,直接审核通过 int IGMNUM = 0; if (gvData.DataKeys[num]["GMNUM"] != null && gvData.DataKeys[num]["GMNUM"].ToString()!="") { IGMNUM = Convert.ToInt32(gvData.DataKeys[num]["GMNUM"]); } string strKCWhere = ""; int gmID=Convert.ToInt32(gvData.DataKeys[num]["BILLGMID"]); if (gvData.DataKeys[num]["GMLX"] != null && gvData.DataKeys[num]["GMLX"].ToString().Trim() == "现货购买") { strKCWhere = " and BILLTYPE like '%" + gvData.DataKeys[num]["BILLZL"].ToString() + "%' and ITEMID like '%" + gvData.DataKeys[num]["XMID"].ToString() + "%'"; T_SRORE model = new T_SRORE(); DataTable dt = model.GetVList(strKCWhere).Tables[0]; if (dt != null && dt.Rows.Count >0) { //申请通过 T_BILL_GM gmmodel = new T_BILL_GM(); gmmodel.GMZT = "已审核"; gmmodel.BILLGMID = gmID; if (gmmodel.Update(gmmodel) <= 0) ResponseMessage(this, "审核失败,系统错误!"); else ResponseMessageToUrl(this, "审核成功!", "gmsh.aspx"); else //2、购买印制的,直接发送印刷计划,直接审核通过 List strlist = new List(); strlist.Add("INSERT INTO [T_BILL_PrintTZ] ( [GMSQID] ,[JFSJ] ,[IFQR] ) VALUES ( " + gmID + ",'" + DateTime.Now.ToString() + "',0 )"); //修改购买状态 strlist.Add("UPDATE [T_BILL_GM] set [GMZT] = '已审核' WHERE BILLGMID=" + gmID); if (DbHelperSQL.ExecuteSqlTran(strlist) <= 0) { ResponseMessage(this, "审核失败!请稍后重试!"); return; } else ResponseMessageToUrl (this, "审核成功,印制通知已经发出!请等待回单!","gmsh.aspx"); D.票据购买入库管理 //查询订单详细信息 string strSQL1 = ""; strSQL1 = "SELECT it.XMNAME AS XMNAME, tp.JFRQ AS JFRQ, " + " tp.ITEMID AS ITEMID, tp.BILLLX AS BILLLX, tp.PintNum AS PintNum, " + " tp.PintDDID AS PintDDID FROM dbo.T_Item it RIGHT OUTER JOIN " + " dbo.T_PrintPlan tp ON it.XMID = tp.ITEMID where 1=1 and PintDDID=" + this.gvData.DataKeys[num]["PintDDID"].ToString(); DataTable dt = DbHelperSQL.Query(strSQL1).Tables[0]; string PJLX = "", XMNAME = "", XMID = "", PintNum = ""; XMNAME = dt.Rows[0]["XMNAME"].ToString(); XMID = dt.Rows[0]["ITEMID"].ToString(); PJLX = dt.Rows[0]["BILLLX"].ToString(); PintNum = dt.Rows[0]["PintNum"].ToString(); //回单处理、添加票据库存、修改打印计划状态 List strList = new List(); strList.Add("UPDATE [T_PrintPlan] set [IFHD] = '1' WHERE PintDDID=" + Pddid); //入库相同类型和收费项目的修改库存,否则插入 DataTable dtExit = DbHelperSQL.Query("select BILLID from T_BILL where BILLTYPE='" + PJLX + "' AND ITEMID=" + XMID).Tables[0]; //修改数量 T_SRORE kcModel = new T_SRORE(); kcModel.BILLID = Convert.ToInt32(dtExit.Rows[0][0]); kcModel.STORENUM = int.Parse(PintNum);
|