// GET: Employer

        // Written by Fredrick T. Lutterodt
        public ActionResult AddNewEmployerTab(string containerId = "MainArea")
        {
            var pvr = new Ext.Net.MVC.PartialViewResult
            {
                ViewName    = "AddNewEmployerPartial",
                Model       = EmployerRepo.GetEmployerList(),
                ContainerId = containerId,
                RenderMode  = RenderMode.AddTo,
            };

            X.Mask.Hide();
            this.GetCmp <TabPanel>(containerId).SetLastTabAsActive();

            return(pvr);
        }
        public ActionResult UpdateRecord_Status(crm_EmployerRepo EmployerRepo)
        {
            try
            {
                EmployerRepo.Maker_Id = GlobalValue.User_ID;

                if (string.IsNullOrEmpty(EmployerRepo.Employer_Id))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please select Employer. Process aborted",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                if (string.IsNullOrEmpty(EmployerRepo.Employer_Status))
                {
                    X.Msg.Show(new MessageBoxConfig
                    {
                        Title   = "Error",
                        Message = "Please select New Status. Process aborted",
                        Buttons = MessageBox.Button.OK,
                        Icon    = MessageBox.Icon.INFO,
                        Width   = 350
                    });
                    return(this.Direct());
                }

                this.EmployerRepo.UpdateRecord_Status(EmployerRepo);

                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Success",
                    Message = "Employer Status Successfully Changed.",
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                var pvr = new Ext.Net.MVC.PartialViewResult
                {
                    ViewName    = "AddEditEmployerStatusPartial",
                    Model       = EmployerRepo.GetEmployerList(),
                    ContainerId = "MainArea",
                    RenderMode  = RenderMode.AddTo,
                };

                this.GetCmp <TabPanel>("MainArea").SetLastTabAsActive();

                return(pvr);
            }


            catch (Exception ex)
            {
                string ora_code = ex.Message.Substring(0, 9);
                if (ora_code == "ORA-20000")
                {
                    ora_code = "Record already exist. Process aborted..";
                }
                else if (ora_code == "ORA-20100")
                {
                    ora_code = "Not all records are supplied. Process aborted..";
                }
                else
                {
                    ora_code = ex.ToString();
                }
                X.Msg.Show(new MessageBoxConfig
                {
                    Title   = "Error",
                    Message = ora_code,
                    Buttons = MessageBox.Button.OK,
                    Icon    = MessageBox.Icon.INFO,
                    Width   = 350
                });
                //log.Write(level: Serilog.Events.LogEventLevel.Information, messageTemplate: ex.Message + " " + DateTime.Now);
                return(this.Direct());
            }
        }