public ActionResult Delete(int id)
        {
            //Get Item From Database
            FormOfPaymentAdviceMessageGroup group = new FormOfPaymentAdviceMessageGroup();

            group = formOfPaymentAdviceMessageGroupRepository.GetGroup(id);

            //Check Exists
            if (group == null || group.DeletedFlag == true)
            {
                ViewData["ActionMethod"] = "DeleteGet";
                return(View("RecordDoesNotExistError"));
            }

            //Check AccessRights
            if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }

            formOfPaymentAdviceMessageGroupRepository.EditGroupForDisplay(group);

            return(View(group));
        }
        // GET: /Edit
        public ActionResult Edit(int id)
        {
            //Get Item From Database
            FormOfPaymentAdviceMessageGroup group = new FormOfPaymentAdviceMessageGroup();

            group = formOfPaymentAdviceMessageGroupRepository.GetGroup(id);

            //Check Exists
            if (group == null)
            {
                ViewData["ActionMethod"] = "EditGet";
                return(View("RecordDoesNotExistError"));
            }
            //Check Access
            HierarchyRepository hierarchyRepository = new HierarchyRepository();

            if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }

            TablesDomainHierarchyLevelRepository tablesDomainHierarchyLevelRepository = new TablesDomainHierarchyLevelRepository();
            SelectList hierarchyTypesList = new SelectList(tablesDomainHierarchyLevelRepository.GetDomainHierarchies(groupName).ToList(), "HierarchyLevelTableName", "HierarchyLevelTableName");

            ViewData["HierarchyTypes"] = hierarchyTypesList;

            formOfPaymentAdviceMessageGroupRepository.EditGroupForDisplay(group);

            return(View(group));
        }
Exemplo n.º 3
0
        // GET: /Edit
        public ActionResult Edit(int id)
        {
            //Get Item
            FormOfPaymentAdviceMessageGroupItem formOfPaymentAdviceMessageGroupItem = new FormOfPaymentAdviceMessageGroupItem();

            formOfPaymentAdviceMessageGroupItem = formOfPaymentAdviceMessageItemRepository.GetItem(id);

            //Check Exists
            if (formOfPaymentAdviceMessageGroupItem == null)
            {
                ViewData["ActionMethod"] = "EditGet";
                return(View("RecordDoesNotExistError"));
            }

            //Check Parent Exists
            FormOfPaymentAdviceMessageGroup formOfPaymentAdviceMessageGroup = new FormOfPaymentAdviceMessageGroup();

            formOfPaymentAdviceMessageGroup = formOfPaymentAdviceMessageGroupRepository.GetGroup(formOfPaymentAdviceMessageGroupItem.FormOfPaymentAdviceMessageGroupID);

            //Check Exists
            if (formOfPaymentAdviceMessageGroup == null)
            {
                ViewData["ActionMethod"] = "CreatePost";
                return(View("RecordDoesNotExistError"));
            }

            //Check AccessRights
            if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }


            FormOfPaymentAdviceMessageGroupItemVM formOfPaymentAdviceMessageGroupItemVM = new FormOfPaymentAdviceMessageGroupItemVM();

            formOfPaymentAdviceMessageGroupItemVM.FormOfPaymentAdviceMessageGroup     = formOfPaymentAdviceMessageGroup;
            formOfPaymentAdviceMessageGroupItemVM.FormOfPaymentAdviceMessageGroupItem = formOfPaymentAdviceMessageGroupItem;

            CountryRepository countryRepository = new CountryRepository();

            formOfPaymentAdviceMessageGroupItemVM.Countries = new SelectList(countryRepository.GetAllCountries().ToList(), "CountryCode", "CountryName", formOfPaymentAdviceMessageGroupItem.CountryCode);

            ProductRepository productRepository = new ProductRepository();

            formOfPaymentAdviceMessageGroupItemVM.Products = new SelectList(productRepository.GetAllProducts().ToList(), "ProductId", "ProductName", formOfPaymentAdviceMessageGroupItem.ProductId);

            TravelIndicatorRepository travelIndicatorRepository = new TravelIndicatorRepository();

            formOfPaymentAdviceMessageGroupItemVM.TravelIndicators = new SelectList(travelIndicatorRepository.GetAllTravelIndicators().OrderBy(x => x.TravelIndicatorDescription).ToList(), "TravelIndicator1", "TravelIndicatorDescription", formOfPaymentAdviceMessageGroupItem.TravelIndicator);

            FormOfPaymentTypeRepository formOfPaymentTypeRepository = new FormOfPaymentTypeRepository();

            formOfPaymentAdviceMessageGroupItemVM.FormOfPaymentTypes = new SelectList(formOfPaymentTypeRepository.GetAllFormOfPaymentTypes().ToList(), "FormOfPaymentTypeId", "FormOfPaymentTypeDescription", formOfPaymentAdviceMessageGroupItem.FormofPaymentTypeID);

            formOfPaymentAdviceMessageItemRepository.EditItemForDisplay(formOfPaymentAdviceMessageGroupItem);

            return(View(formOfPaymentAdviceMessageGroupItemVM));
        }
        //Change the deleted status on an item
        public void UpdateGroupDeletedStatus(FormOfPaymentAdviceMessageGroup group)
        {
            string adminUserGuid = HttpContext.Current.User.Identity.Name.Split(new[] { '|' })[0];

            db.spDesktopDataAdmin_UpdateFormOfPaymentAdviceMessageGroupDeletedStatus_v1(
                group.FormOfPaymentAdviceMessageGroupID,
                group.DeletedFlag,
                adminUserGuid,
                group.VersionNumber
                );
        }
