Esempio n. 1
0
        public ActionResult AuthorizeProfilePageRequest(tbl_System_Requests request)
        {
            var systemRequest = new SystemRequestDataAccess().GetSystemRequest(request.ID);

            if (systemRequest.CreatorID == StateHelper.UserId)
            {
                return(Json(new { IsSuccess = false, ErrorMessage = CustomMessages.SameCreatorAndsAuthorizer }, JsonRequestBehavior.AllowGet));
            }
            if (request.AuthorizationStatus == "A")
            {
                var lstData      = CustomHelper.ParseJson <List <ProfilePageVM> >(systemRequest.UpdatedData);
                var profilePages = lstData.Select(e => new tbl_Profile_Page
                {
                    ProfileID = e.ProfileID,
                    PageID    = e.PageID
                }).ToList();

                ProfileMethods.AddProfilePages(profilePages);
            }

            systemRequest.AuthorizationStatus   = request.AuthorizationStatus;
            systemRequest.AuthorizationComments = request.AuthorizationComments;
            systemRequest.AuthorizerID          = StateHelper.UserId;

            var success = new SystemRequestDataAccess().UpdateSystemRequest(systemRequest);

            return(Json(new { IsSuccess = success, ErrorMessage = (!success) ? CustomMessages.GenericErrorMessage : CustomMessages.AuthorizedSucessfully, Response = success }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
        public ActionResult FilterAuthorizeAccountTypeScreen(FilterAccountTypeVM request, string RequestType)
        {
            if (RequestType == "Add")
            {
                List <AccountTypeVM> viewModel = ReviewMethods.FilterAccountTypeRequestDetails(request, "R");
                return(PartialView("_partialReviewAuthorizeAccountTypeAddView", viewModel));
            }
            else
            {
                //fetch from system requests
                List <tbl_System_Requests> lst = new SystemRequestDataAccess().GetAllSystemRequests("R", Constants.RequestTypes.AccountTypes_SystemRequest);

                List <AccountTypeVM> lstData = new List <AccountTypeVM>();
                for (int i = 0; i < lst.Count; i++)
                {
                    AccountTypeVM item = new AccountTypeVM();
                    item      = CustomHelper.ParseJson <AccountTypeVM>(lst[i].UpdatedData);
                    item.Code = lst[i].ID.ToString();//setting code as ID so it could be used at hyperlink
                    item.AuthorizationComments = lst[i].AuthorizationComments;
                    lstData.Add(item);
                }

                return(PartialView("_partialReviewAuthorizeAccountTypeUpdateView", lstData));
            }
        }
Esempio n. 3
0
        // GET: User Profile [Use to assign profile to user]
        public ActionResult UserProfile(int?Id)
        {
            var viewModel = new ProfileDataAccess().GetAllProfiles("A");

            if (Id.HasValue)
            {
                var getSystemRequest = new SystemRequestDataAccess().GetSystemRequest(Id.GetValueOrDefault(), "R");
                if (getSystemRequest == null)
                {
                    return(RedirectToAction("UserProfileReview", "SystemReview"));
                }

                ViewBag.SystemRequest = new tbl_System_Requests {
                    ID = Id.GetValueOrDefault()
                };                                                                              //getSystemRequest;
                var profileUser = CustomHelper.ParseJson <List <ProfileUserVM> >(getSystemRequest.UpdatedData);
                var userData    = new UserDataAccess().GetUserById(profileUser.FirstOrDefault()?.UserID ?? 0);

                ViewBag.ProfileUser = profileUser;
                ViewBag.UserID      = userData.UserLogin;
            }
            var users = new UserDataAccess().GetUsers("A");

            ViewBag.Users = users;
            return(View(viewModel));
        }
Esempio n. 4
0
        public ActionResult FilterAuthorizeCardChargesScreen(FilterAccountTypeVM request, string RequestType)
        {
            if (RequestType == "Add")
            {
                List <CardChargesVM> viewModel = ReviewMethods.FilterCardChargesRequestDetails(request, "R");
                return(PartialView("_partialReviewAuthorizeCardChargesAddView", viewModel));
            }
            else
            {
                //fetch from system requests
                List <tbl_System_Requests> lst = new SystemRequestDataAccess().GetAllSystemRequests("R", Constants.RequestTypes.CardCharges_SystemRequest);

                List <CardChargesVM> lstData = new List <CardChargesVM>();
                for (int i = 0; i < lst.Count; i++)
                {
                    CardChargesVM item = new CardChargesVM();
                    item = CustomHelper.ParseJson <CardChargesVM>(lst[i].UpdatedData);
                    var cardChargesData = new CardChargesDataAccess().GetCardChargeDetailsById(item.ID);
                    item.Title                 = lst[i].ID.ToString();//setting title as ID so it could be used at hyperlink
                    item.AccountTypeName       = cardChargesData.tbl_Account_Types.Name;
                    item.CardTypeName          = cardChargesData.tbl_Card_Types.Title;
                    item.AuthorizationComments = lst[i].AuthorizationComments;
                    lstData.Add(item);
                }

                return(PartialView("_partialReviewAuthorizeCardChargesUpdateView", lstData));
            }
        }
Esempio n. 5
0
        public ActionResult AuthorizeExistingUser(int?Id)
        {
            var viewModel = new SystemRequestDataAccess().GetSystemRequest(Id.GetValueOrDefault());

            ViewBag.UserDetails = CustomHelper.ParseJson <UserVM>(viewModel.UpdatedData);
            if (viewModel.AuthorizationStatus != "P")
            {
                return(RedirectToAction("AuthorizeUser"));
            }

            return(View(viewModel));
        }
Esempio n. 6
0
        public ActionResult AuthorizeExistingProfile(int?Id)
        {
            var viewModel = new SystemRequestDataAccess().GetSystemRequest(Id.GetValueOrDefault(), "P");

            if (viewModel == null)
            {
                return(RedirectToAction("AuthorizeProfile", "SystemAuthorization"));
            }

            ViewBag.ProfileData = viewModel.UpdatedData == null ? null : CustomHelper.ParseJson <tbl_Profile>(viewModel.UpdatedData);

            return(View(viewModel));
        }
Esempio n. 7
0
        public ActionResult AuthorizeProfilePage(int?Id)
        {
            var viewModel = new SystemRequestDataAccess().GetSystemRequest(Id.GetValueOrDefault(), "P");

            if (viewModel == null)
            {
                return(RedirectToAction("AuthorizeProfile", "SystemAuthorization"));
            }

            var lstData = CustomHelper.ParseJson <List <ProfilePageVM> >(viewModel.UpdatedData);

            ViewBag.ProfilePermissions = lstData;
            ViewBag.ProfileId          = new UserDataAccess().GetUserById(lstData.FirstOrDefault().ProfileID.GetValueOrDefault());

            return(View(viewModel));
        }
Esempio n. 8
0
        public ActionResult UpdateUserProfile(int?Id)
        {
            var viewModel = new tbl_System_Requests();
            var result    = new UserDataAccess().GetAllUsersForAdmin();

            ViewBag.GetAllUsers = result ?? new List <tbl_Users>();
            if (Id.HasValue)
            {
                viewModel = new SystemRequestDataAccess().GetSystemRequest(Id.GetValueOrDefault(), "R");
                if (viewModel == null)
                {
                    return(RedirectToAction("DashboardView", "Base"));
                }

                ViewBag.UserDetails = CustomHelper.ParseJson <tbl_Users>(viewModel.UpdatedData);
            }
            return(View(viewModel));
        }
Esempio n. 9
0
        // GET: Update Profile [Use to edit/update profile]
        public ActionResult UpdateProfile(int?Id)
        {
            var systemRequest = new tbl_System_Requests();

            if (Id.HasValue)
            {
                systemRequest = new SystemRequestDataAccess().GetSystemRequest(Id.GetValueOrDefault(), "R");
                if (systemRequest == null)
                {
                    return(RedirectToAction("DashboardView", "Base"));
                }

                ViewBag.ProfileDetails = CustomHelper.ParseJson <tbl_Profile>(systemRequest.UpdatedData);
            }

            ViewBag.SystemRequest = systemRequest;
            var viewModel = new ProfileDataAccess().GetAllProfiles("A");

            return(View(viewModel));
        }
Esempio n. 10
0
        public ActionResult AuthorizeExistingProfileRequest(tbl_System_Requests request)
        {
            var systemRequest = new SystemRequestDataAccess().GetSystemRequest(request.ID);

            if (systemRequest.CreatorID == StateHelper.UserId)
            {
                return(Json(new { IsSuccess = false, ErrorMessage = CustomMessages.SameCreatorAndsAuthorizer }, JsonRequestBehavior.AllowGet));
            }
            if (request.AuthorizationStatus == "A")
            {
                var lstData = CustomHelper.ParseJson <tbl_Profile>(systemRequest.UpdatedData);
                new ProfileDataAccess().UpdateProfile(lstData);
            }

            systemRequest.AuthorizationStatus   = request.AuthorizationStatus;
            systemRequest.AuthorizationComments = request.AuthorizationComments;
            systemRequest.AuthorizerID          = StateHelper.UserId;

            var success = new SystemRequestDataAccess().UpdateSystemRequest(systemRequest);

            return(Json(new { IsSuccess = success, ErrorMessage = (!success) ? CustomMessages.GenericErrorMessage : CustomMessages.AuthorizedSucessfully, Response = success }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 11
0
        // GET: Profile Pages [Use to assign pages to profile]
        public ActionResult ProfilePages(int?Id)
        {
            var viewModel = ProfileMethods.GetAllPages();

            if (Id.HasValue)
            {
                var getSystemRequest = new SystemRequestDataAccess().GetSystemRequest(Id.GetValueOrDefault(), "R");
                if (getSystemRequest == null)
                {
                    return(RedirectToAction("PageProfileReview", "SystemReview"));
                }

                ViewBag.SystemRequest = new tbl_System_Requests {
                    ID = Id.GetValueOrDefault()
                };                                                                              //getSystemRequest;
                var pageProfile = CustomHelper.ParseJson <List <ProfilePageVM> >(getSystemRequest.UpdatedData);

                ViewBag.PageProfile = pageProfile;
            }

            ViewBag.Profiles = new ProfileDataAccess().GetAllProfiles("A");
            return(View(viewModel));
        }
Esempio n. 12
0
        public ActionResult AuthorizeExistingUserRequest(tbl_System_Requests request)
        {
            var systemRequest = new SystemRequestDataAccess().GetSystemRequest(request.ID);

            if (systemRequest.CreatorID == StateHelper.UserId)
            {
                return(Json(new { IsSuccess = false, ErrorMessage = CustomMessages.SameCreatorAndsAuthorizer }, JsonRequestBehavior.AllowGet));
            }
            if (request.AuthorizationStatus == "A")
            {
                var data = CustomHelper.ParseJson <UserVM>(systemRequest.UpdatedData);
                var user = new tbl_Users
                {
                    ID                    = data.ID,
                    IsActive              = data.IsActive,
                    RoleTitle             = data.RoleTitle,
                    UserLogin             = data.UserLogin,
                    UserName              = data.UserName,
                    UserPassword          = data.UserPassword,
                    AuthorizationStatus   = data.AuthorizationStatus,
                    AuthorizationComments = data.AuthorizationComments,
                    ExpiryDate            = data.ExpiryDate,
                    EmpCode               = data.EmpCode
                };

                new UserDataAccess().UpdateUser(user);
            }

            systemRequest.AuthorizationStatus   = request.AuthorizationStatus;
            systemRequest.AuthorizationComments = request.AuthorizationComments;
            systemRequest.AuthorizerID          = StateHelper.UserId;

            var success = new SystemRequestDataAccess().UpdateSystemRequest(systemRequest);

            return(Json(new { IsSuccess = success, ErrorMessage = (!success) ? CustomMessages.GenericErrorMessage : CustomMessages.AuthorizedSucessfully, Response = success }, JsonRequestBehavior.AllowGet));
        }
Esempio n. 13
0
        // GET: AddUpdateAccountTypes
        public ActionResult AddUpdateAccountTypeForUpdateRequest(int?Id)
        {
            AccountTypeVM viewModel = new AccountTypeVM();

            ViewBag.RequestId = Id ?? 0;

            if (Id.HasValue)
            {
                var getSystemRequest = new SystemRequestDataAccess().GetSystemRequest(Id.GetValueOrDefault(), "R");
                viewModel            = getSystemRequest == null ? null : CustomHelper.ParseJson <AccountTypeVM>(getSystemRequest.UpdatedData);
                ViewBag.AccountTypes = new AccountTypeDataAccess().GetAccountTypesActiveInActive("A");
                if (Id.GetValueOrDefault() > 0 && viewModel == null)
                {
                    return(RedirectToAction("ReviewAccountTypeScreen", "Review"));
                }
            }
            else
            {
                ViewBag.AccountTypes = new AccountTypeDataAccess().GetAccountTypesActiveInActive("A");
            }

            ViewBag.RequestType = "Update";
            return(View("AddUpdateAccountType", viewModel));
        }
Esempio n. 14
0
        public ActionResult AddUpdateCardChargesForUpdateRequest(int?Id)
        {
            CardChargesVM viewModel = new CardChargesVM();

            ViewBag.RequestId = Id ?? 0;

            ViewBag.AccountTypes = new AccountTypeDataAccess().GetAccountTypes("A");
            ViewBag.CardTypes    = new CardTypesDataAccess().GetCardTypes("A");
            ViewBag.CardCharges  = new CardChargesDataAccess().GetCardChargesActiveInactive("A");

            if (Id.HasValue)
            {
                var getSystemRequest = new SystemRequestDataAccess().GetSystemRequest(Id.GetValueOrDefault(), "R");
                viewModel = getSystemRequest == null ? null : CustomHelper.ParseJson <CardChargesVM>(getSystemRequest.UpdatedData);
                if (Id.GetValueOrDefault() > 0 && viewModel == null)
                {
                    return(RedirectToAction("ReviewCardChargesScreen", "Review"));
                }
            }

            ViewBag.Regions     = new RegionDataAccess().GetAllRegions();
            ViewBag.RequestType = "Update";
            return(View("AddUpdateCardCharges", viewModel));
        }