Beispiel #1
0
        public object Save([FromBody] CustomerRequest model)
        {
            try
            {
                if (model.ReqDate != null)
                {
                    switch (model.Status)
                    {
                    case "C":
                        customerReqLogService.updateRequestLog(model);
                        break;

                    case "P":
                        customerReqLogService.updateRequestLog(model);
                        break;

                    case "O":
                        customerReqLogService.updateRequestLog(model);
                        break;

                    case "Y":
                        customerReqLogService.deleteRequestLog(model);
                        model.CheckedBy = model.HandledBy;
                        customerRequestService.Add(model);
                        break;

                    default:
                        break;
                    }
                }
                else
                {
                    CustomerReqLog reqModel = new CustomerReqLog()
                    {
                        ReqDate   = DateTime.Now,
                        CheckedBy = model.CheckedBy,
                        Mphone    = model.Mphone,
                        Remarks   = model.Remarks,
                        Status    = model.Status,
                        Request   = model.Request,
                        Gid       = Guid.NewGuid().ToString()
                    };
                    AuditTrail auditTrail = new AuditTrail();
                    auditTrail.Who                = model.CheckedBy;
                    auditTrail.WhatActionId       = 3;
                    auditTrail.WhichParentMenuId  = 2;
                    auditTrail.WhichMenu          = "Client Profile";
                    auditTrail.WhichId            = model.Mphone;
                    auditTrail.Response           = "Success! Request Generated Successfully";
                    auditTrail.InputFeildAndValue = auditTrailService.GetAuditTrialFeildBySingleObject(model);
                    auditTrailService.InsertIntoAuditTrail(auditTrail);
                    return(customerReqLogService.Add(reqModel));
                }
                return(model);
            }
            catch (Exception ex)
            {
                return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
            }
        }
Beispiel #2
0
 public object GetFeatureWorklist()
 {
     try
     {
         return(featureService.GetAll(new Feature()));
     }
     catch (Exception ex)
     {
         return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
     }
 }
Beispiel #3
0
 public async Task <object> GetDataForDashboard()
 {
     try
     {
         return(await dashboardService.GetDataForDashboard());
     }
     catch (Exception ex)
     {
         return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().DeclaringType.Name, Request.Headers["UserInfo"].ToString()));
     }
 }
 public object GetAllClusters()
 {
     try
     {
         return(_service.GetAllClusters());
     }
     catch (Exception ex)
     {
         return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
     }
 }
 public object GetFeatureCategoryListForDDL()
 {
     try
     {
         return(featureCategoryService.GetDropdownList("Name", "Id", new FeatureCategory()));
     }
     catch (Exception ex)
     {
         return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
     }
 }
 public object GetCashEntryListByBranchCode(string branchCode, bool isRegistrationPermitted, double transAmtLimit)
 {
     try
     {
         return(_distributorDepositService.GetCashEntryListByBranchCode(branchCode, isRegistrationPermitted, transAmtLimit));
     }
     catch (Exception ex)
     {
         return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
     }
 }
 public object GetChartOfAccountsList()
 {
     try
     {
         return(glCoaService.GetAll(new MFS.TransactionService.Models.GlCoa()));
     }
     catch (Exception ex)
     {
         return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
     }
 }
 public object GetBankBranchListForDDL()
 {
     try
     {
         return(bankBranchService.GetBankBranchDropdownList());
     }
     catch (Exception ex)
     {
         return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
     }
 }
 public object InsertIntoAuditTrail([FromBody] AuditTrail model)
 {
     try
     {
         return(auditTrailService.InsertIntoAuditTrail(model));
     }
     catch (Exception ex)
     {
         errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString());
         return(StatusCode(StatusCodes.Status401Unauthorized));
     }
 }
        public object GetPermissionWorklist(int roleId = 1)
        {
            try
            {
                IEnumerable <Feature>             featureList    = featureService.GetAll(new Feature());
                IEnumerable <PermissionViewModel> permissionList = permissionService.GetPermissionWorklist(roleId);

                List <PermissionViewModel> permissionWorklist = new List <PermissionViewModel>();
                PermissionViewModel        permissionObj      = new PermissionViewModel();

                foreach (Feature f in featureList)
                {
                    var item = permissionList.FirstOrDefault(i => i.FeatureId == f.Id);

                    if (item != null)
                    {
                        permissionObj.IsAddPermitted          = item.IsAddPermitted;
                        permissionObj.IsDeletePermitted       = item.IsDeletePermitted;
                        permissionObj.IsEditPermitted         = item.IsEditPermitted;
                        permissionObj.IsRegistrationPermitted = item.IsRegistrationPermitted;
                        permissionObj.IsSecuredviewPermitted  = item.IsSecuredviewPermitted;
                        permissionObj.IsViewPermitted         = item.IsViewPermitted;

                        permissionObj.RoleId      = roleId;
                        permissionObj.FeatureId   = f.Id;
                        permissionObj.FeatureName = f.Alias;
                        permissionObj.Id          = item.Id;

                        permissionWorklist.Add(permissionObj);
                    }
                    else
                    {
                        permissionObj.RoleId      = roleId;
                        permissionObj.FeatureId   = f.Id;
                        permissionObj.FeatureName = f.Alias;

                        permissionWorklist.Add(permissionObj);
                    }

                    permissionObj = new PermissionViewModel();
                }

                return(permissionWorklist);
            }
            catch (Exception ex)
            {
                return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
            }
        }
