private void saveBunifuButton_Click(object sender, EventArgs e) { string actionTaken = ""; int lastEDIRecordAdded; DataRow dataRows; string gateAction; // recordID = inGateUniqueIDList(0) if (My.MyProject.Forms.FrmInOutGate.isNewRecord) { actionTaken = "Create"; } else { actionTaken = "Update"; } gateAction = "OUT-GATE"; // Save Outgate info MdlContainerManagement.saveOutGate(recordID, this); // Save Log EmployeeActivityLogService.Insert(My.MyProject.Forms.FrmLoginWindow._userID, recordID.ToString(), actionTaken, gateAction, ""); string ssLineCode; ssLineCode = Strings.Trim(shippingLineBunifuDropdown.SelectedItem.ToString().Split('(')[0]); if (sendEDIBunifuToggleSwitch.Value == true) { EmployeeActivityLogService.Insert(My.MyProject.Forms.FrmLoginWindow._userID, recordID.ToString(), actionTaken, gateAction, "Requested EDI to be sent"); db.AddEDILog(recordID, "OUT-GATE", gateAction); lastEDIRecordAdded = db.getLadstEDIadded(); if (My.MyProject.Forms.FrmChangeEDI.changeEDIRadioButton.Checked) { DateTime modDateTime; DateTime modDateTimeSTR; modDateTimeSTR = Conversions.ToDate(My.MyProject.Forms.FrmChangeEDI.EDIDateTimePicker.Value.ToShortDateString() + " " + My.MyProject.Forms.FrmChangeEDI.EdiTimePicker.Value.ToShortTimeString()); modDateTime = Convert.ToDateTime(modDateTimeSTR); db.saveEDIModifiedRecord(lastEDIRecordAdded, modDateTime); // db.UpdatePreSendStatus(recordID, True) db.pushEDIRequest(recordID, false, true, lastEDIRecordAdded, modDateTime); } else { DateTime gateDateTime; DateTime gateDateTimeTR; gateDateTimeTR = Conversions.ToDate(dateDateTimePicker.Value.ToShortDateString() + " " + timeDateTimePicker.Value.ToShortTimeString()); gateDateTime = Convert.ToDateTime(gateDateTimeTR); // db.UpdatePreSendStatus(recordID, True) db.pushEDIRequest(recordID, false, true, lastEDIRecordAdded, gateDateTime); } } cleanFields(); for (int i = 0, loopTo = My.MyProject.Forms.FrmInOutGate.OutGateDataGridView.Rows.Count - 1; i <= loopTo; i++) { My.MyProject.Forms.FrmInOutGate.OutGateDataGridView.Rows[i].Cells[1].Value = false; } My.MyProject.Forms.FrmInOutGate.isRefresh = true; My.MyProject.Forms.FrmInOutGate.tabinoutGate.SelectedIndex = 1; My.MyProject.Forms.FrmInOutGate.getInOutContainers(); My.MyProject.Forms.FrmInOutGate.checkButtons(); Close(); }
private void changeEDIButton_Click(object sender, EventArgs e) { int recordID; DataGridViewRow row; DateTime gateDateTime; int lastEDIRecordAdded; { var withBlock = My.MyProject.Forms.FrmEDIManagement; if (ediMode.Equals("RESEND")) { MdlLoadingSetting.waitForm.Show(); // selectedIDs = .getSelectedContIDs(.InGateDataGridView) foreach (DataGridViewRow currentRow in My.MyProject.Forms.FrmEDIManagement.InGateDataGridView.Rows) { row = currentRow; if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(row.Cells[1].Value, true, false))) { recordID = Conversions.ToInteger(row.Cells[0].Value); gateDateTime = Convert.ToDateTime(row.Cells[9].Value); EmployeeActivityLogService.Insert(My.MyProject.Forms.FrmLoginWindow._userID, recordID.ToString(), "CREATE", "IN-GATE", "Requested EDI to be RESENT"); db.AddEDILog(recordID, "IN-GATE", "IN GATE - Resend EDI"); lastEDIRecordAdded = db.getLadstEDIadded(); DateTime EDIDateTime; if (systemEDIRadioButton.Checked) { db.saveEDIModifiedRecord(lastEDIRecordAdded, gateDateTime); db.pushEDIRequest(recordID, true, false, lastEDIRecordAdded, gateDateTime); } else { string EDIdateTimeSrt; EDIdateTimeSrt = EDIDateTimePicker.Value.ToShortDateString() + " " + EdiTimePicker.Value.ToShortTimeString(); EDIDateTime = Convert.ToDateTime(EDIdateTimeSrt); db.pushEDIRequest(recordID, true, false, lastEDIRecordAdded, EDIDateTime); } } } withBlock.getEDIs(withBlock.InGateDataGridView); MdlLoadingSetting.waitForm.Close(); } else if (ediMode.Equals("PRE-SEND")) { MdlLoadingSetting.waitForm.Show(); foreach (DataGridViewRow currentRow1 in My.MyProject.Forms.FrmEDIManagement.OutGateDataGridView.Rows) { row = currentRow1; if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(row.Cells[1].Value, true, false))) { recordID = Conversions.ToInteger(row.Cells[0].Value); gateDateTime = DateAndTime.Now; EmployeeActivityLogService.Insert(My.MyProject.Forms.FrmLoginWindow._userID, recordID.ToString(), "CREATE", "OUT-GATE", "Requested EDI to be PRE-SENT"); db.AddEDILog(recordID, "OUT-GATE", "OUT GATE - Pre-Send EDI"); lastEDIRecordAdded = db.getLadstEDIadded(); DateTime EDIDateTime; if (systemEDIRadioButton.Checked) { // EDIHelper.EDIContainers(selContainer.Value, ediMode, False, selContainer.Key) db.saveEDIModifiedRecord(lastEDIRecordAdded, gateDateTime); db.UpdatePreSendStatus(recordID, true); db.pushEDIRequest(recordID, false, true, lastEDIRecordAdded, gateDateTime); } else { string EDIdateTimeSrt; EDIdateTimeSrt = EDIDateTimePicker.Value.ToShortDateString() + " " + EdiTimePicker.Value.ToShortTimeString(); EDIDateTime = Convert.ToDateTime(EDIdateTimeSrt); db.UpdatePreSendStatus(recordID, true); db.pushEDIRequest(recordID, false, true, lastEDIRecordAdded, Conversions.ToDate(EDIdateTimeSrt)); } } } withBlock.getEDIs(withBlock.OutGateDataGridView); MdlLoadingSetting.waitForm.Close(); } } Hide(); }
private void saveBunifuButton_Click(object sender, EventArgs e) { string actionTaken = ""; int lastEDIRecordAdded; DataRow dataRows; string gateAction; var recordID = default(int); if (My.MyProject.Forms.FrmInOutGate.isNewRecord) { MdlContainerManagement.saveInGate(0, this); recordID = MdlContainerManagement.lastrecordID; actionTaken = "CREATE"; gateAction = "IN-GATE"; } else { for (int i = 0, loopTo = My.MyProject.Forms.FrmInOutGate.InGateDataGridView.Rows.Count - 1; i <= loopTo; i++) { if (Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(My.MyProject.Forms.FrmInOutGate.InGateDataGridView.Rows[i].Cells[1].Value, true, false))) { recordID = Conversions.ToInteger(My.MyProject.Forms.FrmInOutGate.InGateDataGridView.Rows[i].Cells[0].Value); break; } } MdlContainerManagement.saveInGate(recordID, this); actionTaken = "UPDATE"; gateAction = "IN-GATE"; } EmployeeActivityLogService.Insert(My.MyProject.Forms.FrmLoginWindow._userID, recordID.ToString(), actionTaken, gateAction, ""); // ' To send EDI -- program only allow specific ss lines string ssLineCode; ssLineCode = Strings.Trim(shippingLineBunifuDropdown.SelectedItem.ToString().Split('(')[0]); if (sendEDIBunifuToggleSwitch.Value == true) { EmployeeActivityLogService.Insert(My.MyProject.Forms.FrmLoginWindow._userID, recordID.ToString(), actionTaken, gateAction, "Requested EDI to be sent"); db.AddEDILog(recordID, "IN-GATE", gateAction); lastEDIRecordAdded = db.getLadstEDIadded(); if (My.MyProject.Forms.FrmChangeEDI.changeEDIRadioButton.Checked) { DateTime modDateTime; DateTime modDateTimeSTR; modDateTimeSTR = Conversions.ToDate(My.MyProject.Forms.FrmChangeEDI.EDIDateTimePicker.Value.ToShortDateString() + " " + My.MyProject.Forms.FrmChangeEDI.EdiTimePicker.Value.ToShortTimeString()); modDateTime = Convert.ToDateTime(modDateTimeSTR); db.saveEDIModifiedRecord(lastEDIRecordAdded, modDateTime); db.pushEDIRequest(recordID, true, false, lastEDIRecordAdded, modDateTime); } else { DateTime gateDateTime; DateTime gateDateTimeTR; gateDateTimeTR = Conversions.ToDate(dateDateTimePicker.Value.ToShortDateString() + " " + timeDateTimePicker.Value.ToShortTimeString()); gateDateTime = Convert.ToDateTime(gateDateTimeTR); db.pushEDIRequest(recordID, true, false, lastEDIRecordAdded, gateDateTime); } } My.MyProject.Forms.FrmInOutGate.isRefresh = true; My.MyProject.Forms.FrmInOutGate.getInOutContainers(); cleanFields(); for (int i = 0, loopTo1 = My.MyProject.Forms.FrmInOutGate.InGateDataGridView.Rows.Count - 1; i <= loopTo1; i++) { My.MyProject.Forms.FrmInOutGate.InGateDataGridView.Rows[i].Cells[1].Value = false; } My.MyProject.Forms.FrmInOutGate.checkButtons(); Close(); }