コード例 #1
0
ファイル: ExistingLeadController.cs プロジェクト: KKPBank/CSM
        public ActionResult List(string encryptedString)
        {
            int?customerId = encryptedString.ToCustomerId();

            Logger.Info(_logMsg.Clear().SetPrefixMsg("List Recommended Campaign").Add("CustomerId", customerId).ToInputLogString());

            if (customerId == null)
            {
                return(RedirectToAction("Search", "Customer"));
            }

            try
            {
                ExistingLeadViewModel existingLeadVM = new ExistingLeadViewModel();
                CustomerInfoViewModel custInfoVM     = this.MappingCustomerInfoView(customerId.Value);
                existingLeadVM.CustomerInfo = custInfoVM;
                return(View(existingLeadVM));
            }
            catch (Exception ex)
            {
                Logger.Error("Exception occur:\n", ex);
                Logger.Info(_logMsg.Clear().SetPrefixMsg("List Recommended Campaign").Add("Error Message", ex.Message).ToFailLogString());
                return(Error(new HandleErrorInfo(ex, this.ControllerContext.RouteData.Values["controller"].ToString(),
                                                 this.ControllerContext.RouteData.Values["action"].ToString())));
            }
        }
コード例 #2
0
ファイル: ExistingLeadController.cs プロジェクト: KKPBank/CSM
        public ActionResult List(int?customerId = null)
        {
            Logger.Info(_logMsg.Clear().SetPrefixMsg("List Recommended Campaign").ToInputLogString());

            _auditLog              = new AuditLogEntity();
            _auditLog.Module       = Constants.Module.Customer;
            _auditLog.Action       = Constants.AuditAction.ExistingLead;
            _auditLog.IpAddress    = ApplicationHelpers.GetClientIP();
            _auditLog.Status       = LogStatus.Success;
            _auditLog.CreateUserId = this.UserInfo.UserId;

            CustomerInfoViewModel custInfoVM = new CustomerInfoViewModel();

            if (TempData["CustomerInfo"] != null)
            {
                custInfoVM = (CustomerInfoViewModel)TempData["CustomerInfo"];
                TempData["CustomerInfo"] = custInfoVM; // keep for change Tab
            }
            else
            {
                return(RedirectToAction("Search", "Customer"));
            }

            try
            {
                ExistingLeadViewModel existingLeadVM = new ExistingLeadViewModel();
                if (custInfoVM.CustomerId != null)
                {
                    existingLeadVM.CustomerInfo = custInfoVM;
                }

                return(View(existingLeadVM));
            }
            catch (Exception ex)
            {
                Logger.Error("Exception occur:\n", ex);
                Logger.Info(_logMsg.Clear().SetPrefixMsg("List Recommended Campaign").Add("Error Message", ex.Message).ToFailLogString());
                return(Error(new HandleErrorInfo(ex, this.ControllerContext.RouteData.Values["controller"].ToString(),
                                                 this.ControllerContext.RouteData.Values["action"].ToString())));
            }
        }
コード例 #3
0
ファイル: ExistingLeadController.cs プロジェクト: KKPBank/CSM
        public ActionResult ExistingLeadList()
        {
            CustomerInfoViewModel custInfoVM = new CustomerInfoViewModel();

            if (TempData["CustomerInfo"] != null)
            {
                custInfoVM = (CustomerInfoViewModel)TempData["CustomerInfo"];
                TempData["CustomerInfo"] = custInfoVM; // Keep for change Tab
            }
            else
            {
                return(RedirectToAction("Search", "Customer"));
            }

            Logger.Info(_logMsg.Clear().SetPrefixMsg("Get ExistingLead List").Add("CardNo", custInfoVM.CardNo.MaskCardNo()).ToInputLogString());

            _auditLog              = new AuditLogEntity();
            _auditLog.Module       = Constants.Module.Customer;
            _auditLog.Action       = Constants.AuditAction.ExistingLead;
            _auditLog.IpAddress    = ApplicationHelpers.GetClientIP();
            _auditLog.Status       = LogStatus.Success;
            _auditLog.CreateUserId = this.UserInfo.UserId;

            try
            {
                if (ModelState.IsValid)
                {
                    _customerFacade = new CustomerFacade();
                    ExistingLeadViewModel existingLeadVM = new ExistingLeadViewModel();

                    if (!string.IsNullOrWhiteSpace(custInfoVM.CardNo))
                    {
                        existingLeadVM.Ticket = _customerFacade.GetLeadList(_auditLog, custInfoVM.CardNo);
                    }

                    Logger.Info(_logMsg.Clear().SetPrefixMsg("Get ExistingLead List").ToSuccessLogString());
                    return(PartialView("~/Views/ExistingLead/_ExistingLeadList.cshtml", existingLeadVM));
                }

                return(Json(new
                {
                    Valid = false,
                    Error = string.Empty,
                    Errors = GetModelValidationErrors()
                }));
            }
            catch (CustomException cex)
            {
                Logger.Info(_logMsg.Clear().SetPrefixMsg("Get ExistingLead List").Add("Error Message", cex.Message).ToFailLogString());
                return(Json(new
                {
                    Valid = false,
                    Error = cex.Message
                }));
            }
            catch (Exception ex)
            {
                Logger.Error("Exception occur:\n", ex);
                Logger.Info(_logMsg.Clear().SetPrefixMsg("Get ExistingLead List").Add("Error Message", ex.Message).ToFailLogString());
                return(Error(new HandleErrorInfo(ex, this.ControllerContext.RouteData.Values["controller"].ToString(),
                                                 this.ControllerContext.RouteData.Values["action"].ToString())));
            }
        }
