private void 维修报告_Load(object sender, EventArgs e) { m_rukukuinfo mr = new m_rukukuinfo(); Dt = mr.Select("and id =" + id); Label titile = new Label(); if (Dt[0].处罚部门 == "供应商问题" || Dt[0].责任部门 == "采购部") { IsNextup = true; } if (isOpenTre) { Label kd = Skincss.AddLable(this, "快递", "10/" + toHeig, "60/30", "#100100100", 10, "", 1, -1, false, "#220220220"); kd.Click += Kd_Click; Label hy = Skincss.AddLable(this, "货运", "80/" + toHeig, "60/30", "#100100100", 10, "", 1, -1, false, "#220220220"); hy.Click += Hy_Click; toHeig += 40; Kdinfo.Top = toHeig; Kdinfo.Left = 1; Kdinfo.Width = (Width - 2); Kdinfo.Parent = this; SetControls(true); } else { Label Bf = Skincss.AddLable(this, "报废", "10/" + toHeig, "60/30", "#255255255", 10, "", 1, -1, false, Skin.upRcolor); Bf.Click += Bf_Click; Label Hg = Skincss.AddLable(this, "合格", "80/" + toHeig, "60/30", "#255255255", 10, "", 1, -1, false, Skin.upYcolor); Hg.Click += Hg_Click; int ctoHeig = toHeig; toHeig += 40; titile = Skincss.AddLable(this, "维修反馈信息", "10/" + toHeig, "140/30", "#100100100"); toHeig += 40; Setinfo = Skincss.AddTxt(this, "Setinfo", "无", "10/" + toHeig, (Width - 20) + "/160", "#100100100", 10, -1, true); toHeig += 130; Height += toHeig + 60; Btn = Skincss.AddLable(this, "取消", "10/" + (Height - 60), (Width - 20) + "/50", "100100100", 10, "", 1, -1, false, "#220220220"); Btn.Click += Btn_Click; if (IsNextup) { GysWxf = Skincss.AddLable(this, "维修费", "150/" + ctoHeig, "60/30", "#255255255", 10, "", 1, -1, false, Skin.upBColor); // GysWxf.Click += GysWxf_Click; TextBox Ini_gys = Skincss.AddTxt(this, "Ini_gys", "0", "220/" + ctoHeig, "120/30", "#100100100", 14, -1, true); Ini_gys.TextChanged += Ini_gys_TextChanged; if (Dt[0].终判类型 == "报废") { Bf_Click(Bf, null); } if (Dt[0].终判类型 == "合格") { Hg_Click(Hg, null); } } } }
/// <summary> /// 维修部重新定义单据:保内外,免收费? /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Lb5_Click(object sender, EventArgs e) { SetButton(lb5, "客户"); m_rukukuinfo mr = new m_rukukuinfo(); Dg.数据表名称 = "m_rukuku_内部维修_客户"; List <m_rukukuinfo> ts = mr.Select("and is完成=3"); var m = from r in ts select r.维修单; Dg.ShowList(ts); GetWxinfo(m); }
private void Lb3_Click(object sender, EventArgs e) { SetButton(lb3, "审核"); m_rukukuinfo mr = new m_rukukuinfo(); string sql = "and isnull(is完成,0)=1"; List <m_rukukuinfo> lmr = mr.Select(sql); var m = from r in lmr select r.维修单; Dg.数据表名称 = "BILLnouse2_内部维修_审核"; Dg.ShowList(lmr); GetWxinfo(m); }
private void 明细显示_Load(object sender, EventArgs e) { Mt = new MTable { 分页 = true, 每页数量 = 200, Width = Width - 20, Left = 10, Top = 60, Height = Height - 125, Parent = this }; if (Dc != null) { Mt.分页 = false; Width = 530; Mt.Width = Width - 20; Mt.数据表名称 = "m_rukuku_内部维修_领料list"; Mt.ShowData(Dc); Mt.ReadOnly = false; for (int i = 0; i < Mt.ColumnCount; i++) { if (Mt.Columns[i].HeaderText != "数量") { Mt.Columns[i].ReadOnly = true; } } Label Btn = Skincss.AddLable(this, "确定", "10/" + (Mt.Top + Mt.Height + 10), "120/30", "#255255255", 10, "", 1, -1, false, Skin.upBColor); Btn.Click += Btn_Click; Mt.CellClick += Mt_CellClick; Mt.CellEndEdit += Mt_CellEndEdit; } else { m_rukukuinfo mr = new m_rukukuinfo(); List <m_rukukuinfo> lmr = new List <m_rukukuinfo>(); lmr = mr.Select("and fid=" + id); Mt.数据表名称 = "m_rukuku_内部维修_明细"; Mt.ShowList(lmr); } }
private void Lb4_Click(object sender, EventArgs e) { SetButton(lb4, "实施"); m_rukukuinfo mr = new m_rukukuinfo(); string sql = "and isnull(is完成,0)=0"; if (UserInfo.UName != "lxd" && UserInfo.UName != "郑昌仁" && UserInfo.UName != "连查柳") { sql += " and 责任人='" + UserInfo.UName + "'"; } List <m_rukukuinfo> lmr = mr.Select(sql); var m = from r in lmr select r.维修单; Dg.数据表名称 = "BILLnouse2_内部维修_实施"; Dg.ShowList(lmr); GetWxinfo(m); List <string> tim = new List <string> { "开始维修时间", "结束完成时间" }; Ifun.重置Dgv时间(Dg, tim); }
private void 领取物料_Load(object sender, EventArgs e) { //模拟数据 // Iscode = "CL001254"; m_rukukuinfo Tp = new m_rukukuinfo(); m_rukuku Ftp = new m_rukuku(); List <m_rukuku> fmrt = Ftp.Select(" and id =" + Tp.Select(" and id =" + id)[0].FID); GetSqllist = "and billtype = '旧件维修' and freestr9 ='" + Iscode + "' and referCode ='" + fmrt[0].CODE + "' and Paytype ='" + fmrt[0].维修单 + "' and introducer = '" + UserInfo.UName + "' "; Label tmep = new Label(); //-----领料清单------ tmep = Skincss.AddLable(this, "领料清单", "10/45", "300/30", "#050050050"); mMt = new MTable { 分页 = false, 皮肤设置 = MTable.Skinlist.默认皮肤, 数据表名称 = "m_rukuku_内部维修_领料清单", Width = Width - 20, Left = 10, Top = 85, Height = 195, Parent = this, ReadOnly = true }; mMt.ShowList(bi.Select(GetSqllist)); string sql = "WITH locs (id,materialCODE,completecode )AS( "; sql += "select id, materialCODE, completecode from peiLiaodanku where completecode = '" + Iscode + "' UNION ALL SELECT p.ID, p.materialCODE, p.completecode FROM peiLiaodanku p inner join locs as c on c.materialCODE = p.completecode ) "; sql += " select * from peiLiaodanku where ID in(select id from locs) OPTION(MAXRECURSION 0)"; WBLL wBLL = new WBLL(); wBLL.Start(BLL.数据库.默认数据库, BLL.数据类型.Table, sql); wBLL.WBLL_BgWorker.RunWorkerCompleted += WBLL_BgWorker_RunWorkerCompleted; // DataTable cdd = (DataTable)BLL.SqltoView(); //-------选料清单------ tmep = Skincss.AddLable(this, "选料清单", "10/290", "300/30", "#050050050"); Mt = new MTable { 分页 = true, 皮肤设置 = MTable.Skinlist.默认皮肤, 每页数量 = 200, 数据表名称 = "m_rukuku_内部维修_选料清单", Width = Width - 20, Name = "m_rukuku_内部维修_选料清单", Left = 10, Top = 330, Height = 300, Parent = this, ReadOnly = true }; // Label lld = Skincss.AddLable(this, "生成领料单", "10/650", "180/30", "#255255255", 10, "", 1, -1, false, Skin.upBColor); lld.Click += Lld_Click; }
private void 物料判定_Load(object sender, EventArgs e) { m_rukukuinfo mr = new m_rukukuinfo(); Dt = mr.Select("and id =" + id); int toHeig = 50; Is合格 = Dt[0].终判类型; Is借用 = Dt[0].借用类型; Is客户 = Dt[0].处罚部门; m_rukuku bn = new m_rukuku(); List <m_rukuku> bs = bn.Select("and id=" + Dt[0].FID); Is保修 = bs[0].质保; string sNumm = string.Format("{0}/数量:{2}/{1}/{3}", Dt[0].物料, Is借用, Dt[0].数量, Is保修); if (Is借用 == "新件维修") { sNumm = string.Format("{0}/数量:{2}/{1}", Dt[0].物料, Is借用, Dt[0].数量); } string zRumm = string.Format("由{0}-{1}维修 维修结果为:{2}", Is客户, Dt[0].责任人, Is合格); string fNumm = string.Format("处罚部门[{0}] 处罚人[{1}] 费用[{2}]", Dt[0].处罚部门, Dt[0].处罚人, Dt[0].处罚费用); if (Is客户 == "客户问题") { zRumm = string.Format("由{0} 结果为:{1}", Is客户, Is合格); } Skincss.AddLable(this, " > " + sNumm, "10/" + toHeig, (Width - 20) + "/30", "#100100100", 10, "", 0, -1, false, "#240240240"); toHeig += 40; Skincss.AddLable(this, " > " + zRumm, "10/" + toHeig, (Width - 20) + "/30", "#100100100", 10, "", 0, -1, false, "#240240240"); if (Dt[0].处罚部门 != null) { toHeig += 40; Skincss.AddLable(this, " > " + fNumm, "10/" + toHeig, (Width - 20) + "/30", "#100100100", 10, "", 0, -1, false, "#240240240"); } toHeig += 40; info = Skincss.AddLable(this, "", "10/" + toHeig, (Width - 20) + "/30", "#100100100", 10, "", 0, -1, false, "#240240240"); //----------智能提示------------------ if (Is合格 == "合格") { string jRumm = "当前物料无借用,请安排人员实施安装!"; toHeig += 40; Label SetWl = Skincss.AddLable(this, " > " + jRumm, "10/" + toHeig, (Width - 20) + "/30", Skin.upRcolor, 10, "", 0, -1, false, "#240240240"); SetWl.Name = "借用拆回"; if (Is借用 == "客户借用") { Getck = ReadNum(); decimal GetSq = ReadSenqing(); if (Getck == 0) { if (GetSq > 0) { SetWl.Text = "已经推送消息给仓库,待仓库入库"; SetWl.Click += SetWl_Click; } else { SetWl.Text = "当前物料客户借用,请换回物料![点击执行]"; SetWl.Click += SetWl_Click; } } else { SetWl.Text = "维修人员已换回数量:[" + Getck + "]"; } } } //----------智能提示------------------ Label titile = new Label(); toHeig += 40; Label Bf = new Label(); if (Is合格 == "报废") { if (Is借用 == "客户借用") { Bf = Skincss.AddLable(this, "借用件留用", "10/" + toHeig, "120/30", "#100100100", 10, "", 1, -1, false, "#240240240"); Bf.Click += Bf_Click; } else { Bf = Skincss.AddLable(this, "新物件领用", "10/" + toHeig, "120/30", "#100100100", 10, "", 1, -1, false, "#240240240"); Bf.Click += Bf_Click1; } } if (Is客户 == "客户问题" || Is保修 == "保外") { if (Is借用 != "新件维修") { MF = Skincss.AddLable(this, "申请免费", (Width - 180) + "/" + toHeig, "80/30", "#100100100", 10, "", 1, -1, false, "#240240240"); MF.Click += MF_Click; YH = Skincss.AddLable(this, "申请优惠", (Width - 90) + "/" + toHeig, "80/30", "#100100100", 10, "", 1, -1, false, "#240240240"); YH.Click += MF_Click; } //YH.Click += Cf_Click; } toHeig += 40; Skincss.AddLable(this, "服务费:", "10/" + toHeig, "140/30", "#100100100"); toHeig += 40; TextBox box = Skincss.AddTxt(this, "Setinfo", "0", "10/" + toHeig, (Width - 20) + "/30", Skin.upBColor, 18); box.TextChanged += FYBox_TextChanged; toHeig += 40; titile = Skincss.AddLable(this, "维修总结", "10/" + toHeig, "140/30", "#100100100"); toHeig += 40; Setinfo = Skincss.AddTxt(this, "Setinfo", "无", "10/" + toHeig, (Width - 20) + "/140", "#100100100", 10, -1, true); toHeig += 100; //------------------------------ // 给出处理方案 //------------------------------ toHeig += 40; makeSay = Skincss.AddLable(this, BackInfo(), "10/" + toHeig, "140/30", Skin.upBColor); makeSay.Click += MakeSay_Click; Height += toHeig + 60; Btn = Skincss.AddLable(this, "保 存", "10/" + (Height - 60), (Width - 20) + "/50", "#255255255", 10, "", 1, -1, false, Skin.upBColor); Btn.Click += Btn_Click; if (Is保修 == "保内" && Is合格 == "报废" && Is借用 == "客户借用") { Bf_Click(Bf, null); Bf.Click -= Bf_Click; } }
private void Btn_Click(object sender, EventArgs e) { //---------------------------- Label Tb = sender as Label; if (Is合格 == "合格" && Is借用 == "客户借用" && Is留用 == false) { if (Dt[0].数量 > Getck) { Msg Err = new Msg(3, "未换回客户借用件!请先处理!"); return; } } Tb.Enabled = false; if (Setinfo.Text.Trim() == "") { Msg cc = new Msg(3, "没有维修信息总结!单据无法继续"); Tb.Enabled = true; return; } //------------ //--获取所有记录信息 string SetTo = info.Text + " 优惠金额:" + Wxtime + ",";//发送给配件销售人员 string Zpsx = SetTo; Zpsx += makeSay.Text + ","; if (Is留用) { Zpsx += UserInfo.UName + "选择借用件留用,"; } if (Is免费) { Zpsx += UserInfo.UName + "选择申请免费,"; } if (Is新件) { Zpsx += UserInfo.UName + "选择新物件领用,"; } // ------物料流向---------- //第一情况: if (Is合格 == "合格" && Is借用 == "客户借用") { //Add("借用件换回", Zpsx,true,false); //Zpsx += "合格+客户借用--无需出库"; Add("维修零件结算", Zpsx, false, true, WxFy); #region 除 //RukuKu Rk = new RukuKu(); //Rk.MATERIALCODE = Dt[0].编号; //Rk.REMARK = ""; //Rk.BOXES = 0; //Rk.GUSERDEF3 = ""; //Rk.PRICE = 0; //Rk.AMOUNT = 0; //Rk.PAYEDAMOUNT = 0; //Rk.PAYTYPE =Dt[0].维修单; //Rk.INTRODUCERDATE = SysTime.GetTime; //Rk.BILLTYPE = "借用件换回"; //Rk.ORIGPRICE = 0; //Rk.REFERCODE = Dt[0].维修单; //Rk.TAXRATE = 0; //Rk.BILLNOTE = Zpsx; //Rk.SPECS = Dt[0].物料型号; //Rk.KILLBILLQTY = 0; //Rk.GUSERDEF5 = ""; //Rk.BILLDATE = SysTime.GetTime; //Rk.STORAGEWHERE = ""; //Rk.UNITNAME = Dt[0].单位; //Rk.QUANTITY = Dt[0].数量; //Rk.REFERQTY = 0; //Rk.BATCHNUMBER = Dt[0].维修单; //Rk.GUSERDEF1 = ""; //Rk.CODE = Mcode; //Rk.CLIENT = Kf; //Rk.TAXTYPE = ""; //Rk.BILLMAN = UserInfo.UName; //Rk.AUDITING = "系统自动审核"; //Rk.STORAGENAME = "原材料库"; //Rk.DISCOUNT = 100; //Rk.GUSERDEF2 = ""; //Rk.GUSERDEF4 = ""; //Rk.MAXVALUE = ""; //Rk.FREESTR10 = ","+ Dt[0].维修单; //Rk.Insert(); #endregion } if (Is合格 == "合格" && Is借用 != "客户借用") { Zpsx += "维修完成+无借用--无需出库"; Add("维修零件结算", Zpsx, false, true, WxFy); } if (Is合格 == "合格" && Is借用 == "新件维修") { // Msg Err = new Msg(3, "vvvvvvvvvvvvvvvvvv"); //Zpsx += "维修完成+无借用--无需出库"; //Add("维修零件结算", Zpsx, false, true, WxFy); } if (Is合格 == "报废" && Is借用 == "客户借用") { string Temp = string.Empty; Temp = Zpsx; Zpsx = Temp + "报废+客户借用--无需出库"; Add("维修零件结算", Zpsx, true, true, WxFy); Zpsx = Temp + "报废+客户借用--报废件入库"; Add("售后返厂报废", Zpsx, true, false, 0); } if (Is合格 == "报废" && Is借用 != "客户借用" && Is借用 != "新件维修") { Zpsx += "报废+客户借用--必须出库"; Add("维修零件结算", Zpsx, true, true, WxFy); } if (Is合格 == "报废" && Is借用 == "新件维修") { Add("新件维修", Zpsx, true, false, WxFy); } if (Is新件) { Add("售后服务领料", Zpsx, true, false, WxFy); } m_rukukuinfo mp = new m_rukukuinfo { 物判内容 = Zpsx, 物判总结 = Setinfo.Text, 物判费用 = WxFy, IS完成 = 4 }; mp.Updata("and id=" + id); mp.Reset_m_rukukuinfo(); //---修改单据状态-------- m_rukukuinfo mc = new m_rukukuinfo(); m_rukuku mx = new m_rukuku(); //查询合计数: decimal SumUpNum = mc.Select("and is完成=4 and fid=" + Dt[0].FID).Sum(r => r.数量); decimal SumFNum = mx.Select("and id=" + Dt[0].FID).Sum(r => r.数量); // Msg A = new Msg(3, "分单总量:" + SumUpNum + "/ 总单数量:" + SumFNum); if (SumUpNum == SumFNum) { mx.Reset_m_rukuku(); mx.IS完成 = 4; mx.Updata("and id=" + Dt[0].FID); } //m_rukuku mx = new m_rukuku //{ // IS完成 = 4 //}; //mx.Updata("and id=" + Dt[0].FID); //------------------- //------------------------- doBack = true; Close(); }
private void 旧件终审_Load(object sender, EventArgs e) { m_rukukuinfo mr = new m_rukukuinfo(); Dt = mr.Select("and id =" + id); int toHeig = 50; //基础信息 string zRumm = string.Format("维修部门[{0}] 维修人[{1}] 类型[{2}] 工时[{3}]", Dt[0].责任部门, Dt[0].责任人, Dt[0].维修类型, Dt[0].要求时间); string sNumm = string.Format("物料[{0}] 类型[{1}] 数量[{2}]", Dt[0].物料, Dt[0].借用类型, Dt[0].数量); Skincss.AddLable(this, " > " + sNumm, "10/" + toHeig, (Width - 20) + "/30", "#100100100", 10, "", 0, -1, false, "#240240240"); toHeig += 40; Skincss.AddLable(this, " > " + zRumm, "10/" + toHeig, (Width - 20) + "/30", "#100100100", 10, "", 0, -1, false, "#240240240"); toHeig += 40; info = Skincss.AddLable(this, "", "10/" + toHeig, (Width - 20) + "/30", "#100100100", 10, "", 0, -1, false, "#240240240"); toHeig = 170; Label titile = new Label(); if (Dt[0].处罚部门 == null) { Label Cf = Skincss.AddLable(this, "处罚", (Width - 70) + "/" + toHeig, "60/30", "#255255255", 10, "", 1, -1, false, Skin.upBColor); Cf.Click += Cf_Click; } string isButname = "取消"; string isButBcolor = "#220220220"; string isButFcolor = "#100100100"; if (Dt[0].终判类型 == null) { Label Bf = Skincss.AddLable(this, "报废", "10/" + toHeig, "60/30", "#255255255", 10, "", 1, -1, false, Skin.upRcolor); Bf.Click += Bf_Click;; Label Hg = Skincss.AddLable(this, "合格", "80/" + toHeig, "60/30", "#255255255", 10, "", 1, -1, false, Skin.upYcolor); Hg.Click += Hg_Click; } else { isButname = Dt[0].终判类型.ToString(); isButFcolor = "#255255255"; if (isButname == "报废") { isButBcolor = Skin.upRcolor; } if (isButname == "合格") { isButBcolor = Skin.upYcolor; } } toHeig += 40; titile = Skincss.AddLable(this, "维修信息总结", "10/" + toHeig, "140/30", "#100100100"); toHeig += 40; Setinfo = Skincss.AddTxt(this, "Setinfo", "无", "10/" + toHeig, (Width - 20) + "/160", "#100100100", 10, -1, true); toHeig += 130; Height += toHeig + 60; Btn = Skincss.AddLable(this, isButname, "10/" + (Height - 60), (Width - 20) + "/50", isButFcolor, 10, "", 1, -1, false, isButBcolor); Btn.Click += Btn_Click; }
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(); }