Beispiel #11
0
 public object GetRateConfigList(string param = "U")
 {
     try
     {
         var list = rateConfigService.GetRateConfigMasterList();
         if (param == "All")
         {
             return(list);
         }
         else
         {
             return(param == null?list.Where(s => s.Gateway == "U") : list.Where(s => s.Gateway == param));
         }
     }
     catch (Exception ex)
     {
         return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
     }
 }
 public object SaveEnterPrise(bool isEdit, string evnt, [FromBody] Reginfo aReginfo)
 {
     try
     {
         return(enterpriseService.Save(aReginfo, isEdit, evnt));
     }
     catch (Exception ex)
     {
         return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
     }
 }
 public object GetTransactionDetailList(string transactionNumber = "")
 {
     try
     {
         return(transDetailService.GetTransactionDetailList(transactionNumber));
     }
     catch (Exception ex)
     {
         return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
     }
 }
        public object GetOutboxList(string fromDate = null, string toDate = null, string mphone = null, bool?forMessageResend = true)
        {
            try
            {
                DateRangeModel date = new DateRangeModel();
                if (string.IsNullOrEmpty(fromDate) || string.IsNullOrEmpty(toDate) || string.IsNullOrEmpty(mphone))
                {
                    return(new List <string>());
                }
                date.FromDateNullable = string.IsNullOrEmpty(fromDate) == true ? DateTime.Now : DateTime.Parse(fromDate);
                date.ToDateNullable   = string.IsNullOrEmpty(toDate) == true ? DateTime.Now : DateTime.Parse(toDate);
                CLoseReginfo cLoseReginfo = new CLoseReginfo();
                cLoseReginfo = kycService.GetCloseInfoByMphone(mphone);
                if (cLoseReginfo.MphoneOld != null)
                {
                    if (date.ToDateNullable > cLoseReginfo.CloseDate)
                    {
                        date.ToDateNullable = cLoseReginfo.CloseDate;
                    }
                    mphone = cLoseReginfo.MphoneOld;
                }
                if (date.FromDateNullable < cLoseReginfo.Regdate)
                {
                    date.FromDateNullable = cLoseReginfo.Regdate;
                }
                var result = outboxService.GetOutboxList(date.FromDateNullable, date.ToDateNullable, mphone);

                if (forMessageResend == true)
                {
                    return(result.Where(s => s.MsgChannel == "SMS").ToList());
                }
                else
                {
                    return(result.Where(s => s.MsgChannel == "USSD").ToList());
                }
            }
            catch (Exception ex)
            {
                return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
            }
        }
Beispiel #15
0
        public object Login([FromBody] LoginModel model)
        {
            try
            {
                AuthUserModel obj = usersService.login(model);
                if (obj.IsAuthenticated && obj.User.LogInStatus == "N")
                {
                    obj.IsAuthenticated = false;
                }
                if (obj.IsAuthenticated && obj.User.Pstatus == "L")
                {
                    obj.IsAuthenticated = false;
                }

                if (obj.IsAuthenticated)
                {
                    obj.BearerToken = CreateJwtToken(obj);
                    return(StatusCode(StatusCodes.Status200OK, obj));
                }
                else
                {
                    return(StatusCode(StatusCodes.Status200OK, obj));
                }
            }
            catch (Exception ex)
            {
                errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString());
                return(StatusCode(StatusCodes.Status401Unauthorized));;
            }
        }
