Exemple #1
0
        public JsonResult SearchCardDetail(string CardNo)
        {
            CardTypesDataAccess      obj = new CardTypesDataAccess();
            List <CustomerAccountVM> lst = new List <CustomerAccountVM>();

            NewCISSB.SONFETCHCARDINFOTypeGSONFETCHCARDINFODetailTypeMSONFETCHCARDINFODetailType resp = new NewCISSB.SONFETCHCARDINFOTypeGSONFETCHCARDINFODetailTypeMSONFETCHCARDINFODetailType();

            lst = CardReportMethods.GetCustomerAccount(CardNo);

            if (lst.Count <= 0)
            {
                return(Json(new { Result = lst, ErrorMessage = CustomMessages.CardNotExists }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                var request = new RequestDataAccess().GetRequest(CardNo, lst.FirstOrDefault()?.AccountNo ?? string.Empty, lst.FirstOrDefault()?.CIF ?? string.Empty);

                var requestdata = new RequestVM
                {
                    ID          = request?.ID ?? 0,
                    RequestType = request?.RequestType ?? string.Empty,
                    Waive       = request != null?request.WaiveCharges.GetValueOrDefault() : false
                };

                var userlog    = new UserLogDataAccess().GetUserLogByEntityId(request?.ID ?? 0, "tbl_Requests");
                var creator    = userlog.Where(e => e.EventName == "i").FirstOrDefault()?.tbl_Users?.UserName ?? string.Empty;
                var authorizer = userlog.Where(e => e.EventName == "A").OrderByDescending(e => e.ID).FirstOrDefault()?.tbl_Users?.UserName ?? string.Empty;

                try
                {
                    resp = T24Methods.FetchAccount(lst.FirstOrDefault()?.AccountNo ?? string.Empty, lst.FirstOrDefault()?.CIF ?? string.Empty);
                }
                catch { resp = new NewCISSB.SONFETCHCARDINFOTypeGSONFETCHCARDINFODetailTypeMSONFETCHCARDINFODetailType(); }

                //var CardIssuance = lst.FirstOrDefault().CardIssuance.ToString();
                //var CardExpiry = lst.FirstOrDefault().CardExpiry.ToString();
                //var DOB = lst.FirstOrDefault().DateofBirth.ToString();
                var CardTypes = obj.GetCardTypes("A");
                CardTypes = (CardTypes.Where(s => s.ID == (lst.FirstOrDefault()?.CardTypeID ?? 0))).ToList();
                var CardType = (CardTypes.Count > 0) ? CardTypes[0].Title : string.Empty;
                List <CustomerAccountVM> DelinkInfo = new List <CustomerAccountVM>();
                //DelinkInfo = CommonMethods.GetAccountInfo(CardNo, lst.FirstOrDefault()?.AccountNo ?? "0");
                var DelinkInfoStr = CommonMethods.GetLinkedAccounts(CardNo, lst.FirstOrDefault()?.AccountNo ?? "0");

                var Product = new AccountTypeDataAccess().GetAccountTypeById(lst.FirstOrDefault().AccountTypeID ?? 0)?.Name ?? string.Empty;
                return(Json(new { Result = lst, /*CardIssuance=CardIssuance, CardExpiry= CardExpiry,DOB=DOB,*/ DelinkInfoStr = DelinkInfoStr, CardType = CardType, Product = Product, Request = requestdata, AccountResponse = resp, Creator = creator, Authorizer = authorizer, ErrorMessage = CustomMessages.Success }, JsonRequestBehavior.AllowGet));
            }
        }
Exemple #2
0
        public ActionResult AuthorizeNewUserRequest(tbl_Users request)
        {
            var user = new UserDataAccess().GetUserById(request.ID);
            var log  = new UserLogDataAccess().GetUserLogByEntityId(request.ID, "tbl_Users");

            if (log.FirstOrDefault()?.ActionUserStamp == StateHelper.UserId)
            {
                return(Json(new { IsSuccess = false, ErrorMessage = CustomMessages.SameCreatorAndsAuthorizer }, JsonRequestBehavior.AllowGet));
            }

            user.AuthorizationStatus   = request.AuthorizationStatus;
            user.AuthorizationComments = request.AuthorizationComments;
            var success = new UserDataAccess().UpdateUser(user);

            return(Json(new { IsSuccess = success, ErrorMessage = (!success) ? CustomMessages.GenericErrorMessage : CustomMessages.AuthorizedSucessfully, Response = success }, JsonRequestBehavior.AllowGet));
        }
Exemple #3
0
        public ActionResult PartialExceptionReport(DateTime?startDate, DateTime?endDate)
        {
            var minStartDate = startDate == null ? startDate : CustomHelper.ConvertToMinDate(startDate);
            var maxEndDate   = endDate == null ? endDate : CustomHelper.ConvertToMaxDate(endDate);

            var data      = new UserLogDataAccess().GetExceptionLog("Import", minStartDate, maxEndDate, "M");
            var viewModel = new List <ExceptionLogReportVM>();

            foreach (var item in data.Where(e => !string.IsNullOrEmpty(e.Descp)).ToList())
            {
                var datum = JsonConvert.DeserializeObject <List <ExceptionLogReportVM> >(item.Descp);
                datum.ForEach(e => e.Timestamp = item.ActionTimestamp);
                viewModel.AddRange(datum);
            }

            return(PartialView("_partialExceptionReport", viewModel));
        }