| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672 |
- using com.hnshituo.pur.vo;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Tool;
- using Infragistics.Win.UltraWinGrid;
- using Pur.Entity;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using Pur.require_plan;
- using Core.Mes.Client.Comm.Server;
- using Pur.PublicTools;
- using Pur.Entity.configureEntity;
- using Pur.configure;
- namespace Pur.ck
- {
- public partial class frmCkOutBillManaYB : FrmPmsBase
- {
- public frmCkOutBillManaYB()
- {
- InitializeComponent();
- }
- private void frmCkOutBillManaYB_Load(object sender, EventArgs e)
- {
- txt_isPrint.SelectedIndex = 1;
- txt_CreateTimeStart.Value = DateTime.Now.AddMonths(-1);
- txt_CreateTimeEnd.Value = DateTime.Now.AddDays(1);
- getdropDownList();
- is_JIT.Checked = true;
- is_single.Checked = true;
- ck_adjust.Checked = false;
- txt_reqDepart1.Enabled = false;
- txt_Dept1.Enabled = false;
- ultraGrid1.DisplayLayout.Bands[0].Columns["CHK"].Hidden = true;
- GridHelper.SetExcludeColumnsActive(ultraGrid1.DisplayLayout.Bands[0], new string[] { "CHK", "surplusQty" });
- GridHelper.SetExcludeColumnsActive(ultraGrid2.DisplayLayout.Bands[0], new string[] { });
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "doQuery":
- getOutbillData("");
- break;
- case "Close":
- this.Close();
- break;
- case "UltraGridToExcel"://导出入口单
- UltraGridToExcel();
- break;
- case "doPrint"://导出入口单
- doPrint("0");
- break;
- case "doPrint_cf"://重复打印入口单
- doPrint("1");
- break;
- case "cancelPrint"://导出入口单
- cancelPrint();
- break;
- }
- }
- /// <summary>
- /// 取消打印
- /// </summary>
- private void cancelPrint()
- {
- List<CkOutBill> al = new List<CkOutBill>();//取消打印出库单清单
- StringBuilder bu=new StringBuilder();
- ultraGrid1.UpdateData();
- foreach (UltraGridRow row in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(row.GetCellValue("CHK")) == true)
- {
- CkOutBill pcibEntity = new CkOutBill();
- pcibEntity.OutStockNo = row.GetCellValue("outStockno").ToString().Trim();
- String strPrintCode1 = ultraGrid1.ActiveRow.GetCellValue("PrintCode").ToString().Trim();
- if (String.IsNullOrEmpty(strPrintCode1))
- {
- MessageUtil.ShowTips("出库单:" + pcibEntity.OutStockNo + " 未打印");
- row.Activate();
- return;
- }
- pcibEntity.CreateName = UserInfo.GetUserName();
- pcibEntity.CreateUserid = UserInfo.GetUserID();
- pcibEntity.CreateTime = DateTime.Now;
- //pcibEntity.PrintCode = strPrintNo;
- al.Add(pcibEntity);
- bu.Append(pcibEntity.OutStockNo+",");
- }
- }
- if (al.Count <= 0)
- {
- MessageUtil.ShowTips("请选择需取消打印的出库单行");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("确定取消打印出库单:" + bu.ToString() + "? 若为汇总打印,将同步取消关联出库单打印记录。") != DialogResult.Yes)
- {
- return;
- }
- CoreResult rt1 = this.execute<CoreResult>("com.hnshituo.pur.ck.service.CkOutBillService", "cancelAllPrint", new object[] { al });
- if (rt1.Resultcode != 0)
- {
- MessageUtil.ShowTips("取消标记打印失败:" + rt1.Resultmsg);
- }
- else
- {
- MessageUtil.ShowTips("操作成功");
- getOutbillData(al[al.Count - 1].OutStockNo);
- }
- }
- private void doPrint(String strTips)
- {
- List<CkOutBill> al = new List<CkOutBill>();//打印出库单清单
- DataTable dt = ServerHelper.GetData("com.hnshituo.pur.configure.service.impl.CoreBaseInfoNew.doQuery", new Object[] { "1223" }, this.ob);
- DataRow[] drArr = dt.Select("validflag='1'");
- if (drArr.Length != 1)
- {
- MessageUtil.ShowTips("基础数据维护错误:报表系统需维护有效的Ip且只能维护一个有效ip!");
- return;
- }
- String TipsEnv = drArr[0]["baseName"].ToString();
- String strUrlPort = "http://172.54.10.42:8080";//报表系统IP
- String[] str = strUrlPort.Split(':');
- String strUrl = str[0] + ":" + str[1];
- String isAll_print = "0";//是否汇总打印
- if (!is_single.Checked)
- {
- //汇总打印
- if (!ck_single_m.Checked)
- {
- String strDeptUse = "";
- String strDept = txt_Dept1.Value == null ? "" : txt_Dept1.Value.ToString();
- String strReqDept = txt_reqDepartCode.Text.ToString();
- if (is_JIT.Checked)
- {
- if (String.IsNullOrEmpty(strDept))
- {
- MessageUtil.ShowTips("若选择按照成本中心打印,请先指定成本中心");
- return;
- }
- strDeptUse = strDept;
- }
- else
- {
- if (String.IsNullOrEmpty(strReqDept))
- {
- MessageUtil.ShowTips("若选择按照领用单位打印,请先指定领用单位");
- return;
- }
- strDeptUse = strReqDept;
- }
- //string strPrintNo = getPrintCode();
- string stroutStockno = "";
- ultraGrid1.UpdateData();
- List<UltraGridRow> rows = new List<UltraGridRow>();
- foreach (UltraGridRow row in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(row.GetCellValue("CHK")) == true)
- {
- rows.Add(row);
- }
- }
- if (ultraGrid1.Rows.Where(t => t.Selected).Count() > 0 && rows.Count <= 0)
- {
- foreach (UltraGridRow row in ultraGrid1.Rows.Where(t => t.Selected))
- {
- rows.Add(row);
- }
- }
- foreach (UltraGridRow row in rows)
- {
- String strOutStockNo = row.GetCellValue("outStockno").ToString().Trim();
- stroutStockno += "'" + strOutStockNo + "',";
- CkOutBill pcibEntity = new CkOutBill();
- pcibEntity.OutStockNo = strOutStockNo;
- if (String.IsNullOrEmpty(strOutStockNo))
- {
- MessageUtil.ShowTips("若单张打印的出库单号不能为空");
- return;
- }
- CkOutBill outbill = this.execute<CkOutBill>("com.hnshituo.pur.ck.service.CkOutBillService", "findById", new object[] { strOutStockNo });
- if (outbill == null)
- {
- MessageUtil.ShowTips("未发现出库单:" + strOutStockNo + "信息记录");
- row.Activate();
- return;
- }
- //if (!String.IsNullOrEmpty(outbill.PrintCode) && strTips == "0")
- //{
- // MessageUtil.ShowTips("出库单:" + strOutStockNo + " 已打印,或请取消打印");
- // row.Activate();
- // return;
- //}
- //if (String.IsNullOrEmpty(outbill.PrintCode) && strTips == "1")
- //{
- // MessageUtil.ShowTips("出库单:" + strOutStockNo + " 还未打印,或请先打印");
- // row.Activate();
- // return;
- //}
- pcibEntity.CreateName = UserInfo.GetUserName();
- pcibEntity.CreateUserid = UserInfo.GetUserID();
- pcibEntity.CreateTime = DateTime.Now;
- pcibEntity.SurplusQty = double.Parse(row.GetCellValue("surplusQty").ToString().Trim());
- al.Add(pcibEntity);
- }
- if (al.Count <= 0)
- {
- MessageUtil.ShowTips("请选择打印出库单行");
- return;
- }
- stroutStockno = stroutStockno.Remove(0, 1);
- stroutStockno = stroutStockno.Remove(stroutStockno.Length - 2);
- strUrl = strUrlPort + "/webroot/decision/view/report?viewlet=rpt_OutBill.cpt&op=view" + "&dept=" + strDeptUse + "&outStockNo=" + stroutStockno + "&TYPE=0" + "&ID=" + 1232025;
- isAll_print = "1";
- }
- //单张连打
- else
- {
- string stroutStockno = "";
- ultraGrid1.UpdateData();
- foreach (UltraGridRow row in ultraGrid1.Rows)
- {
- if (Convert.ToBoolean(row.GetCellValue("CHK")) == true)
- {
- String strOutStockNo = row.GetCellValue("outStockno").ToString().Trim();
- stroutStockno += "'" + strOutStockNo + "',";
- CkOutBill pcibEntity = new CkOutBill();
- pcibEntity.OutStockNo = strOutStockNo;
- pcibEntity.CreateName = UserInfo.GetUserName();
- pcibEntity.CreateUserid = UserInfo.GetUserID();
- pcibEntity.CreateTime = DateTime.Now;
- pcibEntity.SurplusQty = double.Parse(row.GetCellValue("surplusQty").ToString().Trim());
- if (String.IsNullOrEmpty(strOutStockNo))
- {
- MessageUtil.ShowTips("若单张打印的出库单号不能为空");
- return;
- }
- CkOutBill outbill = this.execute<CkOutBill>("com.hnshituo.pur.ck.service.CkOutBillService", "findById", new object[] { strOutStockNo });
- if (outbill == null)
- {
- MessageUtil.ShowTips("未发现出库单:" + strOutStockNo + "信息记录");
- row.Activate();
- return;
- }
- //if (!String.IsNullOrEmpty(outbill.PrintCode) && strTips == "0")
- //{
- // MessageUtil.ShowTips("出库单:" + strOutStockNo + " 已打印,或请取消打印");
- // row.Activate();
- // return;
- //}
- //if (String.IsNullOrEmpty(outbill.PrintCode) && strTips == "1")
- //{
- // MessageUtil.ShowTips("出库单:" + strOutStockNo + " 还未打印,或请先打印");
- // row.Activate();
- // return;
- //}
- //pcibEntity.PrintCode = strPrintNo;
- al.Add(pcibEntity);
- }
- }
- if (al.Count <= 0)
- {
- MessageUtil.ShowTips("请选择打印出库单行");
- return;
- }
- stroutStockno = stroutStockno.Remove(0, 1);
- stroutStockno = stroutStockno.Remove(stroutStockno.Length - 2);
- strUrl = strUrlPort + "/webroot/decision/view/report?viewlet=rpt_OutBill_single_ly_m.cpt&op=view" + "&outStockNo=" + stroutStockno + "&TYPE=0" + "&ID=" + 1232025;
- }
- }
- else
- {
- if (ultraGrid1.ActiveRow == null)
- {
- MessageUtil.ShowTips("若单张打印,请选择需打印大出库单");
- return;
- }
- String strOutStockNo = ultraGrid1.ActiveRow.GetCellValue("outStockno").ToString().Trim();
- if (String.IsNullOrEmpty(strOutStockNo))
- {
- MessageUtil.ShowTips("若单张打印的出库单号不能为空");
- return;
- }
- CkOutBill outbill = this.execute<CkOutBill>("com.hnshituo.pur.ck.service.CkOutBillService", "findById", new object[] { strOutStockNo });
- if (outbill == null)
- {
- MessageUtil.ShowTips("未发现出库单:" + strOutStockNo + "信息记录");
- return;
- }
- //if (!String.IsNullOrEmpty(outbill.PrintCode) && strTips == "0")
- //{
- // MessageUtil.ShowTips("出库单:" + strOutStockNo + " 已打印,或请取消打印");
- // return;
- //}
- //if (String.IsNullOrEmpty(outbill.PrintCode) && strTips == "1")
- //{
- // MessageUtil.ShowTips("出库单:" + strOutStockNo + " 还未打印,或请先打印");
- // return;
- //}
- //string strPrintNo = getPrintCode();
- if (is_JIT.Checked)
- {
- strUrl = strUrlPort + "/webroot/decision/view/report?viewlet=rpt_OutBill_single.cpt&op=view" + "&outStockNo=" + strOutStockNo + "&TYPE=0";
- }
- else
- {
- strUrl = strUrlPort + "/webroot/decision/view/report?viewlet=rpt_OutBill_single_ly.cpt&op=view" + "&outStockNo=" + strOutStockNo + "&TYPE=0" + "&ID=" + 1232025;
- }
- CkOutBill pcibEntity = new CkOutBill();
- pcibEntity.OutStockNo = strOutStockNo;
- //pcibEntity.PrintCode = strPrintNo;
- pcibEntity.CreateName = UserInfo.GetUserName();
- pcibEntity.CreateUserid = UserInfo.GetUserID();
- pcibEntity.CreateTime = DateTime.Now;
- pcibEntity.SurplusQty = double.Parse(ultraGrid1.ActiveRow.GetCellValue("surplusQty").ToString().Trim());
- al.Add(pcibEntity);
- }
- //strUrl = "http://localhost:8075/webroot/decision/view/report?viewlet=rpt_OutBill_test.cpt&op=view" + "&dept=" + strDept + "&itemClass=" + strItemClass + "&create_time_start=" + strStart + "&create_time_end=" + strEnd + "&inv_physic=" + strInvPhysic;
- if (strTips == "0")
- {
- CoreResult rt = this.execute<CoreResult>("com.hnshituo.pur.ck.service.CkOutBillService", "doPrint", new object[] { al, isAll_print });
- if (rt.Resultcode != 0)
- {
- MessageUtil.ShowTips("生成打印编号失败:" + rt.Resultmsg);
- return;
- }
- }
- comm.printReport(this.ob, strUrl, "出库单打印");
- if (strTips == "0")
- {
- if (!MessageUtil.ShowYesNoAndQuestion("是否已打印出库单?").Equals(DialogResult.Yes))
- {
- CoreResult rt1 = this.execute<CoreResult>("com.hnshituo.pur.ck.service.CkOutBillService", "cancelPrint", new object[] { al });
- if (rt1.Resultcode != 0)
- {
- MessageUtil.ShowTips("取消标记打印失败:" + rt1.Resultmsg);
- }
- }
- getOutbillData(al[al.Count - 1].OutStockNo);
- }
-
- }
- /// <summary>
- /// 获取打印编号
- /// </summary>
- /// <returns></returns>
- private string getPrintCode()
- {
- //获取打印编号
- string strPrintNo = "";
- PurPrintNoEntity ppn = new PurPrintNoEntity();
- ppn.Remark = "出库单打印";
- ppn.PrintType = "2";
- ppn.CreateName = UserInfo.GetUserName();
- ppn.CreateUserid = UserInfo.GetUserID();
- CoreResult core = this.execute<CoreResult>("com.hnshituo.pur.ck.service.CkInBillService", "getPrintNo", new object[] { ppn });
- if (core.Resultcode == 0)
- {
- strPrintNo = core.Resultmsg;
- }
- else
- {
- MessageUtil.ShowTips(core.Resultmsg);
- }
- return strPrintNo;
- }
- private DateTime setCreateTimeEnd(Object value)
- {
- DateTime time = Convert.ToDateTime(value);
- DateTime endtime = new DateTime(time.Year, time.Month, time.Day, 23, 59, 59);
- return endtime;
- }
- private DateTime setCreateTimeStart(Object value)
- {
- DateTime time = Convert.ToDateTime(value);
- DateTime endtime = new DateTime(time.Year, time.Month, time.Day, 0, 0, 0);
- return endtime;
- }
- private void getOutbillData(String strOutBill)
- {
- try
- {
- dataSet1.Clear();
- CkOutBill el = new CkOutBill();
- String strDept = txt_Dept.Value == null ? "" : txt_Dept.Value.ToString();
- el.UseOrgId = strDept;
- String strReqDept = txt_reqDepart.Value == null ? "" : txt_reqDepart.Value.ToString();
- el.UseOrgName = strReqDept;
- if (txt_CreateTimeStart.Text != null)
- {
- el.CreateTime = setCreateTimeStart(txt_CreateTimeStart.Value);
- }
- if (txt_CreateTimeEnd.Text != null)
- {
- el.UpdateTime = setCreateTimeEnd(txt_CreateTimeEnd.Value);
- }
- //if (txt_InvPhysic.SelectedIndex != -1)
- //{
- // el.DeliverAddress = txt_InvPhysic.Value.ToString();
- //}
- if (txt_ItemClass.SelectedIndex != -1)
- {
- el.ItemAttrId = txt_ItemClass.Value.ToString();
- }
- if (txt_isPrint.SelectedIndex != -1)
- {
- el.DeleteUserid = txt_isPrint.Value.ToString().Trim();
- }
- el.PrintCode = txt_printCode.Text.Trim();
- el.OutStockNo = txt_outStockno.Text.Trim();
- el.ItemCode = txt_itemCode.Text.Trim();
- el.ItemName = txt_itemName.Text.Trim();
- DataTable dt = this.execute<DataTable>("com.hnshituo.pur.ck.service.CkOutBillService", "get_supp", new object[] { el });
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable1, true);
- foreach (UltraGridRow ugr in ultraGrid2.Rows)
- {
- if (!String.IsNullOrEmpty(ugr.Cells["printCode"].Value.ToString().Trim()))
- {
- ugr.CellAppearance.ForeColor = System.Drawing.Color.FromArgb(255, 128, 0);
- }
- else
- {
- ugr.CellAppearance.ForeColor = Color.Black;
- }
- }
- GridHelper.RefreshAndAutoSize(ultraGrid1);
- if (!String.IsNullOrEmpty(strOutBill))
- {
- publicPms.doActiveSelRow(ultraGrid1, "outStockno", strOutBill);
- }
- }
- catch (Exception ex)
- {
- MessageUtil.ShowTips("查询失败:"+ex);
- }
- }
- /// <summary>
- /// 加载dropdownlist
- /// </summary>
- private void getdropDownList()
- {
- //加载成本中心
- DataTable dt1 = ServerHelper.GetData("com.hnshituo.pur.configure.service.impl.CoreBaseInfoNew.centerQuery", new Object[] { "1230",UserInfo.GetDeptid() }, this.ob);
- if (dt1.Rows.Count > 0)
- {
- dt1.DefaultView.Sort = "BASENAME";
- dt1 = dt1.DefaultView.ToTable();
- }
- bool flag = false;
- if (UserInfo.GetUserID() == "admin")
- flag = true;
- if (UserInfo.GetDeptid().StartsWith("002001029") || UserInfo.GetDeptid().StartsWith("002001036"))
- flag = true;
- publicPms.FilComboboxAdd(txt_Dept, dt1, "baseCode", "baseName", "validflag NOT in ('0')", flag, "/", "");
- publicPms.FilComboboxAdd(txt_Dept1, dt1, "baseCode", "baseName", "validflag NOT in ('0')", false, "/", "");
- txt_Dept.SelectedIndex = 0;
- //加载领用单位
- CkOutBill el = new CkOutBill();
- if (txt_CreateTimeStart.Text != null)
- {
- el.CreateTime = Convert.ToDateTime(txt_CreateTimeStart.Value);
- }
- if (txt_CreateTimeEnd.Text != null)
- {
- el.UpdateTime = Convert.ToDateTime(txt_CreateTimeEnd.Value);
- }
- DataTable dt11 = this.execute<DataTable>("com.hnshituo.pur.ck.service.CkOutBillService", "get_depart", new object[] { el });
- if (dt11.Rows.Count > 0)
- {
- dt11.DefaultView.Sort = "useOrgName";
- dt11 = dt11.DefaultView.ToTable();
- }
- publicPms.FilComboboxAdd(txt_reqDepart, dt11, "useOrgId", "useOrgName", "", true, "/", "");
- //publicPms.FilComboboxAdd(txt_reqDepart1, dt11, "useOrgId", "useOrgName", "", false, "/", "");
-
- getMatClassData();
- //PhysicSeatEntity Phouse = new PhysicSeatEntity();
- //Phouse.Validflag = "1";
- //Phouse.DeleteUserid = "2";
- //DataTable dt3 = this.execute<DataTable>("com.hnshituo.pur.configure.service.ActualSeatService", "find", new object[] { Phouse,0,0});
- //publicPms.FilComboboxAdd(txt_InvPhysic, dt3, "INVPHYSIC", "INVPHYSICNAME", "", true, "/", "");
- }
- private void ultraGrid1_AfterCellActivate(object sender, EventArgs e)
- {
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- UltraGridRow uge = ultraGrid1.ActiveRow;
- if (uge == null)
- return;
- CkOutBill yy = new CkOutBill();
- yy.ItemCode = uge.Cells["itemCode"].Value.ToString();
- DataTable dt1 = this.execute<DataTable>("com.hnshituo.pur.ck.service.CkOutbillPositionService", " get_supp1", new object[] { uge.Cells["OutStockNo"].Value.ToString() });
- GridHelper.CopyDataToDatatable(ref dt1, ref dataTable2, true);
- GridHelper.RefreshAndAutoSize(ultraGrid2);
- }
- /// <summary>
- /// 导出Excel
- /// </summary>
- private void UltraGridToExcel()
- {
- try
- {
- //获取导出的采购计划行表
- ArrayList alUltraGrid = new ArrayList();
- alUltraGrid.Add(ultraGrid1);
- ArrayList alSheeft = new ArrayList();
- alSheeft.Add("出库单");
- if (ultraGrid1.Rows.Count > 0)
- {
- GridHelper.ulGridToExcel(alUltraGrid, alSheeft, "出库单");//导出excel
- }
- MessageUtil.ShowTips("导出成功");
- }
- catch (Exception e)
- {
- MessageUtil.ShowTips("导出失败" + e.Message);
- }
- }
- private void txt_Dept_SelectionChanged(object sender, EventArgs e)
- {
- getMatClassData();
- txt_Dept1.Value = txt_Dept.Value;
- }
- /// <summary>
- /// 获取物料中类
- /// </summary>
- private void getMatClassData()
- {
- //加载物料中类
- PurmatclassEntity mat = new PurmatclassEntity();
- mat.DeleteName = "1";
- mat.DeleteUserid = "2";
- if (is_JIT.Checked)
- {
- String strDept = txt_Dept.Value == null ? "" : txt_Dept.Value.ToString();
- mat.UpdateName = strDept;
- }
- if (is_JIT1.Checked)
- {
- String strReqDept = txt_reqDepart.Value == null ? "" : txt_reqDepart.Value.ToString();
- mat.UpdateUserid = strReqDept;
- }
- DataTable dt2 = this.execute<DataTable>("com.hnshituo.pur.configure.service.MatClassService", "getMatClass", new object[] { mat });
- publicPms.FilComboboxAdd(txt_ItemClass, dt2, "baseCode", "baseName", "validflag NOT in ('0')", true, "/", "");
-
- }
- private void is_JIT_CheckedChanged(object sender, EventArgs e)
- {
- if (ck_adjust.Checked)
- {
- txt_Dept1.Enabled = is_JIT.Checked;
- }
- }
- private void is_JIT1_CheckedChanged(object sender, EventArgs e)
- {
- if (ck_adjust.Checked)
- {
- txt_reqDepart1.Enabled = is_JIT1.Checked;
- }
- }
- private void is_single_CheckedChanged(object sender, EventArgs e)
- {
- //is_JIT.Enabled = !is_single.Checked;
- //is_JIT1.Enabled = !is_single.Checked;
- foreach (UltraGridRow row in ultraGrid1.Rows)
- {
- row.Cells["CHK"].Value = false;
- }
- if (is_single.Checked)
- {
- ultraGrid1.DisplayLayout.Bands[0].Columns["CHK"].Hidden = true;
- }
- else
- {
- ultraGrid1.DisplayLayout.Bands[0].Columns["CHK"].Hidden = false;
- }
- }
- private void txt_reqDepart_SelectionChanged(object sender, EventArgs e)
- {
- txt_reqDepart1.Clear();
- txt_reqDepartCode.Text = "";
- txt_reqDepart1.Text = txt_reqDepart.Text;
- txt_reqDepartCode.Text = txt_reqDepart.Value.ToString();
- }
- private void ck_adjust_CheckedChanged(object sender, EventArgs e)
- {
- txt_Dept1.Enabled = ck_adjust.Checked;
- txt_reqDepart1.Enabled = ck_adjust.Checked;
- }
- private void txt_reqDepart1_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- frmdepartment frm = new frmdepartment(this.ob);
- //frm.StartPosition = FormStartPosition.Manual;
- //frm.Location = publicPms.getShowLocation(frm);
- frm.ShowDialog();
- String strdeptId = frm.BuyerUnitCode;
- String strDeptName = frm.Fulltext;
- if (!String.IsNullOrEmpty(strdeptId) && !String.IsNullOrEmpty(strDeptName))
- {
- txt_reqDepart1.Text = strDeptName;
- txt_reqDepartCode.Text = strdeptId;
- }
- }
- private void ultraGrid1_CellChange(object sender, CellEventArgs e)
- {
- object o = e.Cell.Value;
- ultraGrid1.UpdateData();
- if (e.Cell.Column.Key == "surplusQty")
- {
- double surplusQty = 0;
- double.TryParse(e.Cell.Row.Cells["surplusQty"].Value.ToString(), out surplusQty);
- double releaseQtyWeight = 0;
- double.TryParse(e.Cell.Row.Cells["releaseQtyWeight"].Value.ToString(), out releaseQtyWeight);
- double printQty = 0;
- double.TryParse(e.Cell.Row.Cells["printQty"].Value.ToString(), out printQty);
- if (surplusQty > (releaseQtyWeight-printQty))
- {
- MessageUtil.ShowTips("打印量不足");
- e.Cell.Value = o;
- return;
- }
- }
- }
-
- }
- }
|