private void btnSearch_Click(object sender, EventArgs e) { orderdate = dateTimeInput1.Value.ToString("yyyy-MM-dd"); if (!string.IsNullOrEmpty(cobbatch.SelectedText)) { taskno = cobbatch.SelectedText; } else { taskno = null; } if (!string.IsNullOrEmpty(cobSortingLine.SelectedValue as string)) { picklinecode = cobSortingLine.SelectedValue as string; } else { picklinecode = null; } if (!string.IsNullOrEmpty(txtCustomer.Text.Trim())) { customername = txtCustomer.Text.Trim(); } else { customername = null; } dgvCigBox.DataSource = new SortableBindingList <CigBoxInfo>(CigBoxInfoList.GetCigBoxList(orderdate, taskno, picklinecode, customername)); footSumLabel1.Sumdata(); }
public void LoadCigBox() { if (chkisall.Checked) { CigBoxInfoList cigBoxInfoList = CigBoxInfoList.GetNonCigBoxList(new QueryCondition("0", true, SortingLine.GetAbNonSortingLineCode(), "")); dgviewnone.DataSource = cigBoxInfoList; dgviewfin.DataSource = CigBoxInfoList.GetFinCigBoxList(new QueryCondition("2", true, SortingLine.GetAbNonSortingLineCode(), "")); } else { dgviewnone.DataSource = CigBoxInfoList.GetNonCigBoxList(new QueryCondition("0", false, SortingLine.GetAbNonSortingLineCode(), "")); dgviewfin.DataSource = CigBoxInfoList.GetFinCigBoxList(new QueryCondition("2", false, SortingLine.GetAbNonSortingLineCode(), "")); } }
private void SetSortingStatus(int status) { string indexcolname = ""; string custcolname = ""; foreach (DataGridViewColumn column in dataGridViewXs[superTabControl1.SelectedTab.Name].Columns) { if (column.DataPropertyName.ToUpper() == "INDEXNO") { indexcolname = column.Name; } if (column.DataPropertyName.ToUpper() == "CUSTCODE") { custcolname = column.Name; } } foreach (DataGridViewRow selectedRow in dataGridViewXs[superTabControl1.SelectedTab.Name].SelectedRows) { //改变任务状态 string indexcolvalue = selectedRow.Cells[indexcolname].Value.ToString(); string custvalue = selectedRow.Cells[custcolname].Value.ToString(); AbnSortingLineTask sortingLineTask = AbnSortingLineTask.GetAbnSortingLineByIndex(indexcolvalue); sortingLineTask.Status = status; sortingLineTask.SaveAbnSortingTaskProcess(status); //改变烟包状态 List <CigBoxInfo> cigBoxInfoList = CigBoxInfoList.GetBoxInfoByCustiomNo(custvalue, indexcolvalue, SortingLine.GetAbNonSortingLineCode()); foreach (CigBoxInfo cigBoxInfo in cigBoxInfoList) { if (status != 2) { CigBoxInfo.SaveProcess(cigBoxInfo.ID, 0); } else { CigBoxInfo.SaveProcess(cigBoxInfo.ID, status); } } } }
private void btnFinish_Click(object sender, EventArgs e) { foreach (AbnSortingLineTask abnsortingLineTask in m_nonSortingLineTaskList) { if (abnsortingLineTask.ID == labSortingtaskno.Tag.ToString()) { abnsortingLineTask.SaveAbnSortingTaskProcess(2); //成功后保存发送的烟包信息 List <CigBoxInfo> cigBoxInfoList = CigBoxInfoList.GetBoxInfoByCustiomNo(abnsortingLineTask.CUSTCODE, abnsortingLineTask.INDEXNO.ToString(), SortingLine.GetAbNonSortingLineCode()); foreach (CigBoxInfo cigBoxInfo in cigBoxInfoList) { CigBoxInfo.SaveProcess(cigBoxInfo.ID, 2); } } } LoadOrder(); FJMainForm.Instance.CAbnBox.LoadCigBox(); }
private LPTPrintSetup printset = new LPTPrintSetup(); //打印类 private void PirintSet(object type) { try { string indexcolname = ""; string custcolname = ""; foreach (DataGridViewColumn column in dgviewnone.Columns) { if (column.DataPropertyName.ToUpper() == "INDEXNO") { indexcolname = column.Name; } if (column.DataPropertyName.ToUpper() == "CUSTCODE") { custcolname = column.Name; } } IEnumerable <DataGridViewRow> rows = dgviewnone.SelectedRows.Cast <DataGridViewRow>(); DataGridViewRow[] Rows = rows.ToArray(); Array.Reverse(Rows); //对颠倒的行再次颠倒 foreach (DataGridViewRow selectedRow in Rows) { string indexcolvalue = selectedRow.Cells[indexcolname].Value.ToString(); string custvalue = selectedRow.Cells[custcolname].Value.ToString(); SortingLineTask sortingLineTask = SortingLineTask.GetSortingLineByIndex(indexcolvalue); //获取常规烟包 List <CigBoxInfo> cigBoxInfoList = CigBoxInfoList.GetBoxInfoByCustiomNo(sortingLineTask.CUSTCODE, sortingLineTask.INDEXNO.ToString(), AppUtil._SortingLineId); //获取异型烟包 int abnoboxcount = CigBoxInfoList.GetAbnoCigBoxNum(sortingLineTask.ORDERDATE, sortingLineTask.SORTINGTASKNO.ToString(), AppUtil._AbnoSortingLineId, sortingLineTask.CUSTCODE); OutPort outPort = new OutPort(Convert.ToInt32(indexcolvalue)); outPort.GetCustSeq(); foreach (CigBoxInfo cigBoxInfo in cigBoxInfoList) { BusinessLogic.Print.PrintInfo PSInfo = new BusinessLogic.Print.PrintInfo(); PSInfo.CustomerName = sortingLineTask.ShortName; PSInfo.CustomerCode = sortingLineTask.CUSTCODE; PSInfo.IndexNo = sortingLineTask.INDEXNO.ToString(); PSInfo.SortingDate = "(" + sortingLineTask.ORDERDATE + ")"; PSInfo.BoxNo = cigBoxInfo.BOXSEQ.ToString() + "/"; PSInfo.BoxCount = cigBoxInfo.BOXCOUNT.ToString(); PSInfo.CurrentNum = cigBoxInfo.BOXQTY.ToString() + "/" + sortingLineTask.SortingLineTaskDetails.GetTotQty().ToString(); //PSInfo.TaskNumber = sortingLineTask.SortingLineTaskDetails.GetTotQty().ToString(); PSInfo.DelivyLine = sortingLineTask.LINENAME; PSInfo.CustomerSqe = "(" + outPort["COUNTLINE"] + "/" + outPort["MAXCOUNTLINE"] + ")户"; //PSInfo.CustomerTotSeq = outPort["MAXCOUNTLINE"]; PSInfo.AbnoBoxCount = "异" + abnoboxcount; PSInfo.Address = cigBoxInfo.Address; PSInfo.BoxIndex = CigBoxInfoList.GetBoxIndex(PSInfo.IndexNo, cigBoxInfo.BOXSEQ.ToString(), AppUtil._SortingLineId); printset.SetupThePrinting(MyPrintDocument, new SYSPrintsettings(), PSInfo); if (Convert.ToInt32(type) == 1) { printPreviewDialog1.PrintPreviewControl.Zoom = 1.0; this.printPreviewDialog1.ShowDialog(); } else { MyPrintDocument.Print(); } } } } catch (Exception) { throw; } }