Beispiel #16
0
        public object SendVeriCodeToEmail(string toEmailId)
        {
            try
            {
                Email objEmail = new Email();
                objEmail.EMAIL    = toEmailId;
                objEmail.TEMPLETE = "1";
                //objEmail.DATA1 = "Email verification code";

                StringBuilderService stringBuilderService = new StringBuilderService();
                int    randromNumber = stringBuilderService.RandomNumber(1000, 9999);
                string md5Password   = stringBuilderService.GenerateMD5Hash(randromNumber.ToString());
                objEmail.DATA1 = randromNumber.ToString();
                //objEmail.DATA2 = "Your email verification code: " + randromNumber.ToString();
                emailService.SendVeriCodeToEmail(objEmail);
                return(md5Password);
            }
            catch (Exception ex)
            {
                return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
            }
        }
 public object GetFeaturePayDetails(int featureId)
 {
     try
     {
         return(_BillCollectionCommonService.GetFeaturePayDetails(featureId));
     }
     catch (Exception ex)
     {
         return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
     }
 }
        public object GetTransactionMasterList(string fromDate = null, string toDate = null, string mPhone = null)
        {
            try
            {
                DateRangeModel date = new DateRangeModel();
                date.FromDateNullable = string.IsNullOrEmpty(fromDate) == true ? DateTime.Now : DateTime.Parse(fromDate);
                date.ToDateNullable   = string.IsNullOrEmpty(toDate) == true ? DateTime.Now : DateTime.Parse(toDate);
                if (string.IsNullOrEmpty(mPhone))
                {
                    return(transMastService.GetTransactionList(mPhone, date.FromDateNullable, date.ToDateNullable));
                }
                else
                {
                    CLoseReginfo cLoseReginfo = new CLoseReginfo();
                    cLoseReginfo = kycService.GetCloseInfoByMphone(mPhone);
                    if (cLoseReginfo.MphoneOld != null)
                    {
                        if (date.ToDateNullable > cLoseReginfo.CloseDate)
                        {
                            date.ToDateNullable = cLoseReginfo.CloseDate;
                        }
                        mPhone = cLoseReginfo.MphoneOld;
                    }
                    if (date.FromDateNullable < cLoseReginfo.Regdate)
                    {
                        date.FromDateNullable = cLoseReginfo.Regdate;
                    }

                    return(transMastService.GetTransactionList(mPhone, date.FromDateNullable, date.ToDateNullable));
                }
            }
            catch (Exception ex)
            {
                return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
            }
        }
