private void Import() { try { FormHelpers.CursorWait(true); GetExclData(mtxtFilePath.Text); var chk_itm = itmbal.GetByID(UserSettings.LogInYear, dttemp.Rows[0][1].ToString()); if (!mcbOverWrite.Checked) { msg = "This process will import components to the current logged in year. Do you want to continue?"; if (MessageHelpers.ShowQuestion(msg) == DialogResult.Yes) { if (chk_itm == null) { if (itmbal.Save(ItemToSave())) { tmpcombal.DistributeCompo(UserSettings.LogInYear, dttemp.Rows[0][1].ToString(), UserSettings.Username); MessageHelpers.ShowInfo(msgval_success); this.Close(); } } else { MessageHelpers.ShowInfo(msgval_nochanges); this.Close(); } } } else { msg = "This process will remove the existing components and replace it. Do you want to continue?"; if (MessageHelpers.ShowQuestion(msg) == DialogResult.Yes) { if (chk_itm != null) { if (itmbal.Delete(chk_itm)) { DeleteSub(chk_itm.ItemNo); } } if (itmbal.Save(ItemToSave())) { tmpcombal.DistributeCompo(UserSettings.LogInYear, dttemp.Rows[0][1].ToString(), UserSettings.Username); MessageHelpers.ShowInfo(msgval_success); this.Close(); } } } MyCaller_itm.RefreshGrid(); } catch (Exception ex) { MessageHelpers.ShowError(ex.Message); } finally { FormHelpers.CursorWait(false); } }