Exemplo n.º 5
0
        public ActionResult Create(FormOfPaymentAdviceMessageGroupItemVM formOfPaymentAdviceMessageGroupItemVM)
        {
            //Get FormOfPaymentAdviceMessageGroup
            FormOfPaymentAdviceMessageGroup formOfPaymentAdviceMessageGroup = new FormOfPaymentAdviceMessageGroup();

            formOfPaymentAdviceMessageGroup = formOfPaymentAdviceMessageGroupRepository.GetGroup(formOfPaymentAdviceMessageGroupItemVM.FormOfPaymentAdviceMessageGroupItem.FormOfPaymentAdviceMessageGroupID);

            //Check Exists
            if (formOfPaymentAdviceMessageGroup == null)
            {
                ViewData["ActionMethod"] = "CreatePost";
                return(View("RecordDoesNotExistError"));
            }
            //Check Access
            if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }

            try
            {
                UpdateModel(formOfPaymentAdviceMessageGroupItemVM.FormOfPaymentAdviceMessageGroupItem);
            }
            catch
            {
                string n = "";
                foreach (ModelState modelState in ViewData.ModelState.Values)
                {
                    foreach (ModelError error in modelState.Errors)
                    {
                        n += error.ErrorMessage;
                    }
                }
                ViewData["Message"] = "ValidationError : " + n;
                return(View("Error"));
            }

            //Database Update
            try
            {
                formOfPaymentAdviceMessageItemRepository.Add(formOfPaymentAdviceMessageGroupItemVM.FormOfPaymentAdviceMessageGroupItem);
            }
            catch (SqlException ex)
            {
                LogRepository logRepository = new LogRepository();
                logRepository.LogError(ex.Message);

                ViewData["Message"] = "There was a problem with your request, please see the log file or contact an administrator for details";
                return(View("Error"));
            }

            return(RedirectToAction("List", new { id = formOfPaymentAdviceMessageGroupItemVM.FormOfPaymentAdviceMessageGroupItem.FormOfPaymentAdviceMessageGroupID }));
        }
        //Add Data From Linked Tables for Display
        public void EditGroupForDisplay(FormOfPaymentAdviceMessageGroup group)
        {
            HierarchyRepository hierarchyRepository = new HierarchyRepository();

            List <fnDesktopDataAdmin_SelectFormOfPaymentAdviceMessageGroupHierarchy_v1Result> hierarchy = new List <fnDesktopDataAdmin_SelectFormOfPaymentAdviceMessageGroupHierarchy_v1Result>();

            hierarchy = GetGroupHierarchy(group.FormOfPaymentAdviceMessageGroupID);
            group.FormOfPaymentAdviceMessageGroupName = Regex.Replace(group.FormOfPaymentAdviceMessageGroupName, @"[^\w\-()*]", "-");

            if (hierarchy.Count > 0)
            {
                group.HierarchyType = hierarchy[0].HierarchyType;
                group.HierarchyCode = hierarchy[0].HierarchyCode.ToString();
                group.HierarchyItem = hierarchy[0].HierarchyName.Trim();

                if (hierarchy[0].HierarchyType == "ClientSubUnitTravelerType")
                {
                    group.ClientSubUnitGuid = hierarchy[0].HierarchyCode.ToString();
                    group.ClientSubUnitName = hierarchy[0].HierarchyName.Trim();
                    group.TravelerTypeGuid  = hierarchy[0].TravelerTypeGuid;
                    group.TravelerTypeName  = hierarchy[0].TravelerTypeName.Trim();
                    if (!string.IsNullOrEmpty(group.ClientSubUnitGuid))
                    {
                        ClientSubUnitRepository clientSubUnitRepository = new ClientSubUnitRepository();
                        ClientSubUnit           clientSubUnit           = clientSubUnitRepository.GetClientSubUnit(group.ClientSubUnitGuid);
                        if (clientSubUnit != null && clientSubUnit.ClientTopUnit != null)
                        {
                            group.ClientTopUnitName = clientSubUnit.ClientTopUnit.ClientTopUnitName;
                        }
                    }
                }

                if (hierarchy[0].HierarchyType == "ClientSubUnit" || hierarchy[0].HierarchyType == "TravelerType")
                {
                    if (hierarchy[0].ClientTopUnitName != null)
                    {
                        group.ClientTopUnitName = hierarchy[0].ClientTopUnitName.Trim();
                    }
                }

                if (hierarchy[0].HierarchyType == "ClientAccount")
                {
                    group.SourceSystemCode = hierarchy[0].SourceSystemCode;
                }
            }

            //Single hierarchy
            group.IsMultipleHierarchy = false;
        }
