private void cPRATEBindingNavigatorSaveItem_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure you want to save these changes?", "CONFIRM", MessageBoxButtons.YesNo) == DialogResult.Yes) { GridViewCopy.MoveFirst(); GridViewCopy.MoveLast(); CpRatesBindingSource.EndEdit(); context.SaveChanges(); panelControlStatus.Visible = true; LabelStatus.Text = "Record Saved"; rowStatusSave = new Timer(); rowStatusSave.Interval = 3000; rowStatusSave.Start(); rowStatusSave.Tick += TimedEventSave; } }
private void SaveButton_Click(object sender, EventArgs e) { bool overlapFlag = false; for (int val = 0; val < GridViewCopy.RowCount; val++) { ColumnView view = GridViewCopy as ColumnView; string best = GridViewCopy.GetRowCellDisplayText(val, "Over"); if (best == "Checked") { overlapFlag = true; } } // if (overlapFlag) { MessageBox.Show("There is a potential overlap. Please correct the values before attempting to save."); return; } if (MessageBox.Show("Are you sure you want to save these changes?", "CONFIRM", MessageBoxButtons.YesNo) == DialogResult.Yes) { GridViewCopy.MoveFirst(); GridViewCopy.MoveLast(); CpRatesBindingSource.EndEdit(); context.SaveChanges(); panelControlStatus.Visible = true; LabelStatus.Text = "Record Saved"; rowStatusSave = new Timer(); rowStatusSave.Interval = 3000; rowStatusSave.Start(); rowStatusSave.Tick += TimedEventSave; ImageComboBoxEditLoadCode.Text = string.Empty; ImageComboBoxEditCopyCode.Text = string.Empty; GridControlCopy.DataSource = null; MessageBox.Show("Operation completed succesfully."); ImageComboBoxEditLoadCode.Focus(); } }
private void simpleButton1_Click(object sender, EventArgs e) { //preview int j = GridViewCopy.DataRowCount + 1; for (int i = 0; i < j; i++) { GridViewCopy.MoveFirst(); GridViewCopy.DeleteRow(GridViewCopy.FocusedRowHandle); } foreach (int val in GridViewLoad.GetSelectedRows()) { GridViewCopy.AddNewRow(); GridViewCopy.SetFocusedRowCellValue("CODE", ImageComboBoxEditCopyCode.EditValue); GridViewCopy.SetFocusedRowCellValue("AGENCY", GridViewLoad.GetRowCellValue(val, "AGENCY")); GridViewCopy.SetFocusedRowCellValue("CAT", GridViewLoad.GetRowCellValue(val, "CAT")); GridViewCopy.SetFocusedRowCellValue("START_DATE", GridViewLoad.GetRowCellValue(val, "START_DATE")); GridViewCopy.SetFocusedRowCellValue("END_DATE", GridViewLoad.GetRowCellValue(val, "END_DATE")); GridViewCopy.SetFocusedRowCellValue("YEAR", GridViewLoad.GetRowCellValue(val, "YEAR")); GridViewCopy.SetFocusedRowCellValue("H_L", GridViewLoad.GetRowCellValue(val, "H_L")); GridViewCopy.SetFocusedRowCellValue("ID", GridViewLoad.GetRowCellValue(val, "ID")); GridViewCopy.SetFocusedRowCellValue("ResDate_Start", GridViewLoad.GetRowCellValue(val, "ResDate_Start")); GridViewCopy.SetFocusedRowCellValue("ResDate_End", GridViewLoad.GetRowCellValue(val, "ResDate_End")); GridViewCopy.SetFocusedRowCellValue("Inactive", GridViewLoad.GetRowCellValue(val, "Inactive")); GridViewCopy.SetFocusedRowCellValue("Time", GridViewLoad.GetRowCellValue(val, "Time")); GridViewCopy.SetFocusedRowCellValue("DESC", GridViewLoad.GetRowCellValue(val, "DESC")); GridViewCopy.SetFocusedRowCellValue("LAST_UPD", DateTime.Now); GridViewCopy.SetFocusedRowCellValue("UPD_INIT", username); GridViewCopy.SetFocusedRowCellValue("PP1", GridViewLoad.GetRowCellValue(val, "PP1")); GridViewCopy.SetFocusedRowCellValue("PP2", GridViewLoad.GetRowCellValue(val, "PP2")); GridViewCopy.SetFocusedRowCellValue("PP3", GridViewLoad.GetRowCellValue(val, "PP3")); GridViewCopy.SetFocusedRowCellValue("PP4", GridViewLoad.GetRowCellValue(val, "PP4")); GridViewCopy.SetFocusedRowCellValue("PP5", GridViewLoad.GetRowCellValue(val, "PP5")); GridViewCopy.SetFocusedRowCellValue("PP6", GridViewLoad.GetRowCellValue(val, "PP6")); GridViewCopy.SetFocusedRowCellValue("PP7", GridViewLoad.GetRowCellValue(val, "PP7")); GridViewCopy.SetFocusedRowCellValue("PP8", GridViewLoad.GetRowCellValue(val, "PP8")); GridViewCopy.SetFocusedRowCellValue("PP9", GridViewLoad.GetRowCellValue(val, "PP9")); GridViewCopy.SetFocusedRowCellValue("PP10", GridViewLoad.GetRowCellValue(val, "PP10")); GridViewCopy.SetFocusedRowCellValue("GPP1", GridViewLoad.GetRowCellValue(val, "GPP1")); GridViewCopy.SetFocusedRowCellValue("GPP2", GridViewLoad.GetRowCellValue(val, "GPP2")); GridViewCopy.SetFocusedRowCellValue("GPP3", GridViewLoad.GetRowCellValue(val, "GPP3")); GridViewCopy.SetFocusedRowCellValue("GPP4", GridViewLoad.GetRowCellValue(val, "GPP4")); GridViewCopy.SetFocusedRowCellValue("GPP5", GridViewLoad.GetRowCellValue(val, "GPP5")); GridViewCopy.SetFocusedRowCellValue("GPP6", GridViewLoad.GetRowCellValue(val, "GPP6")); GridViewCopy.SetFocusedRowCellValue("GPP7", GridViewLoad.GetRowCellValue(val, "GPP7")); GridViewCopy.SetFocusedRowCellValue("GPP8", GridViewLoad.GetRowCellValue(val, "GPP8")); GridViewCopy.SetFocusedRowCellValue("GPP9", GridViewLoad.GetRowCellValue(val, "GPP9")); GridViewCopy.SetFocusedRowCellValue("GPP10", GridViewLoad.GetRowCellValue(val, "GPP10")); GridViewCopy.SetFocusedRowCellValue("NPP1", GridViewLoad.GetRowCellValue(val, "NPP1")); GridViewCopy.SetFocusedRowCellValue("NPP2", GridViewLoad.GetRowCellValue(val, "NPP2")); GridViewCopy.SetFocusedRowCellValue("NPP3", GridViewLoad.GetRowCellValue(val, "NPP3")); GridViewCopy.SetFocusedRowCellValue("NPP4", GridViewLoad.GetRowCellValue(val, "NPP4")); GridViewCopy.SetFocusedRowCellValue("NPP5", GridViewLoad.GetRowCellValue(val, "NPP5")); GridViewCopy.SetFocusedRowCellValue("NPP6", GridViewLoad.GetRowCellValue(val, "NPP6")); GridViewCopy.SetFocusedRowCellValue("NPP7", GridViewLoad.GetRowCellValue(val, "NPP7")); GridViewCopy.SetFocusedRowCellValue("NPP8", GridViewLoad.GetRowCellValue(val, "NPP8")); GridViewCopy.SetFocusedRowCellValue("NPP9", GridViewLoad.GetRowCellValue(val, "NPP9")); GridViewCopy.SetFocusedRowCellValue("NPP10", GridViewLoad.GetRowCellValue(val, "NPP10")); GridViewCopy.SetFocusedRowCellValue("CHD_GRATE", GridViewLoad.GetRowCellValue(val, "CHD_GRATE")); GridViewCopy.SetFocusedRowCellValue("CHD_NRATE", GridViewLoad.GetRowCellValue(val, "CHD_NRATE")); GridViewCopy.SetFocusedRowCellValue("CHD_LIMIT", GridViewLoad.GetRowCellValue(val, "CHD_LIMIT")); GridViewCopy.SetFocusedRowCellValue("JR_LIMIT", GridViewLoad.GetRowCellValue(val, "JR_LIMIT")); GridViewCopy.SetFocusedRowCellValue("JR_GRATE", GridViewLoad.GetRowCellValue(val, "JR_GRATE")); GridViewCopy.SetFocusedRowCellValue("JR_NRATE", GridViewLoad.GetRowCellValue(val, "JR_NRATE")); GridViewCopy.SetFocusedRowCellValue("COMM_FLG", GridViewLoad.GetRowCellValue(val, "COMM_FLG")); GridViewCopy.SetFocusedRowCellValue("COMM_PCT", GridViewLoad.GetRowCellValue(val, "COMM_PCT")); GridViewCopy.SetFocusedRowCellValue("Transport_Type", GridViewLoad.GetRowCellValue(val, "Transport_Type")); GridViewCopy.SetFocusedRowCellValue("Vendor_Code", GridViewLoad.GetRowCellValue(val, "Vendor_Code")); GridViewCopy.SetFocusedRowCellValue("Unit_Rate", GridViewLoad.GetRowCellValue(val, "Unit_Rate")); GridViewCopy.SetFocusedRowCellValue("Inhouse", GridViewLoad.GetRowCellValue(val, "Inhouse")); GridViewCopy.SetFocusedRowCellValue("Vendor_Code_Jr", GridViewLoad.GetRowCellValue(val, "Vendor_Code_Jr")); GridViewCopy.SetFocusedRowCellValue("Vendor_Code_Chd", GridViewLoad.GetRowCellValue(val, "Vendor_Code_Chd")); GridViewCopy.SetFocusedRowCellValue("SpecialValue_Code", GridViewLoad.GetRowCellValue(val, "SpecialValue_Code")); GridViewCopy.SetFocusedRowCellValue("Currency_CodeSheet", GridViewLoad.GetRowCellValue(val, "Currency_CodeSheet")); GridViewCopy.SetFocusedRowCellValue("Currency_CodePayment", GridViewLoad.GetRowCellValue(val, "Currency_CodePayment")); GridViewCopy.SetFocusedRowCellValue("ExchangeRate", GridViewLoad.GetRowCellValue(val, "ExchangeRate")); GridViewCopy.SetFocusedRowCellValue("BusTourDays", GridViewLoad.GetRowCellValue(val, "BusTourDays")); GridViewCopy.SetFocusedRowCellValue("BusTourStops", GridViewLoad.GetRowCellValue(val, "BusTourStops")); GridViewCopy.SetFocusedRowCellValue("Comp_Type", GridViewLoad.GetRowCellValue(val, "Comp_Type")); GridViewCopy.SetFocusedRowCellValue("SeniorAgeLimit", GridViewLoad.GetRowCellValue(val, "SeniorAgeLimit")); GridViewCopy.SetFocusedRowCellValue("SeniorCost", GridViewLoad.GetRowCellValue(val, "SeniorCost")); GridViewCopy.SetFocusedRowCellValue("SeniorGross", GridViewLoad.GetRowCellValue(val, "SeniorGross")); GridViewCopy.SetFocusedRowCellValue("SeniorRetail", GridViewLoad.GetRowCellValue(val, "SeniorRetail")); GridViewCopy.SetFocusedRowCellValue("Retail1", GridViewLoad.GetRowCellValue(val, "Retail1")); GridViewCopy.SetFocusedRowCellValue("Retail2", GridViewLoad.GetRowCellValue(val, "Retail2")); GridViewCopy.SetFocusedRowCellValue("Retail3", GridViewLoad.GetRowCellValue(val, "Retail3")); GridViewCopy.SetFocusedRowCellValue("Retail4", GridViewLoad.GetRowCellValue(val, "Retail4")); GridViewCopy.SetFocusedRowCellValue("Retail5", GridViewLoad.GetRowCellValue(val, "Retail5")); GridViewCopy.SetFocusedRowCellValue("Retail6", GridViewLoad.GetRowCellValue(val, "Retail6")); GridViewCopy.SetFocusedRowCellValue("Retail7", GridViewLoad.GetRowCellValue(val, "Retail7")); GridViewCopy.SetFocusedRowCellValue("Retail8", GridViewLoad.GetRowCellValue(val, "Retail8")); GridViewCopy.SetFocusedRowCellValue("Retail9", GridViewLoad.GetRowCellValue(val, "Retail9")); GridViewCopy.SetFocusedRowCellValue("Retail10", GridViewLoad.GetRowCellValue(val, "Retail10")); GridViewCopy.SetFocusedRowCellValue("Retail10", GridViewLoad.GetRowCellValue(val, "Retail10")); GridViewCopy.SetFocusedRowCellValue("ChildRetail", GridViewLoad.GetRowCellValue(val, "ChildRetail")); GridViewCopy.SetFocusedRowCellValue("JuniorRetail", GridViewLoad.GetRowCellValue(val, "JuniorRetail")); } GridViewCopy.Focus(); GridViewLoad.Focus(); if (checkEdit1.Checked) { if (MessageBox.Show("Are you sure you want to delete the original records?", "CONFIRM", MessageBoxButtons.YesNo) == DialogResult.Yes) { GridViewLoad.DeleteSelectedRows(); context.SaveChanges(); } } }
private void simpleButton2_Click(object sender, EventArgs e) { GridViewCopy.MoveFirst(); GridViewCopy.Focus(); if (ImageComboBoxEditAgency.Properties.ReadOnly == false) { for (int i = 0; i < GridViewCopy.RowCount; i++) { GridViewCopy.SetRowCellValue(i, GridViewCopy.Columns["AGENCY"], ImageComboBoxEditAgency.EditValue); } } if (ImageComboBoxEditCategory.Properties.ReadOnly == false) { for (int i = 0; i < GridViewCopy.RowCount; i++) { GridViewCopy.SetRowCellValue(i, GridViewCopy.Columns["CAT"], ImageComboBoxEditCategory.EditValue); } } if (SpinEditStart.Enabled == true) { if (GridViewCopy.RowCount == 1) { if (!string.IsNullOrWhiteSpace(GridViewCopy.GetFocusedRowCellDisplayText("START_DATE"))) { DateTime time = (DateTime)GridViewCopy.GetFocusedRowCellValue("START_DATE"); int val = (int)SpinEditStart.Value; if (ComboBoxEditStartAdd.Text == "- Subtract") { val *= -1; } if (ComboBoxEditStartTerm.Text == "Days") { GridViewCopy.SetFocusedRowCellValue("START_DATE", time.AddDays(val)); } if (ComboBoxEditStartTerm.Text == "Months") { GridViewCopy.SetFocusedRowCellValue("START_DATE", time.AddMonths(val)); } if (ComboBoxEditStartTerm.Text == "Years") { GridViewCopy.SetFocusedRowCellValue("START_DATE", time.AddYears(val)); } } } else { for (int i = 0; i < GridViewCopy.RowCount; i++) { if (!string.IsNullOrWhiteSpace(GridViewCopy.GetFocusedRowCellDisplayText("START_DATE"))) { DateTime time = (DateTime)GridViewCopy.GetRowCellValue(i, "START_DATE"); int val = (int)SpinEditStart.Value; if (ComboBoxEditStartAdd.Text == "- Subtract") { val *= -1; } if (ComboBoxEditStartTerm.Text == "Days") { GridViewCopy.SetRowCellValue(i, GridViewCopy.Columns["START_DATE"], time.AddDays(val)); } if (ComboBoxEditStartTerm.Text == "Months") { GridViewCopy.SetRowCellValue(i, GridViewCopy.Columns["START_DATE"], time.AddMonths(val)); } if (ComboBoxEditStartTerm.Text == "Years") { GridViewCopy.SetRowCellValue(i, GridViewCopy.Columns["START_DATE"], time.AddYears(val)); } } } } } if (SpinEditEnd.Enabled == true) { if (GridViewCopy.RowCount == 1) { if (!string.IsNullOrWhiteSpace(GridViewCopy.GetFocusedRowCellDisplayText("END_DATE"))) { DateTime time = (DateTime)GridViewCopy.GetFocusedRowCellValue("END_DATE"); int val = (int)SpinEditEnd.Value; if (ComboBoxEditEndAdd.Text == "- Subtract") { val *= -1; } if (ComboBoxEditEndTerm.Text == "Days") { GridViewCopy.SetFocusedRowCellValue("END_DATE", time.AddDays(val)); } if (ComboBoxEditEndTerm.Text == "Months") { GridViewCopy.SetFocusedRowCellValue("END_DATE", time.AddMonths(val)); } if (ComboBoxEditEndTerm.Text == "Years") { GridViewCopy.SetFocusedRowCellValue("END_DATE", time.AddYears(val)); } } } else { for (int i = 0; i < GridViewCopy.RowCount; i++) { if (!string.IsNullOrWhiteSpace(GridViewCopy.GetFocusedRowCellDisplayText("END_DATE"))) { DateTime time = (DateTime)GridViewCopy.GetRowCellValue(i, "END_DATE"); int val = (int)SpinEditEnd.Value; if (ComboBoxEditEndAdd.Text == "- Subtract") { val *= -1; } if (ComboBoxEditEndTerm.Text == "Days") { GridViewCopy.SetRowCellValue(i, GridViewCopy.Columns["END_DATE"], time.AddDays(val)); } if (ComboBoxEditEndTerm.Text == "Months") { GridViewCopy.SetRowCellValue(i, GridViewCopy.Columns["END_DATE"], time.AddMonths(val)); } if (ComboBoxEditEndTerm.Text == "Years") { GridViewCopy.SetRowCellValue(i, GridViewCopy.Columns["END_DATE"], time.AddYears(val)); } } } } } if (SpinEditResStart.Enabled == true) { if (GridViewCopy.RowCount == 1) { if (!string.IsNullOrWhiteSpace(GridViewCopy.GetFocusedRowCellDisplayText("ResDate_Start"))) { DateTime time = (DateTime)GridViewCopy.GetFocusedRowCellValue("ResDate_Start"); int val = (int)SpinEditResStart.Value; if (ComboBoxEditResStartAdd.Text == "- Subtract") { val *= -1; } if (ComboBoxEditResStartTerm.Text == "Days") { GridViewCopy.SetFocusedRowCellValue("ResDate_Start", time.AddDays(val)); } if (ComboBoxEditResStartTerm.Text == "Months") { GridViewCopy.SetFocusedRowCellValue("ResDate_Start", time.AddMonths(val)); } if (ComboBoxEditResStartTerm.Text == "Years") { GridViewCopy.SetFocusedRowCellValue("ResDate_Start", time.AddYears(val)); } } } else { for (int i = 0; i < GridViewCopy.RowCount; i++) { if (!string.IsNullOrWhiteSpace(GridViewCopy.GetFocusedRowCellDisplayText("ResDate_Start"))) { DateTime time = (DateTime)GridViewCopy.GetRowCellValue(i, "ResDate_Start"); int val = (int)SpinEditResStart.Value; if (ComboBoxEditResStartAdd.Text == "- Subtract") { val *= -1; } if (ComboBoxEditResStartTerm.Text == "Days") { GridViewCopy.SetRowCellValue(i, GridViewCopy.Columns["ResDate_Start"], time.AddDays(val)); } if (ComboBoxEditResStartTerm.Text == "Months") { GridViewCopy.SetRowCellValue(i, GridViewCopy.Columns["ResDate_Start"], time.AddMonths(val)); } if (ComboBoxEditResStartTerm.Text == "Years") { GridViewCopy.SetRowCellValue(i, GridViewCopy.Columns["ResDate_Start"], time.AddYears(val)); } } } } } if (SpinEditResEnd.Enabled == true) { if (GridViewCopy.RowCount == 1) { if (!string.IsNullOrWhiteSpace(GridViewCopy.GetFocusedRowCellDisplayText("ResDate_End"))) { DateTime time = (DateTime)GridViewCopy.GetFocusedRowCellValue("ResDate_End"); int val = (int)SpinEditResStart.Value; if (ComboBoxEditResStartAdd.Text == "- Subtract") { val *= -1; } if (ComboBoxEditResStartTerm.Text == "Days") { GridViewCopy.SetFocusedRowCellValue("ResDate_End", time.AddDays(val)); } if (ComboBoxEditResStartTerm.Text == "Months") { GridViewCopy.SetFocusedRowCellValue("ResDate_End", time.AddMonths(val)); } if (ComboBoxEditResStartTerm.Text == "Years") { GridViewCopy.SetFocusedRowCellValue("ResDate_End", time.AddYears(val)); } } } else { for (int i = 0; i < GridViewCopy.RowCount; i++) { if (!string.IsNullOrWhiteSpace(GridViewCopy.GetFocusedRowCellDisplayText("ResDate_End"))) { DateTime time = (DateTime)GridViewCopy.GetRowCellValue(i, "ResDate_End"); int val = (int)SpinEditResStart.Value; if (ComboBoxEditResStartAdd.Text == "- Subtract") { val *= -1; } if (ComboBoxEditResStartTerm.Text == "Days") { GridViewCopy.SetRowCellValue(i, GridViewCopy.Columns["ResDate_End"], time.AddDays(val)); } if (ComboBoxEditResStartTerm.Text == "Months") { GridViewCopy.SetRowCellValue(i, GridViewCopy.Columns["ResDate_End"], time.AddMonths(val)); } if (ComboBoxEditResStartTerm.Text == "Years") { GridViewCopy.SetRowCellValue(i, GridViewCopy.Columns["ResDate_End"], time.AddYears(val)); } } } } } if (TextEditYear.Enabled == true) { for (int i = 0; i < GridViewCopy.RowCount; i++) { GridViewCopy.SetRowCellValue(i, GridViewCopy.Columns["YEAR"], TextEditYear.Text); } } if (TextEditSeason.Enabled == true) { for (int i = 0; i < GridViewCopy.RowCount; i++) { GridViewCopy.SetRowCellValue(i, GridViewCopy.Columns["H_L"], TextEditSeason.Text); } } if (TextEditSpecialCode.Enabled == true) { for (int i = 0; i < GridViewCopy.RowCount; i++) { GridViewCopy.SetRowCellValue(i, GridViewCopy.Columns["SpecialValue_Code"], TextEditSpecialCode.Text); } } if (ImageComboBoxEditInactive.Enabled == true) { for (int i = 0; i < GridViewCopy.RowCount; i++) { GridViewCopy.SetRowCellValue(i, GridViewCopy.Columns["Inactive"], ImageComboBoxEditInactive.EditValue); } } if (ImageComboBoxEditInhouse.Enabled == true) { for (int i = 0; i < GridViewCopy.RowCount; i++) { GridViewCopy.SetRowCellValue(i, GridViewCopy.Columns["Inhouse"], ImageComboBoxEditInhouse.EditValue); } } if (TextEditTime.Enabled == true) { for (int i = 0; i < GridViewCopy.RowCount; i++) { GridViewCopy.SetRowCellValue(i, GridViewCopy.Columns["Time"], TextEditTime.Text); } } }
private void simpleButton1_Click_1(object sender, System.EventArgs e) { int j = GridViewCopy.DataRowCount + 1; for (int i = 0; i < j; i++) { GridViewCopy.MoveFirst(); GridViewCopy.DeleteRow(GridViewCopy.FocusedRowHandle); } foreach (int val in GridViewLoad.GetSelectedRows()) { GridViewCopy.AddNewRow(); GridViewCopy.SetFocusedRowCellValue("CODE", ImageComboBoxEditCopyCode.EditValue); GridViewCopy.SetFocusedRowCellValue("ID", GridViewLoad.GetRowCellValue(val, "ID")); GridViewCopy.SetFocusedRowCellValue("CAT", GridViewLoad.GetRowCellValue(val, "CAT")); GridViewCopy.SetFocusedRowCellValue("H_L", GridViewLoad.GetRowCellValue(val, "H_L")); GridViewCopy.SetFocusedRowCellValue("YEAR", GridViewLoad.GetRowCellValue(val, "YEAR")); GridViewCopy.SetFocusedRowCellValue("HCODE", GridViewLoad.GetRowCellValue(val, "HCODE")); GridViewCopy.SetFocusedRowCellValue("LAST_UPD", DateTime.Now); GridViewCopy.SetFocusedRowCellValue("UPD_INIT", username); GridViewCopy.SetFocusedRowCellValue("START_DATE", GridViewLoad.GetRowCellValue(val, "START_DATE")); GridViewCopy.SetFocusedRowCellValue("END_DATE", GridViewLoad.GetRowCellValue(val, "END_DATE")); GridViewCopy.SetFocusedRowCellValue("DESC", GridViewLoad.GetRowCellValue(val, "DESC")); GridViewCopy.SetFocusedRowCellValue("SGL_GRATE", GridViewLoad.GetRowCellValue(val, "SGL_GRATE")); GridViewCopy.SetFocusedRowCellValue("SGL_NRATE", GridViewLoad.GetRowCellValue(val, "SGL_NRATE")); GridViewCopy.SetFocusedRowCellValue("EXG_SGL", GridViewLoad.GetRowCellValue(val, "EXG_SGL")); GridViewCopy.SetFocusedRowCellValue("EXN_SGL", GridViewLoad.GetRowCellValue(val, "EXN_SGL")); GridViewCopy.SetFocusedRowCellValue("DBL_GRATE", GridViewLoad.GetRowCellValue(val, "DBL_GRATE")); GridViewCopy.SetFocusedRowCellValue("DBL_NRATE", GridViewLoad.GetRowCellValue(val, "DBL_NRATE")); GridViewCopy.SetFocusedRowCellValue("EXG_DBL", GridViewLoad.GetRowCellValue(val, "EXG_DBL")); GridViewCopy.SetFocusedRowCellValue("EXN_DBL", GridViewLoad.GetRowCellValue(val, "EXN_DBL")); GridViewCopy.SetFocusedRowCellValue("TPL_GRATE", GridViewLoad.GetRowCellValue(val, "TPL_GRATE")); GridViewCopy.SetFocusedRowCellValue("TPL_NRATE", GridViewLoad.GetRowCellValue(val, "TPL_NRATE")); GridViewCopy.SetFocusedRowCellValue("EXG_TPL", GridViewLoad.GetRowCellValue(val, "EXG_TPL")); GridViewCopy.SetFocusedRowCellValue("EXN_TPL", GridViewLoad.GetRowCellValue(val, "EXN_TPL")); GridViewCopy.SetFocusedRowCellValue("QUA_GRATE", GridViewLoad.GetRowCellValue(val, "QUA_GRATE")); GridViewCopy.SetFocusedRowCellValue("QUA_NRATE", GridViewLoad.GetRowCellValue(val, "QUA_NRATE")); GridViewCopy.SetFocusedRowCellValue("EXG_QUA", GridViewLoad.GetRowCellValue(val, "EXG_QUA")); GridViewCopy.SetFocusedRowCellValue("EXN_QUA", GridViewLoad.GetRowCellValue(val, "EXN_QUA")); GridViewCopy.SetFocusedRowCellValue("OTH_GRATE", GridViewLoad.GetRowCellValue(val, "OTH_GRATE")); GridViewCopy.SetFocusedRowCellValue("OTH_NRATE", GridViewLoad.GetRowCellValue(val, "OTH_NRATE")); GridViewCopy.SetFocusedRowCellValue("EXG_OTH", GridViewLoad.GetRowCellValue(val, "EXG_OTH")); GridViewCopy.SetFocusedRowCellValue("EXN_OTH", GridViewLoad.GetRowCellValue(val, "EXN_OTH")); GridViewCopy.SetFocusedRowCellValue("CHD_GRATE", GridViewLoad.GetRowCellValue(val, "CHD_GRATE")); GridViewCopy.SetFocusedRowCellValue("CHD_NRATE", GridViewLoad.GetRowCellValue(val, "CHD_NRATE")); GridViewCopy.SetFocusedRowCellValue("EXG_CHD", GridViewLoad.GetRowCellValue(val, "EXG_CHD")); GridViewCopy.SetFocusedRowCellValue("EXN_CHD", GridViewLoad.GetRowCellValue(val, "EXN_CHD")); GridViewCopy.SetFocusedRowCellValue("CHD_LIMIT", GridViewLoad.GetRowCellValue(val, "CHD_LIMIT")); GridViewCopy.SetFocusedRowCellValue("JR_LIMIT", GridViewLoad.GetRowCellValue(val, "JR_LIMIT")); GridViewCopy.SetFocusedRowCellValue("JR_GRATE", GridViewLoad.GetRowCellValue(val, "JR_GRATE")); GridViewCopy.SetFocusedRowCellValue("JR_NRATE", GridViewLoad.GetRowCellValue(val, "JR_NRATE")); GridViewCopy.SetFocusedRowCellValue("EXG_JR", GridViewLoad.GetRowCellValue(val, "EXG_JR")); GridViewCopy.SetFocusedRowCellValue("EXN_JR", GridViewLoad.GetRowCellValue(val, "EXN_JR")); GridViewCopy.SetFocusedRowCellValue("MEAL1_CODE", GridViewLoad.GetRowCellValue(val, "MEAL1_CODE")); GridViewCopy.SetFocusedRowCellValue("MEAL2_CODE", GridViewLoad.GetRowCellValue(val, "MEAL2_CODE")); GridViewCopy.SetFocusedRowCellValue("MEAL3_CODE", GridViewLoad.GetRowCellValue(val, "MEAL3_CODE")); GridViewCopy.SetFocusedRowCellValue("MEAL4_CODE", GridViewLoad.GetRowCellValue(val, "MEAL4_CODE")); GridViewCopy.SetFocusedRowCellValue("MEAL5_CODE", GridViewLoad.GetRowCellValue(val, "MEAL5_CODE")); GridViewCopy.SetFocusedRowCellValue("MEAL1_ADG", GridViewLoad.GetRowCellValue(val, "MEAL1_ADG")); GridViewCopy.SetFocusedRowCellValue("MEAL2_ADG", GridViewLoad.GetRowCellValue(val, "MEAL2_ADG")); GridViewCopy.SetFocusedRowCellValue("MEAL3_ADG", GridViewLoad.GetRowCellValue(val, "MEAL3_ADG")); GridViewCopy.SetFocusedRowCellValue("MEAL4_ADG", GridViewLoad.GetRowCellValue(val, "MEAL4_ADG")); GridViewCopy.SetFocusedRowCellValue("MEAL5_ADG", GridViewLoad.GetRowCellValue(val, "MEAL5_ADG")); GridViewCopy.SetFocusedRowCellValue("MEAL1_ADN", GridViewLoad.GetRowCellValue(val, "MEAL1_ADN")); GridViewCopy.SetFocusedRowCellValue("MEAL2_ADN", GridViewLoad.GetRowCellValue(val, "MEAL2_ADN")); GridViewCopy.SetFocusedRowCellValue("MEAL3_ADN", GridViewLoad.GetRowCellValue(val, "MEAL3_ADN")); GridViewCopy.SetFocusedRowCellValue("MEAL4_ADN", GridViewLoad.GetRowCellValue(val, "MEAL4_ADN")); GridViewCopy.SetFocusedRowCellValue("MEAL5_ADN", GridViewLoad.GetRowCellValue(val, "MEAL5_ADN")); GridViewCopy.SetFocusedRowCellValue("COMMENT1", GridViewLoad.GetRowCellValue(val, "COMMENT1")); GridViewCopy.SetFocusedRowCellValue("COMMENT2", GridViewLoad.GetRowCellValue(val, "COMMENT2")); GridViewCopy.SetFocusedRowCellValue("AGENCY", GridViewLoad.GetRowCellValue(val, "AGENCY")); GridViewCopy.SetFocusedRowCellValue("COMM_FLG", GridViewLoad.GetRowCellValue(val, "COMM_FLG")); GridViewCopy.SetFocusedRowCellValue("COMM_PCT", GridViewLoad.GetRowCellValue(val, "COMM_PCT")); GridViewCopy.SetFocusedRowCellValue("MAX_SGL", GridViewLoad.GetRowCellValue(val, "MAX_SGL")); GridViewCopy.SetFocusedRowCellValue("MAX_DBL", GridViewLoad.GetRowCellValue(val, "MAX_DBL")); GridViewCopy.SetFocusedRowCellValue("MAX_TPL", GridViewLoad.GetRowCellValue(val, "MAX_TPL")); GridViewCopy.SetFocusedRowCellValue("MAX_QUA", GridViewLoad.GetRowCellValue(val, "MAX_QUA")); GridViewCopy.SetFocusedRowCellValue("MAX_OTH", GridViewLoad.GetRowCellValue(val, "MAX_OTH")); GridViewCopy.SetFocusedRowCellValue("Inhouse", GridViewLoad.GetRowCellValue(val, "Inhouse")); GridViewCopy.SetFocusedRowCellValue("Inactive", GridViewLoad.GetRowCellValue(val, "Inactive")); GridViewCopy.SetFocusedRowCellValue("ResDate_Start", GridViewLoad.GetRowCellValue(val, "ResDate_Start")); GridViewCopy.SetFocusedRowCellValue("ResDate_End", GridViewLoad.GetRowCellValue(val, "ResDate_End")); GridViewCopy.SetFocusedRowCellValue("SpecialValue_Code", GridViewLoad.GetRowCellValue(val, "SpecialValue_Code")); GridViewCopy.SetFocusedRowCellValue("Currency_CodeSheet", GridViewLoad.GetRowCellValue(val, "Currency_CodeSheet")); GridViewCopy.SetFocusedRowCellValue("Currency_CodePayment", GridViewLoad.GetRowCellValue(val, "Currency_CodePayment")); GridViewCopy.SetFocusedRowCellValue("ExchangeRate", GridViewLoad.GetRowCellValue(val, "ExchangeRate")); GridViewCopy.SetFocusedRowCellValue("PRatesPlan_Day1", GridViewLoad.GetRowCellValue(val, "PRatesPlan_Day1")); GridViewCopy.SetFocusedRowCellValue("PRatesPlan_Day2", GridViewLoad.GetRowCellValue(val, "PRatesPlan_Day2")); GridViewCopy.SetFocusedRowCellValue("PRatesPlan_Day3", GridViewLoad.GetRowCellValue(val, "PRatesPlan_Day3")); GridViewCopy.SetFocusedRowCellValue("PRatesPlan_Day4", GridViewLoad.GetRowCellValue(val, "PRatesPlan_Day4")); GridViewCopy.SetFocusedRowCellValue("PRatesPlan_Day5", GridViewLoad.GetRowCellValue(val, "PRatesPlan_Day5")); GridViewCopy.SetFocusedRowCellValue("PRatesPlan_Day6", GridViewLoad.GetRowCellValue(val, "PRatesPlan_Day6")); GridViewCopy.SetFocusedRowCellValue("PRatesPlan_Day7", GridViewLoad.GetRowCellValue(val, "PRatesPlan_Day7")); } GridViewCopy.Focus(); GridViewLoad.Focus(); if (checkEdit1.Checked) { if (MessageBox.Show("Are you sure you want to delete the original records?", "CONFIRM", MessageBoxButtons.YesNo) == DialogResult.Yes) { GridViewLoad.DeleteSelectedRows(); context.SaveChanges(); } } }