public ActionResult SaveRecord(crm_EmployeeSchemeFundRepo ESFRepo) { try { string esf_iddd = ESFRepo.Cust_No + ESFRepo.Scheme_Id; if (ESFRepo.isESUnique(esf_iddd) == true) { X.Msg.Show(new MessageBoxConfig { Title = "Duplicate", Message = "Employee already exist on this scheme.", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.INFO, Width = 350 }); return(this.Direct()); } //// validate if the employee has an existing ACTIVE fund account if (ModelState.IsValid) { this.ESFRepo.SaveRecord(ESFRepo); X.Msg.Show(new MessageBoxConfig { Title = "Success", Message = "Employee Fund_Scheme Successfully Added.", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.INFO, Width = 350 }); ClearControls(); Store store = X.GetCmp <Store>("esfStore"); store.Reload(); return(this.Direct()); } else { string messages = string.Join(Environment.NewLine, ModelState.Values .SelectMany(x => x.Errors) .Select(x => x.ErrorMessage)); X.Msg.Show(new MessageBoxConfig { Title = "Error", Message = messages, // " Insufficient data. Operation Aborted", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.ERROR, Width = 350 }); return(this.Direct()); } } catch (System.Exception EX) { throw EX; } }
public ActionResult ChangeRecordemployer(crm_EmployeeSchemeFundRepo ESFRepo) { try { if (string.IsNullOrEmpty(ESFRepo.Employer_Id)) { X.Msg.Show(new MessageBoxConfig { Title = "Error", Message = "Please select employee", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.INFO, Width = 350 }); return(this.Direct()); } if (string.IsNullOrEmpty(ESFRepo.New_Employer_Id)) { X.Msg.Show(new MessageBoxConfig { Title = "Error", Message = "Please select new employer", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.INFO, Width = 350 }); return(this.Direct()); } this.ESFRepo.ChangeRecordemployer(ESFRepo); X.Msg.Show(new MessageBoxConfig { Title = "Success", Message = "Employer Successfully Changed.", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.INFO, Width = 350 }); //ClearControls_changeemployer(); //Store store = X.GetCmp<Store>("change_ESF_employeeStore_employer"); //store.Reload(); //Store store1 = X.GetCmp<Store>("changeSFStore_employer"); //store1.Reload(); //return this.Direct(); var pvr = new Ext.Net.MVC.PartialViewResult { ViewName = "EmployerChangeSchemeFundPartial", ContainerId = "MainArea", RenderMode = RenderMode.AddTo, }; this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive(); return(pvr); } catch (System.Exception EX) { throw EX; } }
public ActionResult ChangeRecord(crm_EmployeeSchemeFundRepo ESFRepo) { try { string esf_iddd = ESFRepo.Cust_No + ESFRepo.New_Scheme_Fund_Id; if (ESFRepo.isESUnique(esf_iddd) == true) { X.Mask.Hide(); X.Msg.Show(new MessageBoxConfig { Title = "Duplicate", Message = "Employee Scheme_Fund already exist.", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.INFO, Width = 350 }); return(this.Direct()); } //// check if there is enougth money for transfer //if (ESFRepo.Get_GL_Balance(ESFRepo) == true) //{ // X.Mask.Hide(); // X.Msg.Show(new MessageBoxConfig // { // Title = "Error", // Message = "Insufficient cash in collection account. Process aborted", // Buttons = MessageBox.Button.OK, // Icon = MessageBox.Icon.INFO, // Width = 350 // }); // return this.Direct(); //} // check if there is collection account for new scheme if (ESFRepo.Get_GL_coll(ESFRepo) == true) { X.Mask.Hide(); X.Msg.Show(new MessageBoxConfig { Title = "Error", Message = "No collection account for new scheme account. Process aborted", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.INFO, Width = 350 }); return(this.Direct()); } if (ModelState.IsValid) { this.ESFRepo.ChangeRecord(ESFRepo); X.Mask.Hide(); X.Msg.Show(new MessageBoxConfig { Title = "Success", Message = "Employee Scheme Fund Successfully Changed.", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.INFO, Width = 350 }); X.Mask.Hide(); ClearControls_change(); Store store = X.GetCmp <Store>("change_ESF_employeeStore"); store.Reload(); Store store1 = X.GetCmp <Store>("changeSFStore"); store1.Reload(); return(this.Direct()); } else { X.Mask.Hide(); string messages = string.Join(Environment.NewLine, ModelState.Values .SelectMany(x => x.Errors) .Select(x => x.ErrorMessage)); X.Mask.Hide(); X.Msg.Show(new MessageBoxConfig { Title = "Error", Message = messages, // " Insufficient data. Operation Aborted", Buttons = MessageBox.Button.OK, Icon = MessageBox.Icon.ERROR, Width = 350 }); return(this.Direct()); } } catch (System.Exception EX) { X.Mask.Hide(); throw EX; } }