Exemplo n.º 7
0
        // GET: /List
        public ActionResult List(int id, int?page, string filter, string sortField, int?sortOrder)
        {
            //Check Parent Exists
            FormOfPaymentAdviceMessageGroup formOfPaymentAdviceMessageGroup = new FormOfPaymentAdviceMessageGroup();

            formOfPaymentAdviceMessageGroup = formOfPaymentAdviceMessageGroupRepository.GetGroup(id);

            //Check Exists
            if (formOfPaymentAdviceMessageGroup == null)
            {
                ViewData["ActionMethod"] = "ListGet";
                return(View("RecordDoesNotExistError"));
            }

            //Set Access Rights
            ViewData["Access"] = "";
            if (hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Access"] = "WriteAccess";
            }

            //SortField+SortOrder settings
            if (string.IsNullOrEmpty(sortField))
            {
                sortField = "FormOfPaymentAdviceMessageGroupName";
            }
            ViewData["CurrentSortField"] = sortField;

            if (sortOrder == 1)
            {
                ViewData["NewSortOrder"]     = 0;
                ViewData["CurrentSortOrder"] = 1;
            }
            else
            {
                ViewData["NewSortOrder"]     = 1;
                ViewData["CurrentSortOrder"] = 0;
                sortOrder = 0;
            }

            ViewData["FormOfPaymentAdviceMessageGroupID"]   = formOfPaymentAdviceMessageGroup.FormOfPaymentAdviceMessageGroupID;
            ViewData["FormOfPaymentAdviceMessageGroupName"] = formOfPaymentAdviceMessageGroup.FormOfPaymentAdviceMessageGroupName;

            //return items
            var cwtPaginatedList = formOfPaymentAdviceMessageItemRepository.PageFormOfPaymentAdviceMessageGroupItems(id, page ?? 1, filter ?? "", sortField, sortOrder ?? 0);

            return(View(cwtPaginatedList));
        }
        // GET: /View
        public ActionResult View(int id)
        {
            FormOfPaymentAdviceMessageGroup group = new FormOfPaymentAdviceMessageGroup();

            group = formOfPaymentAdviceMessageGroupRepository.GetGroup(id);

            //Check Exists
            if (group == null)
            {
                ViewData["ActionMethod"] = "ViewGet";
                return(View("RecordDoesNotExistError"));
            }

            formOfPaymentAdviceMessageGroupRepository.EditGroupForDisplay(group);

            return(View(group));
        }
        //Add Group
        public void Add(FormOfPaymentAdviceMessageGroup group)
        {
            string adminUserGuid = HttpContext.Current.User.Identity.Name.Split(new[] { '|' })[0];

            db.spDesktopDataAdmin_InsertFormOfPaymentAdviceMessageGroup_v1(
                group.FormOfPaymentAdviceMessageGroupName,
                group.EnabledFlag,
                group.EnabledDate,
                group.ExpiryDate,
                group.HierarchyType,
                group.HierarchyCode,
                group.TravelerTypeGuid,
                group.ClientSubUnitGuid,
                group.SourceSystemCode,
                adminUserGuid
                );
        }
        // GET: /Create
        public ActionResult Create()
        {
            //Check Access Rights to Domain
            if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }

            TablesDomainHierarchyLevelRepository tablesDomainHierarchyLevelRepository = new TablesDomainHierarchyLevelRepository();
            SelectList hierarchyTypesList = new SelectList(tablesDomainHierarchyLevelRepository.GetDomainHierarchies(groupName).ToList(), "HierarchyLevelTableName", "HierarchyLevelTableName");

            ViewData["HierarchyTypes"] = hierarchyTypesList;

            FormOfPaymentAdviceMessageGroup group = new FormOfPaymentAdviceMessageGroup();

            return(View(group));
        }
        public ActionResult Delete(int id, FormCollection collection)
        {
            //Get Item From Database
            FormOfPaymentAdviceMessageGroup group = new FormOfPaymentAdviceMessageGroup();

            group = formOfPaymentAdviceMessageGroupRepository.GetGroup(id);

            //Check Exists
            if (group == null || group.DeletedFlag == true)
            {
                ViewData["ActionMethod"] = "DeletePost";
                return(View("RecordDoesNotExistError"));
            }

            //Check Access
            if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }

            //Delete Item
            try
            {
                group.VersionNumber = Int32.Parse(collection["VersionNumber"]);
                group.DeletedFlag   = true;
                formOfPaymentAdviceMessageGroupRepository.UpdateGroupDeletedStatus(group);
            }
            catch (SqlException ex)
            {
                //Versioning Error - go to standard versionError page
                if (ex.Message == "SQLVersioningError")
                {
                    ViewData["ReturnURL"] = "/FormOfPaymentAdviceMessageGroup.mvc/Delete/" + group.FormOfPaymentAdviceMessageGroupID;
                    return(View("VersionError"));
                }
                LogRepository logRepository = new LogRepository();
                logRepository.LogError(ex.Message);

                ViewData["Message"] = "There was a problem with your request, please see the log file or contact an administrator for details";
                return(View("Error"));
            }
            return(RedirectToAction("ListUnDeleted"));
        }
