Example #1
0
        public ActionResult Register(MS_UserInfo_Request req)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    List <MS_UserInfo_Response> Cek = BL.RegistrasiCek(req);
                    bool IsExists = Convert.ToBoolean(Cek.FirstOrDefault().ResponseAction);
                    if (!IsExists)
                    {
                        bool Req = BL.RegisterNewAccount(req);
                        return(RedirectToAction("Index"));
                    }
                    else
                    {
                        ViewBag.Error = Cek.FirstOrDefault().ResponseMessage.ToString();
                        ViewBag.Err   = "Y";
                        return(View("Index"));
                    }
                }
            }
            catch (Exception ex)
            {
                MS_ActivityLog param = new MS_ActivityLog
                {
                    ActionName     = ControllerContext.RouteData.Values["action"].ToString(),
                    UserID_FK      = 0,
                    ControllerName = ControllerContext.RouteData.Values["controller"].ToString(),
                    Description    = ex.Message.ToString(),
                    ActivityDate   = DateTime.Now
                };
                bool RetVal = Act.ActivityLog(param);
            }

            return(View());
        }