예제 #1
0
        public ActionResult Batch(Batch batch)
        {
            string LoginUser   = (string)Session["LoginSAPID"];
            string userkey     = ConfigurationManager.AppSettings["userkey"];
            string uid         = ConfigurationManager.AppSettings["uid"];
            string EmployerId  = (string)Session["EMPLOYER_ID"];
            string CompanyName = (string)Session["CompanyName"];

            try
            {
                Employer.Employer employer = new Employer.Employer();

                var batchStatus   = employer.CreateStatementEmployerBatch(batch.BatchName, CompanyName, EmployerId, batch.ContactAddress, batch.ContactAddress1, batch.ContactLGA, batch.ContactState, batch.ContactName, batch.ContactPhone, batch.ContactName2, batch.ContactPhone2, userkey, uid);
                var statusDetails = batchStatus.Split('~');

                if (statusDetails[0] != "01")
                {
                    TempData["bMsg"] = statusDetails[1];
                    return(RedirectToAction("Index"));
                }
                else
                {
                    TempData["bError"] = statusDetails[1];
                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception ex)
            {
                LogError logerror = new LogError();
                logerror.ErrorLog("", LoginUser, "", "StatementOptions/Batch", "StatementOptions", "Batch", "FetchInternalUsers Error", ex.Message.ToString(), 0);
                TempData["bError"] = ex.Message.ToString();
                return(RedirectToAction("Index"));
            }
        }