Exemplo n.º 12
0
        public ActionResult Delete(int id)
        {
            //Get Item
            FormOfPaymentAdviceMessageGroupItem formOfPaymentAdviceMessageItem = new FormOfPaymentAdviceMessageGroupItem();

            formOfPaymentAdviceMessageItem = formOfPaymentAdviceMessageItemRepository.GetItem(id);

            //Check Exists
            if (formOfPaymentAdviceMessageItem == null)
            {
                ViewData["ActionMethod"] = "DeleteGet";
                return(View("RecordDoesNotExistError"));
            }

            //Check Parent Exists
            FormOfPaymentAdviceMessageGroup formOfPaymentAdviceMessageGroup = new FormOfPaymentAdviceMessageGroup();

            formOfPaymentAdviceMessageGroup = formOfPaymentAdviceMessageGroupRepository.GetGroup(formOfPaymentAdviceMessageItem.FormOfPaymentAdviceMessageGroupID);

            //Check Exists
            if (formOfPaymentAdviceMessageGroup == null)
            {
                ViewData["ActionMethod"] = "CreatePost";
                return(View("RecordDoesNotExistError"));
            }

            //Check AccessRights
            if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }

            //Parent Information
            ViewData["FormOfPaymentAdviceMessageGroupID"]   = formOfPaymentAdviceMessageGroup.FormOfPaymentAdviceMessageGroupID;
            ViewData["FormOfPaymentAdviceMessageGroupName"] = formOfPaymentAdviceMessageGroup.FormOfPaymentAdviceMessageGroupName;

            formOfPaymentAdviceMessageItemRepository.EditItemForDisplay(formOfPaymentAdviceMessageItem);

            return(View(formOfPaymentAdviceMessageItem));
        }
        public ActionResult Edit(int id, FormCollection collection)
        {
            //Get Item From Database
            FormOfPaymentAdviceMessageGroup group = new FormOfPaymentAdviceMessageGroup();

            group = formOfPaymentAdviceMessageGroupRepository.GetGroup(id);

            //Check Exists
            if (group == null)
            {
                ViewData["ActionMethod"] = "EditPost";
                return(View("RecordDoesNotExistError"));
            }

            //Check Access
            if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                return(View("Error"));
            }

            //Update Model From Form + Validate against DB
            try
            {
                UpdateModel(group);
            }
            catch
            {
                string n = "";
                foreach (ModelState modelState in ViewData.ModelState.Values)
                {
                    foreach (ModelError error in modelState.Errors)
                    {
                        n += error.ErrorMessage;
                    }
                }
                ViewData["Message"] = "ValidationError : " + n;
                return(View("Error"));
            }

            if (group.HierarchyType != "Multiple")
            {
                //ClientSubUnitTravelerType has extra field
                string hierarchyCode = group.HierarchyCode;
                if (group.HierarchyType == "ClientSubUnitTravelerType")
                {
                    group.ClientSubUnitGuid = hierarchyCode;                      //ClientSubUnitTravelerType has 2 primarykeys
                }

                //Check Access Rights to PolicyGroup
                if (!hierarchyRepository.AdminHasDomainHierarchyWriteAccess(group.HierarchyType, hierarchyCode, group.SourceSystemCode, groupName))
                {
                    ViewData["Message"] = "You cannot add to this hierarchy item";
                    return(View("Error"));
                }
            }

            //Database Update
            try
            {
                formOfPaymentAdviceMessageGroupRepository.Edit(group);
            }
            catch (SqlException ex)
            {
                //Versioning Error
                if (ex.Message == "SQLVersioningError")
                {
                    ViewData["ReturnURL"] = "/FormOfPaymentAdviceMessageGroup.mvc/Edit/" + group.FormOfPaymentAdviceMessageGroupID.ToString();
                    return(View("VersionError"));
                }
                LogRepository logRepository = new LogRepository();
                logRepository.LogError(ex.Message);

                ViewData["Message"] = "There was a problem with your request, please see the log file or contact an administrator for details";
                return(View("Error"));
            }
            return(RedirectToAction("ListUnDeleted"));
        }
        public ActionResult Create(FormOfPaymentAdviceMessageGroup group)
        {
            //Check Access Rights to Domain
            if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }
            //Check Access Rights to Domain Hierarchy
            if (!hierarchyRepository.AdminHasDomainHierarchyWriteAccess(group.HierarchyType, group.HierarchyCode, group.SourceSystemCode, groupName))
            {
                ViewData["Message"] = "You cannot add to this hierarchy item";
                return(View("Error"));
            }

            //Update Model From Form + Validate against DB
            try
            {
                UpdateModel(group);
            }
            catch
            {
                string n = "";
                foreach (ModelState modelState in ViewData.ModelState.Values)
                {
                    foreach (ModelError error in modelState.Errors)
                    {
                        n += error.ErrorMessage;
                    }
                }
                ViewData["Message"] = "ValidationError : " + n;
                return(View("Error"));
            }

            //ClientSubUnitTravelerType has extra field
            string hierarchyCode = group.HierarchyCode;

            if (group.HierarchyType == "ClientSubUnitTravelerType")
            {
                group.ClientSubUnitGuid = hierarchyCode;                  //ClientSubUnitTravelerType has 2 primarykeys
            }

            //Database Update
            try
            {
                formOfPaymentAdviceMessageGroupRepository.Add(group);
            }
            catch (SqlException ex)
            {
                //Non-Unique Name
                if (ex.Message == "NonUniqueName")
                {
                    return(View("NonUniqueNameError"));
                }
                LogRepository logRepository = new LogRepository();
                logRepository.LogError(ex.Message);

                ViewData["Message"] = "There was a problem with your request, please see the log file or contact an administrator for details";
                return(View("Error"));
            }
            ViewData["NewSortOrder"] = 0;
            return(RedirectToAction("ListUnDeleted"));
        }
