private decimal ReadSenqing() { decimal BNum = 0; BILLnouse2 r = new BILLnouse2(); List <BILLnouse2> ru = r.Select("and billtype='借用拆回' and materialcode='" + Dt[0].编号 + "'and FREENUM2='" + id + "' and paytype='" + Dt[0].维修单 + "' "); BNum = decimal.Parse((from a in ru select a.QUANTITY).Sum().ToString()); return(BNum); }
/// <summary> /// 接收或是处理 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Bbt_Click(object sender, EventArgs e) { Label bt = sender as Label; if (Sx == "接收") { bt.Enabled = false; BILLnouse2 bi = new BILLnouse2(); bi.FREENUM5 = 1; bi.Updata(" and id=" + id); //mc.Update接收维修信息(id); string getcode = IData.GetCode("m_rukuku", "NB"); m_rukuku Mr = new m_rukuku { CODE = getcode, 关联ID = id, 关联号 = (string)Ifun.IsDBnull(Dg.SelectedRows[0].Cells["code"].Value.ToString(), ""), 维修单 = Dg.SelectedRows[0].Cells["paytype"].Value.ToString(), 录单人 = UserInfo.UName, 录单时间 = SysTime.GetTime, 借用类型 = Ifun.IsDBnull(Dg.SelectedRows[0].Cells["freestr7"].Value.ToString(), "无借用").ToString(), 编号 = Dg.SelectedRows[0].Cells["materialCODE"].Value.ToString(), 物料 = Dg.SelectedRows[0].Cells["materialNAME"].Value.ToString(), 物料型号 = Dg.SelectedRows[0].Cells["specs"].Value.ToString(), 单位 = Dg.SelectedRows[0].Cells["UNITNAME"].Value.ToString(), 质保 = WXB, 数量 = decimal.Parse(Dg.SelectedRows[0].Cells["QUANTITY"].Value.ToString()), 仓库 = "维修库", 客户 = KF, 机床码 = JC, 维修人 = WXM }; Mr.Insert(); Dg.Rows.RemoveAt(Dg.SelectedRows[0].Index); } if (Sx == "评判") { decimal A = decimal.Parse(Dg.SelectedRows[0].Cells["数量"].Value.ToString()); decimal B = Dg.SelectedRows[0].Cells["已处理"].Value.ToString() == "" ? 0 : decimal.Parse(Dg.SelectedRows[0].Cells["已处理"].Value.ToString()); if (A - B > 0) { num = A - B; 旧件处理 Js = new 旧件处理(id, num, KF); if (Js.doBack) { Lb1_Click(null, null); } } else { Msg err = new Msg(3, "单据数量已处理完!"); } } }
/// <summary> /// 接收物料单 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Lb_Click(object sender, EventArgs e) { SetButton(lb, "接收"); Dg.数据表名称 = "BILLnouse2_内部维修_接收"; BILLnouse2 JC = new BILLnouse2(); string where = "and BILLTYPE ='售后返厂维修' and (isnull(Paytype,'')<>'')and left(code,1)<>'*' and (freenum5 is null or freenum5 < 1)"; List <BILLnouse2> bs = JC.Select(where); var m = from r in bs select r.PAYTYPE; Dg.ShowList(bs); GetWxinfo(m); }
public List <WXOBJ1> NeibuWx(string userName) { string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string; string session = Session.SessionID.ToString(); if (!cookies.Equals(session)) { return(null);//身份验证失败 } MLogin.GetExeUname(); List <WXOBJ1> ms = new List <WXOBJ1>(); BILLnouse2 JC = new BILLnouse2(); string where = "and BILLTYPE ='售后返厂维修' and (isnull(Paytype,'')<>'')and left(code,1)<>'*' and (freenum5 is null or freenum5 < 1)"; List <BILLnouse2> bs = JC.Select(where, " PAYTYPE "); string str = string.Empty; foreach (BILLnouse2 h in bs) { str += "'" + h.PAYTYPE + "',"; } str = str.Substring(0, str.Length - 1); clientservice_AfterServiceBill bill = new clientservice_AfterServiceBill(); List <clientservice_AfterServiceBill> list = bill.Select(" and BILLMAN='" + userName + "' and code in (" + str + ")"); foreach (clientservice_AfterServiceBill c in list) { WXOBJ1 o = new WXOBJ1(); o.BILLMAN = c.BILLMAN; o.CLIENT = c.CLIENT; o.BILLTYPE = c.BILLTYPE; o.ZF1 = c.ZF1; ms.Add(o); } return(ms); }
private void Add(string 业务类型, string 备注, bool 物料清单 = false, bool 维修费 = false, decimal Fuf = 0, int frNum2 = 0) { string Mcode = IData.GetCode("BILLnouse2", "YL"); string 审核 = "系统自动审核"; if (Is免费 || Is优惠 || Is新件) { 审核 = ""; } if (物料清单) { BILLnouse2 bl = new BILLnouse2 { CODE = Mcode, BILLTYPE = 业务类型,// "借用件换回", BILLDATE = DateTime.Now.Date, CLIENT = Kf, TAXRATE = 1, PAYTYPE = Dt[0].维修单, BILLMAN = UserInfo.UName, BILLNOTE = 备注, //Zpsx, STORAGENAME = "", STORAGEWHERE = "", AUDITING = 审核, INTRODUCER = UserInfo.UName, INTRODUCERDATE = DateTime.Now, FINISHDATE = DateTime.Now, MATERIALCODE = Dt[0].编号, MATERIALNAME = Dt[0].物料, SPECS = Dt[0].物料型号, UNITNAME = Dt[0].单位, QUANTITY = Dt[0].数量, ORIGPRICE = 0, PRICE = 0, AMOUNT = 0, KILLBILLQTY = 0, REFERQTY = -1, PAYEDAMOUNT = 0, BATCHNUMBER = "", REFERCODE = Dt[0].维修单, DISCOUNT = 100, BOXES = 0, GUSERDEF1 = "", GUSERDEF4 = "", GUSERDEF5 = "", MAXVALUE = "", FREENUM2 = frNum2, FREESTR7 = "", FREESTR8 = Dt[0].维修单, FREESTR9 = Mcode, FREESTR10 = "," + Dt[0].维修单, 引用单号2 = Mcode }; bl.Insert(); } if (维修费) { //产生维修服务费 BILLnouse2 cbl = new BILLnouse2 { CODE = Mcode, BILLTYPE = 业务类型,// "借用件换回", BILLDATE = DateTime.Now.Date, CLIENT = Kf, TAXRATE = 1, PAYTYPE = Dt[0].维修单, BILLMAN = UserInfo.UName, BILLNOTE = 备注, //Zpsx, STORAGENAME = "", STORAGEWHERE = "", AUDITING = 审核, INTRODUCER = UserInfo.UName, INTRODUCERDATE = DateTime.Now, FINISHDATE = DateTime.Now, MATERIALCODE = "99.001", MATERIALNAME = "维修费", SPECS = "", UNITNAME = "次", QUANTITY = 1, ORIGPRICE = 0, PRICE = Fuf, AMOUNT = 0, KILLBILLQTY = 0, REFERQTY = -1, PAYEDAMOUNT = 0, BATCHNUMBER = "", REFERCODE = Dt[0].维修单, DISCOUNT = 100, BOXES = 0, GUSERDEF1 = "", GUSERDEF4 = "", GUSERDEF5 = "", MAXVALUE = "", FREESTR7 = "", FREENUM2 = frNum2, FREESTR8 = Dt[0].维修单, FREESTR9 = Mcode, FREESTR10 = "," + Dt[0].维修单, 引用单号2 = Mcode }; cbl.Insert(); } }
private void Btn_Click(object sender, EventArgs e) { (sender as Label).Text = "正在保存中..."; (sender as Label).Enabled = false; m_rukukuinfo Tp = new m_rukukuinfo(); m_rukuku Ftp = new m_rukuku(); List <m_rukukuinfo> mrt = Tp.Select(" and id =" + id); List <m_rukuku> fmrt = Ftp.Select(" and id =" + mrt[0].FID); string Iscode = IData.GetCode("BILLnouse2", "YL"); for (int i = 0; i < Mt.RowCount; i++) { BILLnouse2 bl = new BILLnouse2 { CODE = Iscode, BILLTYPE = "旧件维修", BILLDATE = DateTime.Now.Date, CLIENT = Kf, TAXRATE = 1, PAYTYPE = mrt[0].维修单, BILLMAN = UserInfo.UName, BILLNOTE = "", STORAGENAME = "", STORAGEWHERE = "", AUDITING = "", INTRODUCER = UserInfo.UName, INTRODUCERDATE = DateTime.Now, FINISHDATE = DateTime.Now, MATERIALCODE = Mt.Rows[i].Cells["物料编码"].Value.ToString(), MATERIALNAME = Mt.Rows[i].Cells["物料名称"].Value.ToString(), SPECS = Mt.Rows[i].Cells["物料型号"].Value.ToString(), UNITNAME = Mt.Rows[i].Cells["单位"].Value.ToString(), QUANTITY = decimal.Parse(Mt.Rows[i].Cells["数量"].Value.ToString()), ORIGPRICE = 0, PRICE = 0, AMOUNT = 0, KILLBILLQTY = 0, REFERQTY = -1, PAYEDAMOUNT = 0, BATCHNUMBER = "", REFERCODE = fmrt[0].CODE, DISCOUNT = 100, BOXES = 0, GUSERDEF1 = "", GUSERDEF4 = "", GUSERDEF5 = "", MAXVALUE = "", FREESTR7 = "", FREESTR8 = mrt[0].维修单, FREESTR9 = Fcode, FREESTR10 = "," + mrt[0].维修单 + "," + fmrt[0].CODE, 引用单号2 = mrt[0].维修单 }; bl.Insert(); } ResData(); Close(); }