private void mbtnGenerate_Click(object sender, EventArgs e) { var msg_succ = "Generating Successful!"; var msg_failed = "No Data Generated!"; if (MessageHelpers.ShowQuestion("Generate Report?") == System.Windows.Forms.DialogResult.Yes) { try { FormHelpers.CursorWait(true); rptdetails.SP_GeneratePriceList(UserSettings.LogInYear, BPSolutionsTools.BPSUtilitiesV1.NZ(mcboCategory.SelectedValue, "").ToString()); tmp_SCsummlist = tmp_SCsummbal.GetAll(); if (tmp_SCsummlist.Count > 0) { MessageHelpers.ShowInfo(msg_succ); } else { throw new Exception(msg_failed); } } catch (Exception ex) { MessageHelpers.ShowError(ex.Message); } finally { FormHelpers.CursorWait(false); } } }
private void Save_assy() { foreach (tbl_000_H_ASSY a in assylist) { a.YEARUSED = UserSettings.LogInYear; a.IsLocked = false; a.CreatedDate = DateTime.Now; a.CreatedBy = UserSettings.Username; a.UpdatedDate = DateTime.Now; a.IsCopied = false; a.CopyDate = DateTime.Now; a.IsImported = true; a.ImportDate = DateTime.Now; a.ImportBy = UserSettings.Username; cleaned_list_assy.Add(a); } if (assybal.Save_List(cleaned_list_assy)) { if (cleaned_list_assy.Count > 0) { finishing_msg = msgval_success; } else { finishing_msg = msgval_nochanges; } MessageHelpers.ShowInfo(finishing_msg); MyCaller_mtassy.Init_Form(); } }
private void Save_com() { foreach (tbl_000_H_PART c in comlist) { c.YEARUSED = UserSettings.LogInYear; c.IsLocked = false; c.CreatedDate = DateTime.Now; c.CreatedBy = UserSettings.Username; c.UpdatedDate = DateTime.Now; c.IsCopied = false; c.CopyDate = DateTime.Now; c.IsImported = true; c.ImportDate = DateTime.Now; c.ImportBy = UserSettings.Username; cleaned_list_com.Add(c); } if (combal.Save_List(cleaned_list_com)) { if (cleaned_list_com.Count > 0) { finishing_msg = msgval_success; } else { finishing_msg = msgval_nochanges; } MessageHelpers.ShowInfo(finishing_msg); MyCaller_com.Init_Form(); } }
private void Save_proc() { foreach (tbl_000_PROCESS p in proclist) { p.YEARUSED = UserSettings.LogInYear; p.IsActive = false; p.CreatedDate = DateTime.Now; p.CreatedBy = UserSettings.Username; p.UpdatedDate = DateTime.Now; p.IsCopied = false; p.CopyDate = DateTime.Now; p.IsImported = true; p.ImportDate = DateTime.Now; p.ImportBy = UserSettings.Username; cleaned_list_proc.Add(p); } if (procbal.Save(cleaned_list_proc)) { if (cleaned_list_proc.Count > 0) { finishing_msg = msgval_success; } else { finishing_msg = msgval_nochanges; } MessageHelpers.ShowInfo(finishing_msg); MyCaller_proc.Init_Form(); } }
private void mbtnGenerate_Click(object sender, EventArgs e) { var msg_succ = "Generating Successful!"; var msg_failed = "No Data Generated!"; try { FormHelpers.CursorWait(true); var checkdt = rptdetails.SP_GenerateVariance(mcboMonth.SelectedIndex + 1, Convert.ToInt16(mtxtYear.Text)); if (checkdt == null || checkdt.Rows.Count == 0) { throw new Exception(msg_failed); } else { MessageHelpers.ShowInfo(msg_succ); } } catch (Exception ex) { MessageHelpers.ShowError(ex.Message); } finally { FormHelpers.CursorWait(false); } }
private void mbtnGenerate_Click(object sender, EventArgs e) { var msg_succ = "Generating Successful!"; var msg_failed = "No Data Generated!"; if (MessageHelpers.ShowQuestion("Generate Report?") == System.Windows.Forms.DialogResult.Yes) { try { FormHelpers.CursorWait(true); if (rptdetails.SP_GeneratePriceListComparison(Convert.ToInt32(mcbofrstYear.SelectedValue), Convert.ToInt32(mcboscndYear.SelectedValue), BPSUtilitiesV1.NZ(mcboCategory.SelectedValue, "").ToString()).Rows.Count == 0) { throw new Exception(msg_failed); } else { MessageHelpers.ShowInfo(msg_succ); } } catch (Exception ex) { MessageHelpers.ShowError(ex.Message); } finally { FormHelpers.CursorWait(false); } } }
private void SaveRecord() { try { FormHelpers.CursorWait(true); if (IsValid()) { AssignRecord(true); if (compbal.Update(comp)) { MessageHelpers.ShowInfo("Update Successful!"); MyState = FormState.View; Init_Form(); } else { MessageHelpers.ShowWarning("Update Failed!"); } } } catch (Exception ex) { MessageHelpers.ShowError(ex.Message); } finally { FormHelpers.CursorWait(false); } }
private void CopyByCat(Boolean IsOverwrite) { if (catbal.CopyByCat(selyear, UserSettings.LogInYear, mtxtCatCode.Text, IsOverwrite)) { MessageHelpers.ShowInfo(msgval_success); } }
private void Delete() { try { FormHelpers.CursorWait(true); var msg = "Deleting"; if (MessageHelpers.ShowQuestion("Are you sure you want to delete record?") == System.Windows.Forms.DialogResult.Yes) { var yearused = UserSettings.LogInYear; var partno = mgridListVP.Rows[mgridListVP.SelectedCells[0].RowIndex].Cells["colPartNoVP"].Value.ToString(); vp = vpbal.GetByID(Convert.ToInt32(yearused), partno.ToString());; if (vpbal.Delete(vp)) { MessageHelpers.ShowInfo(msg + " Successful!"); RefreshGrid(); PageManager(1); } else { MessageHelpers.ShowWarning(msg + " Failed!"); } } } catch (Exception ex) { MessageHelpers.ShowError(ex.Message); } finally { FormHelpers.CursorWait(false); } }
private void Save_pi() { foreach (tbl_000_H_PI p in pilist) { p.YEARUSED = UserSettings.LogInYear; p.IsLocked = false; p.CreatedDate = DateTime.Now; p.CreatedBy = UserSettings.Username; p.UpdatedDate = DateTime.Now; p.IsCopied = false; p.CopyDate = DateTime.Now; p.IsImported = true; p.ImportDate = DateTime.Now; p.ImportBy = UserSettings.Username; cleaned_list_pi.Add(p); } if (pibal.Save_List(cleaned_list_pi)) { if (cleaned_list_pi.Count > 0) { finishing_msg = msgval_success; } else { finishing_msg = msgval_nochanges; } MessageHelpers.ShowInfo(finishing_msg); MyCaller_mtpi.Init_Form(); } }
private void Save_vp() { foreach (tbl_000_H_VP v in vplist) { v.YEARUSED = UserSettings.LogInYear; v.IsLocked = false; v.CreatedDate = DateTime.Now; v.CreatedBy = UserSettings.Username; v.UpdatedDate = DateTime.Now; v.IsCopied = false; v.CopyDate = DateTime.Now; v.IsImported = true; v.ImportDate = DateTime.Now; v.ImportBy = UserSettings.Username; cleaned_list_vp.Add(v); } if (vpbal.Save_List(cleaned_list_vp)) { if (cleaned_list_vp.Count > 0) { finishing_msg = msgval_success; } else { finishing_msg = msgval_nochanges; } MessageHelpers.ShowInfo(finishing_msg); MyCaller_mtvp.Init_Form(); } }
private void mbtnGenerate_Click(object sender, EventArgs e) { var msg_succ = "Generating Successful!"; try { FormHelpers.CursorWait(true); dtgnrtd = rptdetails.SP_GenerateQuot(mtxtItemNo.Text, UserSettings.LogInYear, mdtDate.Value, this.Text, Convert.ToDecimal(mtxtMPT.Text)); if (dtgnrtd != null && dtgnrtd.Rows.Count > 0) { MessageHelpers.ShowInfo(msg_succ); } else { throw new Exception("No Data Generated!"); } } catch (Exception ex) { MessageHelpers.ShowError(ex.Message); } finally { FormHelpers.CursorWait(false); } }
private void SaveRecord() { var msg = "Successful!"; try { FormHelpers.CursorWait(true); AssignRecord(true); if (signalist_existing.Count == 0) { if (signabal.Save(signalist)) { MessageHelpers.ShowInfo("Saving " + msg); Init_Form(); } } else { if (signabal.Update(signalist)) { MessageHelpers.ShowInfo("Updating " + msg); Init_Form(); } } } catch (Exception ex) { MessageHelpers.ShowError(ex.Message); } finally { FormHelpers.CursorWait(false); } }
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); } }
private void CopyCatByYear(Boolean IsOverwrite) { if (catbal.CopyCatByYear(selyear, UserSettings.LogInYear, IsOverwrite)) { MessageHelpers.ShowInfo(msgval_success); MyCaller_cat.Init_Form(); } }
private void Save_assy(Boolean IsOverwrite) { if (assybal.CopyByYear(selyear, UserSettings.LogInYear, UserSettings.Username, IsOverwrite)) { MessageHelpers.ShowInfo(msgval_success); MyCaller_mtassy.Init_Form(); } }
private void Save_proc(Boolean IsOverwrite) { if (procbal.CopyByYear(selyear, UserSettings.LogInYear, UserSettings.Username, IsOverwrite)) { MessageHelpers.ShowInfo(msgval_success); MyCaller_proc.LoadGrid(); } }
private void CopyByYear(Boolean IsOverwrite) { if (itmbal.CopyItemByYear(selyear, UserSettings.LogInYear, UserSettings.Username, IsOverwrite)) { MessageHelpers.ShowInfo(msgval_success); MyCaller_itm.Init_Form(); } }
private void SaveRecord() { try { FormHelpers.CursorWait(true); if (IsValid()) { var isSuccess = false; var msg = ""; AssignRecord(true); switch (MyState) { case FormState.Add: msg = "Saving"; usr.UserID = Guid.NewGuid().ToString(); if (userbal.Save(usr)) { isSuccess = true; } break; case FormState.Edit: msg = "Updating"; if (userbal.Update(usr)) { isSuccess = true; } break; case FormState.Delete: msg = "Deleting"; if (userbal.Delete(usr)) { isSuccess = true; } break; } if (isSuccess) { MessageHelpers.ShowInfo(msg + " Successful!"); MyCaller.RefreshGrid(); this.Close(); } else { MessageHelpers.ShowWarning(msg + " Failed!"); } } } catch (Exception ex) { MessageHelpers.ShowError(ex.Message); } finally { FormHelpers.CursorWait(false); } }
private void Save_item() { AssignSubItems(itmlist); Modify_SubItems(); foreach (tbl_000_H_ITEM i in itmlist) { i.DocID = 0; i.YEARUSED = UserSettings.LogInYear; i.IsCopied = true; i.CopyDate = DateTime.Now; //Component List if (cleaned_list_itmcom.Count > 0) { i.itemCom = cleaned_list_itmcom; } //Tabulation if (cleaned_list_itmpi.Count > 0) { i.itemPI = cleaned_list_itmpi; } if (cleaned_list_itmvp.Count > 0) { i.itemVP = cleaned_list_itmvp; } if (cleaned_list_itmassy.Count > 0) { i.itemAssy = cleaned_list_itmassy; } //MPT if (cleaned_list_itmmpt.Count > 0) { i.itemMPT = cleaned_list_itmmpt; } //FDC if (cleaned_list_itmfdc.Count > 0) { i.itemFDC = cleaned_list_itmfdc; } cleaned_list_itm.Add(i); } if (itmbal.Save_List(cleaned_list_itm)) { if (cleaned_list_itm.Count > 0) { finishing_msg = msgval_success; } else { finishing_msg = msgval_nochanges; } MessageHelpers.ShowInfo(finishing_msg); MyCaller_itm.RefreshGrid(); } }
private void SaveRecord() { proclist_todelete = new List <tbl_000_PROCESS>(); try { var msg = ""; AssignRecord(); //Delete rows from db w/c doesn't exist in grid var proclist_fromdb = procbal.GetAll().Where(w => w.YEARUSED == UserSettings.LogInYear).ToList(); foreach (tbl_000_PROCESS pdb in proclist_fromdb) { if (!proclist_gridall.Any(a => a.YEARUSED == pdb.YEARUSED && a.SubProcessCode == pdb.SubProcessCode)) { if (pdb.ProcessCode == mcboDefaults.SelectedValue.ToString()) { proclist_todelete.Add(pdb); } } } if (proclist_todelete.Count > 0) { if (procbal.Delete(proclist_todelete)) { msg = "D"; } } //Save the new rows if (proclist_toadd.Count > 0) { if (procbal.Save(proclist_toadd)) { msg = "A"; } } //Update Rows if (proclist_toupdate.Count > 0) { if (procbal.Update(proclist_toupdate)) { msg = "U"; } } if (msg != "") { MessageHelpers.ShowInfo("List Updated Successfully!"); LoadGrid(); MyState = FormState.View; } } catch (Exception ex) { throw ex; } }
private void SaveRecord() { try { FormHelpers.CursorWait(true); mgridRights.CommitEdit(DataGridViewDataErrorContexts.Commit); if (IsValid()) { var strmsg = ""; var blnsuccess = false; AssignRecord(true); if (MyState == FormState.Add) { strmsg = "Saving Failed!"; if (usrgrpbal.Save(usrgrp)) { strmsg = "Saving Successful!"; blnsuccess = true; } } if (MyState == FormState.Edit) { strmsg = "Updating Failed!"; if (usrgrpbal.Update(usrgrp)) { strmsg = "Updating Successful!"; blnsuccess = true; } } if (blnsuccess) { MessageHelpers.ShowInfo(strmsg); MyCaller.RefreshGrid(); MyCaller.Focus(); this.Close(); } else { MessageHelpers.ShowWarning(strmsg); } } } catch (Exception ex) { MessageHelpers.ShowError(ex.Message); } finally { FormHelpers.CursorWait(false); } }
private void ChangePass() { current_user = userbal.GetByUsername(UserSettings.Username); err.Clear(); if (current_user.Password == mtxtOldPass.Text) { if (mtxtNewPass.Text != "" && mtxtConPass.Text != "") { if (mtxtNewPass.Text == mtxtConPass.Text) { current_user.Password = mtxtConPass.Text; if (MessageHelpers.ShowQuestion("Are you sure want to change your password?") == DialogResult.Yes) { if (userbal.Update(current_user)) { MessageHelpers.ShowInfo("Password successfully changed."); this.Close(); } else { throw new Exception("Error occured!"); } } } else { err.SetError(mtxtConPass, "Passwords entered does not match!"); } } else { if (mtxtNewPass.Text == "") { err.SetError(mtxtNewPass, "Required"); } else if (mtxtNewPass.Text == "") { err.SetError(mtxtConPass, "Required"); } else { err.SetError(mtxtNewPass, "Required"); err.SetError(mtxtConPass, "Required"); } } } else { err.SetError(mtxtOldPass, "Please enter your old password!"); } err.CheckAndShowSummaryErrorMessage(); }
private void SaveRecord() { try { FormHelpers.CursorWait(true); if (IsValid()) { var isSuccess = false; var msg = ""; AssignRecord(true); switch (MyState) { case FormState.Add: msg = "Saving"; if (pibal.Save(pi)) { isSuccess = true; } break; case FormState.Edit: msg = "Updating"; if (pibal.Update(pi)) { isSuccess = true; } break; } if (isSuccess) { MessageHelpers.ShowInfo(msg + " Successful!"); MyCaller.Init_Form(); this.Close(); } else { MessageHelpers.ShowWarning(msg + " Failed!"); } } } catch (Exception ex) { MessageHelpers.ShowError(ex.Message); } finally { FormHelpers.CursorWait(false); } }
private void mbtnTestConnection_Click(object sender, EventArgs e) { try { FormHelpers.CursorWait(true); TestConnection(); Preloader.Preload(); MessageHelpers.ShowInfo("Test connection successful."); } catch (Exception ex) { MessageHelpers.ShowError(ex.Message); } finally { FormHelpers.CursorWait(false); } }
public void DeleteRecord() { var fxsptype = ""; var fxspeffdate = ""; try { if (mgridList1.SelectedRows != null) { fxsptype = mgridList1.Rows[mgridList1.SelectedCells[0].RowIndex].Cells["colRecType1"].Value.ToString(); fxspeffdate = mgridList1.Rows[mgridList1.SelectedCells[0].RowIndex].Cells["colEffectiveDate1"].Value.ToString(); } } catch { if (mgridList2.SelectedRows != null) { fxsptype = mgridList2.Rows[mgridList2.SelectedCells[0].RowIndex].Cells["colRecType2"].Value.ToString(); fxspeffdate = mgridList2.Rows[mgridList2.SelectedCells[0].RowIndex].Cells["colEffectiveDate2"].Value.ToString(); } } string rectype = fxsptype; string effectivedate = fxspeffdate; if (MessageHelpers.ShowQuestion("Are you sure you want to delete record?") == System.Windows.Forms.DialogResult.Yes) { var isSuccess = false; var msg = "Deleting"; fxsp = FXSPbal.GetByID(rectype, Convert.ToDateTime(effectivedate)); if (FXSPbal.Delete(fxsp)) { isSuccess = true; } if (isSuccess) { MessageHelpers.ShowInfo(msg + " Successful!"); RefreshGrid(); } else { MessageHelpers.ShowWarning(msg + " Failed!"); } } }
private void QuoteItem(string itemno) { try { FormHelpers.CursorWait(true); if (itembal.QuoteItem(yused, itemno)) { MessageHelpers.ShowInfo("Quotation Successful!"); } } catch (Exception ex) { MessageHelpers.ShowError(ex.Message); } finally { FormHelpers.CursorWait(false); } }
public void DeleteRecord() { try { FormHelpers.CursorWait(true); var year = UserSettings.LogInYear; int yearused = year; var no = mgridList.Rows[mgridList.SelectedCells[0].RowIndex].Cells["colPartNo"].Value.ToString(); string partno = no; if (MessageHelpers.ShowQuestion("Are you sure want to delete record?") == DialogResult.Yes) { var isSuccess = false; var msg = "Deleting"; com = combal.GetByID(yearused, partno); if (combal.Delete(com)) { isSuccess = true; } if (isSuccess) { MessageHelpers.ShowInfo(msg + " Successful!"); RefreshGrid(); PageManager(1); } else { MessageHelpers.ShowWarning(msg + " Failed!"); } } } catch (Exception ex) { MessageHelpers.ShowError(ex.Message); } finally { FormHelpers.CursorWait(false); } }
public void Lock() { if (MessageHelpers.ShowQuestion("Are you sure want to lock this year?") == DialogResult.Yes) { var LockingisSuccess = false; var msg = "Locking"; AssignforLocking(true); if (yearbal.Lock(year)) { LockingisSuccess = true; } if (LockingisSuccess) { MessageHelpers.ShowInfo(msg + " Successful!"); RefreshGrid(); } else { MessageHelpers.ShowInfo(msg + " Failed!"); } } }
public void DeleteRecord() { try { FormHelpers.CursorWait(true); var categorycode = mgridList.Rows[mgridList.SelectedCells[0].RowIndex].Cells["colCATCODE"].Value.ToString(); var cyearused = UserSettings.LogInYear; int yearused = Convert.ToInt32(cyearused); if (MessageHelpers.ShowQuestion("Are you sure you want to delete record?") == System.Windows.Forms.DialogResult.Yes) { var isSuccess = false; var msg = "Deleting"; cat = Categorybal.GetByID(categorycode, yearused); if (Categorybal.Delete(cat)) { isSuccess = true; } if (isSuccess) { MessageHelpers.ShowInfo(msg + " Successful!"); RefreshGrid(); PageManager(1); } else { MessageHelpers.ShowWarning(msg + " Failed!"); } } } catch (Exception ex) { MessageHelpers.ShowError(ex.Message); } finally { FormHelpers.CursorWait(false); } }