Exemplo n.º 15
0
        // GET: /Create
        public ActionResult Create(int id)
        {
            //Check Parent Exists
            FormOfPaymentAdviceMessageGroup formOfPaymentAdviceMessageGroup = new FormOfPaymentAdviceMessageGroup();

            formOfPaymentAdviceMessageGroup = formOfPaymentAdviceMessageGroupRepository.GetGroup(id);

            //Check Exists
            if (formOfPaymentAdviceMessageGroup == null)
            {
                ViewData["ActionMethod"] = "CreatePost";
                return(View("RecordDoesNotExistError"));
            }

            //Check Access
            if (!hierarchyRepository.AdminHasDomainWriteAccess(groupName))
            {
                ViewData["Message"] = "You do not have access to this item";
                return(View("Error"));
            }

            FormOfPaymentAdviceMessageGroupItemVM formOfPaymentAdviceMessageGroupItemVM = new FormOfPaymentAdviceMessageGroupItemVM();

            FormOfPaymentAdviceMessageGroupItem formOfPaymentAdviceMessageItem = new FormOfPaymentAdviceMessageGroupItem();

            formOfPaymentAdviceMessageItem.FormOfPaymentAdviceMessageGroupName = formOfPaymentAdviceMessageGroup.FormOfPaymentAdviceMessageGroupName;
            formOfPaymentAdviceMessageItem.FormOfPaymentAdviceMessageGroupID   = id;

            formOfPaymentAdviceMessageGroupItemVM.FormOfPaymentAdviceMessageGroup = formOfPaymentAdviceMessageGroup;

            //Language is a read only field defaulting to English (United Kingdom)
            LanguageRepository languageRepository = new LanguageRepository();
            Language           language           = languageRepository.GetLanguage("en-GB");

            if (language != null)
            {
                formOfPaymentAdviceMessageItem.LanguageCode = language.LanguageCode;
                formOfPaymentAdviceMessageItem.LanguageName = language.LanguageName;
            }

            formOfPaymentAdviceMessageGroupItemVM.FormOfPaymentAdviceMessageGroupItem = formOfPaymentAdviceMessageItem;

            CountryRepository countryRepository = new CountryRepository();

            formOfPaymentAdviceMessageGroupItemVM.Countries = new SelectList(countryRepository.GetAllCountries().ToList(), "CountryCode", "CountryName");

            ProductRepository productRepository = new ProductRepository();

            formOfPaymentAdviceMessageGroupItemVM.Products = new SelectList(productRepository.GetAllProducts().ToList(), "ProductId", "ProductName");

            TravelIndicatorRepository travelIndicatorRepository = new TravelIndicatorRepository();

            formOfPaymentAdviceMessageGroupItemVM.TravelIndicators = new SelectList(travelIndicatorRepository.GetAllTravelIndicators().OrderBy(x => x.TravelIndicatorDescription).ToList(), "TravelIndicator1", "TravelIndicatorDescription");

            FormOfPaymentTypeRepository formOfPaymentTypeRepository = new FormOfPaymentTypeRepository();

            formOfPaymentAdviceMessageGroupItemVM.FormOfPaymentTypes = new SelectList(formOfPaymentTypeRepository.GetAllFormOfPaymentTypes().ToList(), "FormOfPaymentTypeId", "FormOfPaymentTypeDescription");

            formOfPaymentAdviceMessageItemRepository.EditItemForDisplay(formOfPaymentAdviceMessageItem);

            return(View(formOfPaymentAdviceMessageGroupItemVM));
        }