public void GetApplicationDetail() { ApplicationDetailTable = applicationDetail.SelectAppDetailByCtrlID(applicationInfo.CtrlID); dgvApplyDetails.AutoGenerateColumns = false; dgvApplyDetails.DataSource = ApplicationDetailTable; dgvDevilerDetails.AutoGenerateColumns = false; dgvReceiptDetails.AutoGenerateColumns = false; DeliverDetailTable = applicationDetail.SelectDeliverDetailByCtrlID(applicationInfo.CtrlID); dgvDevilerDetails.DataSource = DeliverDetailTable; ReceiptDetailTable = applicationDetail.SelectReceiptDetailByCtrlID(applicationInfo.CtrlID); dgvReceiptDetails.DataSource = ReceiptDetailTable; txtApplyUser.Text = applicationInfo.ApplicantsName; txtPosition.Text = applicationInfo.ApplicantsPos; txtDate.Text = applicationInfo.ApplicantsDate; txtSendShopName.Text = applicationInfo.DeliverStore; txtAcceptShopName.Text = applicationInfo.ReceiptStore; txtApproval.Text = applicationInfo.ApprovalName; txtApprovalTime.Text = applicationInfo.ApprovalDate; txtApproval2.Text = applicationInfo.ApprovalName2; txtApprovalTime2.Text = applicationInfo.ApprovalDate2; txtBeforeChecked.Text = applicationInfo.DeliverCheck; txtBeforeUser.Text = applicationInfo.DeliverCheckerName; txtAfterChecked.Text = applicationInfo.ReceiptCheck; txtAfterUser.Text = applicationInfo.ReceiptCheckerName; txtDeliverDate.Text = applicationInfo.DeliverDate; txtReceiptDate.Text = applicationInfo.DeliverDate; txtS_O.SelectedItem = applicationInfo.S_O; txtO_O.SelectedItem = applicationInfo.O_O; txtS_O_Str.Text = applicationInfo.S_O_Str; txtO_O_Str.Text = applicationInfo.O_O_Str; }
void GetDataTable() { if (DeliverOrReceipt == "Deliver") { AddApplicationDT = applicationDetail.SelectDeliverDetailByCtrlID(applicationInfo.CtrlID); } else { AddApplicationDT = applicationDetail.SelectReceiptDetailByCtrlID(applicationInfo.CtrlID); } dgvApplyProducts.AutoGenerateColumns = false; dgvApplyProducts.DataSource = AddApplicationDT; }
public void GetApplicationDetail() { dgvDevilerDetails.AutoGenerateColumns = false; dgvReceiptDetails.AutoGenerateColumns = false; DeliverDetailTable = applicationDetail.SelectDeliverDetailByCtrlID(_ctrlID); ReceiptDetailTable = applicationDetail.SelectReceiptDetailByCtrlID(_ctrlID); DiffDeliverDT = DeliverDetailTable.Clone(); DiffReceiptDT = ReceiptDetailTable.Clone(); dgvDevilerDetails.DataSource = DiffDeliverDT; dgvReceiptDetails.DataSource = DiffReceiptDT; string[] strIDs = new string[50]; int i = 0; foreach (DataRow deldr in DeliverDetailTable.Rows) { bool isDiff = false; if (ReceiptDetailTable.Rows.Count != 0) { foreach (DataRow recdr in ReceiptDetailTable.Rows) { if (deldr["ItemID2"].ToString() == recdr["ItemID2"].ToString() && deldr["ItemID"].ToString() == recdr["ItemID"].ToString() && deldr["App_Count"].ToString() == recdr["App_Count"].ToString() && deldr["ItemHighlight"].ToString() == recdr["ItemHighlight"].ToString()) { if (Array.IndexOf <string>(strIDs, recdr["ID"].ToString()) == -1) { i++; strIDs[i] = recdr["ID"].ToString(); isDiff = false; goto done; } else { isDiff = true; } } else { isDiff = true; } } done: if (isDiff) { DiffDeliverDT.Rows.Add(deldr.ItemArray); } } else { isDiff = true; DiffDeliverDT.Rows.Add(deldr.ItemArray); } } strIDs = new string[50]; i = 0; foreach (DataRow recdr in ReceiptDetailTable.Rows) { bool isDiff = false; if (DeliverDetailTable.Rows.Count != 0) { foreach (DataRow deldr in DeliverDetailTable.Rows) { if (deldr["ItemID2"].ToString() == recdr["ItemID2"].ToString() && deldr["ItemID"].ToString() == recdr["ItemID"].ToString() && deldr["App_Count"].ToString() == recdr["App_Count"].ToString() && deldr["ItemHighlight"].ToString() == recdr["ItemHighlight"].ToString()) { if (Array.IndexOf <string>(strIDs, deldr["ID"].ToString()) == -1) { i++; strIDs[i] = deldr["ID"].ToString(); isDiff = false; goto done2; } else { isDiff = true; } } else { isDiff = true; } } done2: if (isDiff) { DiffReceiptDT.Rows.Add(recdr.ItemArray); } } else { isDiff = true; DiffReceiptDT.Rows.Add(recdr.ItemArray); } } }
public Boolean boolCampareOrder(string _ctrlID) { Boolean boolResult = false; DataTable DeliverDetailTable; DataTable ReceiptDetailTable; DataTable AppDetailTable; ApplicationInfo applicationInfo = new ApplicationInfo(); ApplicationDetail applicationDetail = new ApplicationDetail(); //dgvDevilerDetails.AutoGenerateColumns = false; //dgvReceiptDetails.AutoGenerateColumns = false; DeliverDetailTable = applicationDetail.SelectDeliverDetailByCtrlID(_ctrlID); ReceiptDetailTable = applicationDetail.SelectReceiptDetailByCtrlID(_ctrlID); AppDetailTable = applicationDetail.SelectAppDetailByCtrlID(_ctrlID); foreach (DataRow deldr in DeliverDetailTable.Rows) { foreach (DataRow recdr in ReceiptDetailTable.Rows) { if (DeliverDetailTable.Rows.Count == ReceiptDetailTable.Rows.Count && deldr["ItemID2"].ToString() == recdr["ItemID2"].ToString() && deldr["ItemID"].ToString() == recdr["ItemID"].ToString() && deldr["App_Count"].ToString() == recdr["App_Count"].ToString() && deldr["ItemHighlight"].ToString() == recdr["ItemHighlight"].ToString()) { boolResult = false; goto done; } else { boolResult = true; } } done: if (boolResult) { goto Finish; } } foreach (DataRow recdr in ReceiptDetailTable.Rows) { foreach (DataRow deldr in DeliverDetailTable.Rows) { if (DeliverDetailTable.Rows.Count == ReceiptDetailTable.Rows.Count && deldr["ItemID2"].ToString() == recdr["ItemID2"].ToString() && deldr["ItemID"].ToString() == recdr["ItemID"].ToString() && deldr["App_Count"].ToString() == recdr["App_Count"].ToString() && deldr["ItemHighlight"].ToString() == recdr["ItemHighlight"].ToString()) { boolResult = false; goto done2; } else { boolResult = true; } } done2: if (boolResult) { goto Finish; } } foreach (DataRow deldr in DeliverDetailTable.Rows) { foreach (DataRow recdr in AppDetailTable.Rows) { if (DeliverDetailTable.Rows.Count == AppDetailTable.Rows.Count && deldr["ItemID2"].ToString() == recdr["ItemID2"].ToString() && deldr["ItemID"].ToString() == recdr["ItemID"].ToString() && deldr["App_Count"].ToString() == recdr["App_Count"].ToString() && deldr["ItemHighlight"].ToString() == recdr["ItemHighlight"].ToString()) { boolResult = false; goto done3; } else { boolResult = true; } } done3: if (boolResult) { goto Finish; } } foreach (DataRow recdr in AppDetailTable.Rows) { foreach (DataRow deldr in DeliverDetailTable.Rows) { if (DeliverDetailTable.Rows.Count == AppDetailTable.Rows.Count && deldr["ItemID2"].ToString() == recdr["ItemID2"].ToString() && deldr["ItemID"].ToString() == recdr["ItemID"].ToString() && deldr["App_Count"].ToString() == recdr["App_Count"].ToString() && deldr["ItemHighlight"].ToString() == recdr["ItemHighlight"].ToString()) { boolResult = false; goto done4; } else { boolResult = true; } } done4: if (boolResult) { goto Finish; } } Finish: return(boolResult); }