public Fm_Orderinfo_All(decimal package) { this.task = GetAllOrderinfo.task(package); InitializeComponent(); br = new BillResolution(cigrShow1.Size); ORDERPACKAGEQTY = task.ORDERPACKAGEQTY; label_sortnum.Text = "任务号:" + task.SORTNUM; label_regioncode.Text = "车组号:" + task.REGIONCODE; label_sortseq.Text = "户序:" + task.SORTSEQ.ToString(); label_customcode.Text = "专卖证号:" + task.CUSTOMERCODE; label_SumCignum.Text = "订单总条数:" + task.ORDERPACKAGEQTY.ToString(); label_customername.Text = "客户名称:" + task.CUSTOMERNAME; label_allpacksortnum.Text = "总条数:" + task.ALLQTY; label_packageseq.Text = "当前订单第:" + task.PACKAGENUM + "包"; //加载整个订单数据 data1 = FmOrderInofFun.QueryBySortnum(task.SORTNUM); MaxAllpackageseq = (int)GetAllOrderinfo.GetMaxAllpackageseq(); MinAllpackageseq = (int)GetAllOrderinfo.GetMinAllpackageseq(); label_allpackageseq.Text = "当前包装机共:" + br.Length + "包"; label_nowpackageseq.Text = "当前包装机第:" + task.ALLPACKAGENUM + "包"; pkIndex = Convert.ToInt32(task.ALLPACKAGENUM); decimal packtasknum = (decimal)data1.Where(x => x.ALLPACKAGESEQ == task.ALLPACKAGENUM).Select(x => x.PACKTASKNUM).FirstOrDefault(); label_packtasknum.Text = "包装机任务号:" + packtasknum.ToString(); }
/// <summary> /// 获取数据绑定 数据控件datagridview /// </summary> public void GetValues(bool tag = false) { if (tag) { return; } SORTSEQ = pkIndex; FmOrderInofFun.QueryBySortnum(task.SORTNUM); //获最大包数 最小包数 if (SORTSEQ <= MaxAllpackageseq && SORTSEQ >= MinAllpackageseq) { switch (DataType) { case 1: Dgv_datainfo.DataSource = GetAllOrderinfo.QueryBypacknum(SORTSEQ).OrderBy(x => x.CIGNUM).Select(x => new { x.CIGARETTENAME, x.CIGARETTECODE, CIGTYPE = x.CIGTYPE == "1" ? "常规烟" : "异型烟", x.NORMALQTY, x.PACKAGESEQ }).ToList(); break; case 2: Dgv_datainfo.DataSource = GetAllOrderinfo.QueryBypacknum(SORTSEQ).Where(x => x.CIGTYPE == "1").OrderBy(x => x.CIGNUM).Select(x => new { x.CIGARETTENAME, x.CIGARETTECODE, CIGTYPE = x.CIGTYPE == "1" ? "常规烟" : "异型烟", x.NORMALQTY, x.PACKAGESEQ }).ToList(); break; case 3: Dgv_datainfo.DataSource = GetAllOrderinfo.QueryBypacknum(SORTSEQ).Where(x => x.CIGTYPE == "2").OrderBy(x => x.CIGNUM).Select(x => new { x.CIGARETTENAME, x.CIGARETTECODE, CIGTYPE = x.CIGTYPE == "1" ? "常规烟" : "异型烟", x.NORMALQTY, x.PACKAGESEQ }).ToList(); break; case 4: Dgv_datainfo.DataSource = GetAllOrderinfo.QueryBypacknum(SORTSEQ).Select(x => new { x.CIGARETTENAME, x.CIGARETTECODE, CIGTYPE = x.CIGTYPE == "1" ? "常规烟" : "异型烟", x.NORMALQTY, x.PACKAGESEQ }).ToList(); break; default: break; } this.Dgv_datainfo.AutoGenerateColumns = true; Dgv_datainfo.Columns[0].HeaderText = "卷烟名称"; Dgv_datainfo.Columns[0].Width = 150; Dgv_datainfo.Columns[1].HeaderText = "卷烟编码"; Dgv_datainfo.Columns[1].Width = 90; Dgv_datainfo.Columns[2].HeaderText = "条烟类型"; Dgv_datainfo.Columns[2].Width = 90; Dgv_datainfo.Columns[3].HeaderText = "烟条数"; Dgv_datainfo.Columns[3].Width = 80; Dgv_datainfo.Columns[4].HeaderText = "包序号"; Dgv_datainfo.Columns[4].Width = 80; } label_allcig.Text = "共" + GetAllOrderinfo.QueryBypacknum(SORTSEQ).Where(x => x.ALLPACKAGESEQ == pkIndex).Select(x => x.PACKAGEQTY).FirstOrDefault() + "条烟"; }
/// <summary> /// 界面label控件数据刷新 /// </summary> void labelChange() { string[] tasks = GetAllOrderinfo.GetLabelData(SORTSEQ, GlobalPara.PackageNo); label_nowpackageseq.Text = "当前包装机第:" + tasks[0] + "包"; label_packageseq.Text = "当前订单第:" + tasks[1] + "包"; label_normul.Text = "常规烟:" + tasks[2]; label_unnormul.Text = "异型烟:" + tasks[3]; label_sortnum.Text = "任务号:" + tasks[4]; label_regioncode.Text = "车组号:" + tasks[5];; label_sortseq.Text = "户序:" + tasks[6]; label_customcode.Text = "专卖证号:" + tasks[8]; label_SumCignum.Text = "订单总条数:" + tasks[7]; label_customername.Text = "客户名称:" + tasks[9]; label_allpacksortnum.Text = "总条数:" + tasks[10]; label_packtasknum.Text = "包装机任务号:" + tasks[11]; lbl_orderpackagenum.Text = "共:" + tasks[12] + "包"; }