Beispiel #19
0
        public object SaveAgent(bool isEditMode, string evnt, [FromBody] Reginfo regInfo)
        {
            try
            {
                if (isEditMode != true)
                {
                    int fourDigitRandomNo = new Random().Next(1000, 9999);
                    try
                    {
                        if (string.IsNullOrEmpty(regInfo.Pmphone))
                        {
                            return(HttpStatusCode.BadRequest);
                        }
                        regInfo.CatId      = "A";
                        regInfo.PinStatus  = "N";
                        regInfo.AcTypeCode = 1;
                        regInfo.RegSource  = "P";
                        //regInfo.RegDate = regInfo.RegDate + DateTime.Now.TimeOfDay;
                        regInfo.RegDate   = System.DateTime.Now;
                        regInfo.EntryDate = System.DateTime.Now;
                        _service.Add(regInfo);
                        _kycService.InsertModelToAuditTrail(regInfo, regInfo.EntryBy, 3, 3, "Agent", regInfo.Mphone, "Save successfully");
                        return(HttpStatusCode.OK);
                    }
                    catch (Exception ex)
                    {
                        return(HttpStatusCode.BadRequest);
                    }
                }
                else
                {
                    if (evnt == "edit")
                    {
                        regInfo.UpdateDate = System.DateTime.Now;
                        Reginfo aReginfo  = _kycService.NullifyReginfoForKycUpdate(regInfo);
                        var     prevModel = _kycService.GetRegInfoByMphone(aReginfo.Mphone);
                        _service.UpdateRegInfo(aReginfo);
                        var currentModel = _kycService.GetRegInfoByMphone(aReginfo.Mphone);
                        _kycService.InsertUpdatedModelToAuditTrail(currentModel, prevModel, regInfo.UpdateBy, 3, 4, "Agent", regInfo.Mphone, "Update successfully");
                        return(HttpStatusCode.OK);
                    }

                    else
                    {
                        var checkStatus = _kycService.CheckPinStatus(regInfo.Mphone);
                        if (checkStatus.ToString() != "P")
                        {
                            if (string.IsNullOrEmpty(regInfo.AuthoBy))
                            {
                                return(HttpStatusCode.Unauthorized);
                            }
                            int fourDigitRandomNo = new Random().Next(1000, 9999);
                            regInfo.RegStatus = "P";
                            regInfo.AuthoDate = System.DateTime.Now;
                            var prevModel = _kycService.GetRegInfoByMphone(regInfo.Mphone);
                            _service.UpdateRegInfo(regInfo);
                            _dsrService.UpdatePinNo(regInfo.Mphone, fourDigitRandomNo.ToString());
                            var currentModel = _kycService.GetRegInfoByMphone(regInfo.Mphone);
                            _kycService.InsertUpdatedModelToAuditTrail(currentModel, prevModel, regInfo.AuthoBy, 3, 4, "Agent", regInfo.Mphone, "Register successfully");
                            MessageService service = new MessageService();
                            service.SendMessage(new MessageModel()
                            {
                                Mphone      = regInfo.Mphone,
                                MessageId   = "999",
                                MessageBody = "Congratulations! Your OK wallet has been opened successfully." + " Your Pin is "
                                              + fourDigitRandomNo.ToString() + ", please change PIN to activate your account, "
                            });

                            return(HttpStatusCode.OK);
                        }
                        else
                        {
                            return(HttpStatusCode.OK);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString());
                return(HttpStatusCode.BadRequest);
            }
        }
 public object GetMappedAccountInfoByMphone(string mphone)
 {
     try
     {
         return(_service.GetMappedAccountInfoByMphone(mphone));
     }
     catch (Exception ex)
     {
         return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
     }
 }
Beispiel #21
0
 public object GetAllDisbursementUserList(string roleName = null)
 {
     try
     {
         //return disbursementUserService.GetAll(new DisbursementUser());
         return(disbursementUserService.GetAllDisbursementUserList(roleName));
     }
     catch (Exception ex)
     {
         return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
     }
 }
Beispiel #22
0
 public async Task <object> GetRegInfoListByCatIdBranchCode(string branchCode, string catId, string filterId, string status = "L")
 {
     try
     {
         if (filterId == "O")
         {
             var userCode = kycService.GetUserBranchCodeByUserId(Request.Headers["UserInfo"].ToString());
             if (userCode.ToString() == "0000")
             {
                 return(await kycService.GetRegInfoListByOthersBranchCode(branchCode, catId, status, filterId));
             }
             else
             {
                 return(new List <dynamic>());
             }
         }
         else
         {
             return(kycService.GetRegInfoListByCatIdBranchCode(branchCode, catId, status, filterId));
         }
     }
     catch (Exception e)
     {
         return(errorLogService.InsertToErrorLog(e, MethodBase.GetCurrentMethod().DeclaringType.Name, Request.Headers["UserInfo"].ToString()));
     }
 }
Beispiel #23
0
 public object GetDisbursementCompanyList()
 {
     try
     {
         return(_disbursementService.GetDisbursementCompanyList());
     }
     catch (Exception ex)
     {
         return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
     }
 }
Beispiel #24
0
 public object GetDistributorList()
 {
     try
     {
         return(_distributorService.GetAll(new Reginfo()));
     }
     catch (Exception ex)
     {
         return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
     }
 }
Beispiel #25
0
 public object GetMerchantList(string filterId)
 {
     try
     {
         return(_MerchantService.GetMerchantList(filterId));
     }
     catch (Exception ex)
     {
         return(errorLogService.InsertToErrorLog(ex, MethodBase.GetCurrentMethod().Name, Request.Headers["UserInfo"].ToString()));
     }
 }