public Fm_Orderinfo(EFModle.Model.TaskList task) { this.task = task; 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_packnum.Text = "总包数:" + task.ORDERPACKAGEQTY.ToString(); label_customername.Text = "客户名称:" + task.CUSTOMERNAME; label_allpacksortnum.Text = "总条数:" + task.ALLQTY; label_packageseq.Text = "当前订单第:1包"; //加载整个订单数据 data1 = FmOrderInofFun.QueryBySortnum(task.SORTNUM); MaxAllpackageseq = (int)data1.Max(x => x.ALLPACKAGESEQ).Value; MinAllpackageseq = (int)data1.Min(x => x.ALLPACKAGESEQ).Value; label_allpackageseq.Text = "当前包装机共:" + br.Length + "包"; label_nowpackageseq.Text = "当前包装机第:" + MinAllpackageseq + "包"; decimal PACKAGENUM = (decimal)data1.Where(x => x.ALLPACKAGESEQ == MinAllpackageseq).Select(x => x.PACKTASKNUM).FirstOrDefault(); label_packagetasknum.Text = "包装机任务号:" + PACKAGENUM.ToString(); }
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() + "条烟"; }