コード例 #4
0
ファイル: ExistingLeadController.cs プロジェクト: KKPBank/CSM
        public ActionResult ExistingLeadList(int?customerId)
        {
            Logger.Info(_logMsg.Clear().SetPrefixMsg("Get ExistingLead List").Add("CustomerId", customerId).ToInputLogString());

            if (customerId == null)
            {
                return(Json(new
                {
                    Valid = false,
                    RedirectUrl = Url.Action("Search", "Customer")
                }));
            }

            try
            {
                if (ModelState.IsValid)
                {
                    _customerFacade = new CustomerFacade();
                    ExistingLeadViewModel existingLeadVM = new ExistingLeadViewModel();
                    CustomerInfoViewModel custInfoVM     = this.MappingCustomerInfoView(customerId.Value);

                    if (!string.IsNullOrWhiteSpace(custInfoVM.CardNo))
                    {
                        _auditLog              = new AuditLogEntity();
                        _auditLog.Module       = Constants.Module.Customer;
                        _auditLog.Action       = Constants.AuditAction.ExistingLead;
                        _auditLog.IpAddress    = ApplicationHelpers.GetClientIP();
                        _auditLog.CreateUserId = this.UserInfo.UserId;

                        existingLeadVM.Ticket = _customerFacade.GetLeadList(_auditLog, custInfoVM.CardNo);
                    }

                    existingLeadVM.CustomerInfo = custInfoVM;

                    _commonFacade          = new CommonFacade();
                    ViewBag.SLMUrlNewLead  = _commonFacade.GetSLMUrlNewLead();
                    ViewBag.SLMUrlViewLead = _commonFacade.GetSLMUrlViewLead();
                    //                    ViewBag.SLMEncryptPassword = _commonFacade.GetSLMEncryptPassword();
                    ViewBag.SLMEncryptPassword = WebConfig.GetSLMEncryptPassword();

                    if (!string.IsNullOrEmpty(UserInfo.Username))
                    {
                        ViewBag.Username = UserInfo.Username.ToLower();
                    }

                    Logger.Info(_logMsg.Clear().SetPrefixMsg("Get ExistingLead List").ToSuccessLogString());
                    return(PartialView("~/Views/ExistingLead/_ExistingLeadList.cshtml", existingLeadVM));
                }

                return(Json(new
                {
                    Valid = false,
                    Error = string.Empty,
                    Errors = GetModelValidationErrors()
                }));
            }
            catch (CustomException cex)
            {
                Logger.Info(_logMsg.Clear().SetPrefixMsg("Get ExistingLead List").Add("Error Message", cex.Message).ToFailLogString());
                return(Json(new
                {
                    Valid = false,
                    Error = cex.Message
                }));
            }
            catch (Exception ex)
            {
                Logger.Error("Exception occur:\n", ex);
                Logger.Info(_logMsg.Clear().SetPrefixMsg("Get ExistingLead List").Add("Error Message", ex.Message).ToFailLogString());
                return(Error(new HandleErrorInfo(ex, this.ControllerContext.RouteData.Values["controller"].ToString(),
                                                 this.ControllerContext.RouteData.Values["action"].ToString())));
            }
        }