コード例 #1
0
        private InterestedPartyLookupListsCacheObject GetInterestedPartyAndLookups()
        {
            UcbServiceClient    sc           = new UcbServiceClient();
            InterestedPartyVMDC returnObject = sc.GetInterestedParty(HttpContext.Current.User.Identity.Name, HttpContext.Current.User.Identity.Name, "FrameworkAdmin", "", null);

            InterestedPartyLookupListsCacheObject CachedLists = new InterestedPartyLookupListsCacheObject();

            return(CachedLists);
        }
コード例 #2
0
        private IntroductoryInformationLookupListsCacheObject GetIntroductoryInformationAndLookups()
        {
            UcbServiceClient            sc           = new UcbServiceClient();
            IntroductoryInformationVMDC returnObject = sc.GetIntroductoryInformation(HttpContext.Current.User.Identity.Name, HttpContext.Current.User.Identity.Name, "FrameworkAdmin", "", null);

            IntroductoryInformationLookupListsCacheObject CachedLists = new IntroductoryInformationLookupListsCacheObject();

            return(CachedLists);
        }
コード例 #3
0
        private OrganisationTypeGroupLookupListsCacheObject GetOrganisationTypeGroupAndLookups()
        {
            UcbServiceClient          sc           = new UcbServiceClient();
            OrganisationTypeGroupVMDC returnObject = sc.GetOrganisationTypeGroup(HttpContext.Current.User.Identity.Name, HttpContext.Current.User.Identity.Name, "FrameworkAdmin", "", null);

            OrganisationTypeGroupLookupListsCacheObject CachedLists = new OrganisationTypeGroupLookupListsCacheObject();

            return(CachedLists);
        }
コード例 #4
0
        private NarrativeLookupListsCacheObject GetNarrativeAndLookups()
        {
            UcbServiceClient sc           = new UcbServiceClient();
            NarrativeVMDC    returnObject = sc.GetNarrative(HttpContext.Current.User.Identity.Name, HttpContext.Current.User.Identity.Name, "FrameworkAdmin", "", null);

            NarrativeLookupListsCacheObject CachedLists = new NarrativeLookupListsCacheObject();

            return(CachedLists);
        }
コード例 #5
0
        private ControlMeasureLookupListsCacheObject GetControlMeasureAndLookups()
        {
            UcbServiceClient   sc           = new UcbServiceClient();
            ControlMeasureVMDC returnObject = sc.GetControlMeasure(HttpContext.Current.User.Identity.Name, HttpContext.Current.User.Identity.Name, "FrameworkAdmin", "", null);

            ControlMeasureLookupListsCacheObject CachedLists = new ControlMeasureLookupListsCacheObject();

            return(CachedLists);
        }
コード例 #6
0
        private EventLeadingToIncidentLookupListsCacheObject GetEventLeadingToIncidentAndLookups()
        {
            UcbServiceClient           sc           = new UcbServiceClient();
            EventLeadingToIncidentVMDC returnObject = sc.GetEventLeadingToIncident(HttpContext.Current.User.Identity.Name, HttpContext.Current.User.Identity.Name, "FrameworkAdmin", "", null);

            EventLeadingToIncidentLookupListsCacheObject CachedLists = new EventLeadingToIncidentLookupListsCacheObject();

            return(CachedLists);
        }
コード例 #7
0
        private StaffLookupListsCacheObject GetStaffAndLookups()
        {
            UcbServiceClient sc           = new UcbServiceClient();
            StaffVMDC        returnObject = sc.GetStaff(HttpContext.Current.User.Identity.Name, HttpContext.Current.User.Identity.Name, "FrameworkAdmin", "", null);

            StaffLookupListsCacheObject CachedLists = new StaffLookupListsCacheObject();

            CachedLists.GradeList = Mapper.Map <IEnumerable <GradeDC>, List <GradeModel> >(returnObject.GradeList);
            return(CachedLists);
        }
コード例 #8
0
        private OrganisationLookupListsCacheObject GetOrganisationAndLookups()
        {
            UcbServiceClient sc           = new UcbServiceClient();
            OrganisationVMDC returnObject = sc.GetOrganisation(HttpContext.Current.User.Identity.Name, HttpContext.Current.User.Identity.Name, "FrameworkAdmin", "", null);

            OrganisationLookupListsCacheObject CachedLists = new OrganisationLookupListsCacheObject();

            CachedLists.OrganisationTypeList = Mapper.Map <IEnumerable <OrganisationTypeDC>, List <OrganisationTypeModel> >(returnObject.OrganisationTypeList);
            return(CachedLists);
        }
コード例 #9
0
        private ADRoleLookupLookupListsCacheObject GetADRoleLookupAndLookups()
        {
            UcbServiceClient sc           = new UcbServiceClient();
            ADRoleLookupVMDC returnObject = sc.GetADRoleLookup(HttpContext.Current.User.Identity.Name, HttpContext.Current.User.Identity.Name, "FrameworkAdmin", "", null);

            ADRoleLookupLookupListsCacheObject CachedLists = new ADRoleLookupLookupListsCacheObject();

            CachedLists.RoleList = Mapper.Map <IEnumerable <RoleDC>, List <RoleModel> >(returnObject.RoleList);
            return(CachedLists);
        }
コード例 #10
0
        private StandardReportLookupListsCacheObject GetStandardReportAndLookups()
        {
            UcbServiceClient   sc           = new UcbServiceClient();
            StandardReportVMDC returnObject = sc.GetStandardReport(HttpContext.Current.User.Identity.Name, HttpContext.Current.User.Identity.Name, "FrameworkAdmin", "", null);

            StandardReportLookupListsCacheObject CachedLists = new StandardReportLookupListsCacheObject();

            CachedLists.ReportCategoryList = Mapper.Map <IEnumerable <ReportCategoryDC>, List <ReportCategoryModel> >(returnObject.ReportCategoryList);
            return(CachedLists);
        }
コード例 #11
0
        private IncidentUpdateEventLookupListsCacheObject GetIncidentUpdateEventAndLookups()
        {
            UcbServiceClient        sc           = new UcbServiceClient();
            IncidentUpdateEventVMDC returnObject = sc.GetIncidentUpdateEvent(HttpContext.Current.User.Identity.Name, HttpContext.Current.User.Identity.Name, "FrameworkAdmin", "", null);

            IncidentUpdateEventLookupListsCacheObject CachedLists = new IncidentUpdateEventLookupListsCacheObject();

            CachedLists.IncidentList = Mapper.Map <IEnumerable <IncidentDC>, List <IncidentModel> >(returnObject.IncidentList);
            return(CachedLists);
        }
コード例 #12
0
        private CustomerLookupListsCacheObject GetCustomerAndLookups()
        {
            UcbServiceClient sc           = new UcbServiceClient();
            CustomerVMDC     returnObject = sc.GetCustomer(HttpContext.Current.User.Identity.Name, HttpContext.Current.User.Identity.Name, "FrameworkAdmin", "", null);

            CustomerLookupListsCacheObject CachedLists = new CustomerLookupListsCacheObject();

            CachedLists.RelationshipToCustomerList = Mapper.Map <IEnumerable <RelationshipToCustomerDC>, List <RelationshipToCustomerModel> >(returnObject.RelationshipToCustomerList);
            return(CachedLists);
        }
コード例 #13
0
        private AttachmentDataLookupListsCacheObject GetAttachmentDataAndLookups()
        {
            UcbServiceClient   sc           = new UcbServiceClient();
            AttachmentDataVMDC returnObject = sc.GetAttachmentData(HttpContext.Current.User.Identity.Name, HttpContext.Current.User.Identity.Name, "FrameworkAdmin", "", null);

            AttachmentDataLookupListsCacheObject CachedLists = new AttachmentDataLookupListsCacheObject();

            CachedLists.AttachmentList = Mapper.Map <IEnumerable <AttachmentDC>, List <AttachmentModel> >(returnObject.AttachmentList);
            return(CachedLists);
        }
コード例 #14
0
        private ApplicationAttributeLookupListsCacheObject GetApplicationAttributeAndLookups()
        {
            UcbServiceClient         sc           = new UcbServiceClient();
            ApplicationAttributeVMDC returnObject = sc.GetApplicationAttribute(HttpContext.Current.User.Identity.Name, HttpContext.Current.User.Identity.Name, "FrameworkAdmin", "", null);

            ApplicationAttributeLookupListsCacheObject CachedLists = new ApplicationAttributeLookupListsCacheObject();

            CachedLists.ApplicationList = Mapper.Map <IEnumerable <ApplicationDC>, List <ApplicationModel> >(returnObject.ApplicationList);
            return(CachedLists);
        }
コード例 #15
0
        private CustomerControlMeasureLookupListsCacheObject GetCustomerControlMeasureAndLookups()
        {
            UcbServiceClient           sc           = new UcbServiceClient();
            CustomerControlMeasureVMDC returnObject = sc.GetCustomerControlMeasure(HttpContext.Current.User.Identity.Name, HttpContext.Current.User.Identity.Name, "FrameworkAdmin", "", null);

            CustomerControlMeasureLookupListsCacheObject CachedLists = new CustomerControlMeasureLookupListsCacheObject();

            CachedLists.CustomerList       = Mapper.Map <IEnumerable <CustomerDC>, List <CustomerModel> >(returnObject.CustomerList);
            CachedLists.ControlMeasureList = Mapper.Map <IEnumerable <ControlMeasureDC>, List <ControlMeasureModel> >(returnObject.ControlMeasureList);
            return(CachedLists);
        }
コード例 #16
0
        private ApplicationOrganisationTypeGroupLookupListsCacheObject GetApplicationOrganisationTypeGroupAndLookups()
        {
            UcbServiceClient sc = new UcbServiceClient();
            ApplicationOrganisationTypeGroupVMDC returnObject = sc.GetApplicationOrganisationTypeGroup(HttpContext.Current.User.Identity.Name, HttpContext.Current.User.Identity.Name, "FrameworkAdmin", "", null);

            ApplicationOrganisationTypeGroupLookupListsCacheObject CachedLists = new ApplicationOrganisationTypeGroupLookupListsCacheObject();

            CachedLists.ApplicationList                    = Mapper.Map <IEnumerable <ApplicationDC>, List <ApplicationModel> >(returnObject.ApplicationList);
            CachedLists.OrganisationTypeGroupList          = Mapper.Map <IEnumerable <OrganisationTypeGroupDC>, List <OrganisationTypeGroupModel> >(returnObject.OrganisationTypeGroupList);
            CachedLists.RootOrganisationForApplicationList = Mapper.Map <IEnumerable <OrganisationDC>, List <OrganisationModel> >(returnObject.RootOrganisationForApplicationList);
            return(CachedLists);
        }
コード例 #17
0
        private StaffOrganisationLookupListsCacheObject GetStaffOrganisationAndLookups()
        {
            UcbServiceClient      sc           = new UcbServiceClient();
            StaffOrganisationVMDC returnObject = sc.GetStaffOrganisation(HttpContext.Current.User.Identity.Name, HttpContext.Current.User.Identity.Name, "FrameworkAdmin", "", null);

            StaffOrganisationLookupListsCacheObject CachedLists = new StaffOrganisationLookupListsCacheObject();

            CachedLists.StaffList        = Mapper.Map <IEnumerable <StaffDC>, List <StaffModel> >(returnObject.StaffList);
            CachedLists.OrganisationList = Mapper.Map <IEnumerable <OrganisationDC>, List <OrganisationModel> >(returnObject.OrganisationList);
            CachedLists.ApplicationList  = Mapper.Map <IEnumerable <ApplicationDC>, List <ApplicationModel> >(returnObject.ApplicationList);
            return(CachedLists);
        }
コード例 #18
0
        public ActionResult Index()
        {
            IntroductoryInformationVM model = new IntroductoryInformationVM();

            // Create service instance
            UcbServiceClient sc = new UcbServiceClient();

            try
            {
                // Get users localisation
                LanguageManager language = new LanguageManager(sessionManager);
                string          locale   = language.GetLocale();

                // Call service to get IntroductoryInformation item and any associated lookups based on locale
                IntroductoryInformationVMDC returnedObject = sc.GetIntroductoryInformationByLocale(CurrentUser, CurrentUser, appID, "", locale);

                // Close service communication
                sc.Close();

                //Get view model from service
                model = ConvertIntroductoryInformationDC(returnedObject);

                ResolveFieldCodesToFieldNamesUsingLists(model);

                //Store the service version
                sessionManager.IntroductoryInformationServiceVersion = model.IntroductoryInformationItem;
            }
            catch (Exception e)
            {
                // Handle the exception
                string message = ExceptionManager.HandleException(e, sc);
                model.Message = message;

                return(View(model));
            }

            if (sessionManager.PageFrom == "EditIncident" || sessionManager.PageFrom == "EditReferral")
            {
                if (!string.IsNullOrEmpty(sessionManager.MessageFromPageFrom))
                {
                    model.Message = sessionManager.MessageFromPageFrom;
                    sessionManager.MessageFromPageFrom = null;
                }
            }

            //Adds current retrieved IntroductoryInformation to session
            sessionManager.CurrentIntroductoryInformation = model.IntroductoryInformationItem;
            SetAccessContext(model);

            return(View(model));
        }
コード例 #19
0
        public ActionResult MIReport()
        {
            sessionManager.PageFrom = "MIMenu";
            string             ReportCode = Request.QueryString["ReportID"];
            UcbServiceClient   sc         = new UcbServiceClient();
            StandardReportVMDC report     = null;

            try
            {
                report = sc.GetStandardReport(CurrentUser, CurrentUser, "Ucb", "", ReportCode);
                sc.Close();
            }
            catch (Exception e)
            {
                ExceptionManager.HandleException(e, sc);
            }
            sessionManager.CurrentStandardReport = Mapper.Map <StandardReportModel>(report.StandardReportItem);
            //Report Name now passed in session
            sessionManager.RequestedReport = report.StandardReportItem.ReportName;
            return(Redirect("~/Reports/Reports.aspx"));
        }
コード例 #20
0
        public ActionResult SaveIntroductoryInformation(FormCollection collection)
        {
            // Get the updated model
            var model = GetUpdatedModel();

            // Test to see if there are any errors
            var errors = ModelState
                         .Where(x => x.Value.Errors.Count > 0)
                         .Select(x => new { x.Key, x.Value.Errors[0].ErrorMessage })
                         .ToArray();

            //Set flags false
            SetFlagsFalse(model);

            // Test to see if the model has validated correctly
            if (ModelState.IsValid)
            {
                // Create service instance
                UcbServiceClient sc = new UcbServiceClient();

                //Attempt update
                try
                {
                    // Map model to data contract
                    IntroductoryInformationDC IntroductoryInformationItem = Mapper.Map <IntroductoryInformationDC>(model.IntroductoryInformationItem);

                    IntroductoryInformationVMDC returnedObject = null;

                    // Call service to update IntroductoryInformation item
                    returnedObject = sc.UpdateIntroductoryInformation(CurrentUser, CurrentUser, appID, "", IntroductoryInformationItem);

                    // Close service communication
                    sc.Close();

                    // Retrieve item returned by service
                    var createdIntroductoryInformation = returnedObject.IntroductoryInformationItem;

                    // Map data contract to model
                    model.IntroductoryInformationItem = Mapper.Map <IntroductoryInformationModel>(createdIntroductoryInformation);

                    //After creation some of the fields are display only so we need the resolved look up nmames
                    ResolveFieldCodesToFieldNamesUsingLists(model);

                    // Set access context to Edit mode
                    model.AccessContext = IntroductoryInformationAccessContext.Edit;

                    // Save version of item returned by service into session
                    sessionManager.IntroductoryInformationServiceVersion = model.IntroductoryInformationItem;
                    sessionManager.CurrentIntroductoryInformation        = model.IntroductoryInformationItem;

                    // Remove the state from the model as these are being populated by the controller and the HTML helpers are being populated with
                    // the POSTED values and not the changed ones.
                    ModelState.Clear();
                    model.Message = Resources.MESSAGE_UPDATE_SUCCEEDED;
                }
                catch (Exception e)
                {
                    // Handle the exception
                    string message = ExceptionManager.HandleException(e, sc);
                    model.Message = message;

                    return(View(model));
                }
            }

            return(View(model));
        }
コード例 #21
0
ファイル: CacheManager.cs プロジェクト: MustaqHussain/UCB
        private IncidentLookupListsCacheObject GetIncidentAndLookups()
        {
            UcbServiceClient sc = new UcbServiceClient();

            try
            {
                // Get instance of Language Manager
                LanguageManager language = new LanguageManager();

                // Get users localisation
                string locale = language.GetLocale();

                IncidentVMDC returnObject = sc.GetIncident(HttpContext.Current.User.Identity.Name, HttpContext.Current.User.Identity.Name, "Ucb", "", null, locale);

                sc.Close();

                IncidentLookupListsCacheObject CachedLists = new IncidentLookupListsCacheObject();

                CachedLists.JobRoleList                 = Mapper.Map <IEnumerable <JobRoleDC>, List <JobRoleModel> >(returnObject.JobRoleList);
                CachedLists.ReferrerList                = Mapper.Map <IEnumerable <ReferrerDC>, List <ReferrerModel> >(returnObject.ReferrerList);
                CachedLists.StaffMemberBusinessList     = Mapper.Map <IEnumerable <OrganisationDC>, List <OrganisationModel> >(returnObject.StaffMemberBusinessList.OrderBy(x => x.Name));
                CachedLists.StaffMemberBusinessAreaList = Mapper.Map <IEnumerable <OrganisationDC>, List <OrganisationModel> >(returnObject.StaffMemberBusinessAreaList.OrderBy(x => x.Name));
                //***Note - have removed sites/home offices from cache***
                //CachedLists.StaffMemberHomeOfficeList = Mapper.Map<IEnumerable<OrganisationDC>, List<OrganisationModel>>(returnObject.StaffMemberHomeOfficeList);
                CachedLists.EventLeadingToIncidentList = Mapper.Map <IEnumerable <EventLeadingToIncidentDC>, List <EventLeadingToIncidentModel> >(returnObject.EventLeadingToIncidentList);
                CachedLists.IncidentLocationList       = Mapper.Map <IEnumerable <IncidentLocationDC>, List <IncidentLocationModel> >(returnObject.IncidentLocationList);
                CachedLists.IncidentCategoryList       = Mapper.Map <IEnumerable <IncidentCategoryDC>, List <IncidentCategoryModel> >(returnObject.IncidentCategoryList);
                CachedLists.IncidentTypeList           = Mapper.Map <IEnumerable <IncidentTypeDC>, List <IncidentTypeModel> >(returnObject.IncidentTypeList);
                CachedLists.IncidentDetailsList        = Mapper.Map <IEnumerable <IncidentDetailDC>, List <IncidentDetailModel> >(returnObject.IncidentDetailsList);
                CachedLists.AbuseTypeList           = Mapper.Map <IEnumerable <AbuseTypeDC>, List <AbuseTypeModel> >(returnObject.AbuseTypeList);
                CachedLists.FastTrackAttachmentList = Mapper.Map <IEnumerable <AttachmentDC>, List <AttachmentModel> >(returnObject.FastTrackAttachmentList);
                CachedLists.RIDDORAttachmentList    = Mapper.Map <IEnumerable <AttachmentDC>, List <AttachmentModel> >(returnObject.RIDDORAttachmentList);

                CachedLists.AdminEmail       = returnObject.AdminEmail;
                CachedLists.DeputyAdminEmail = returnObject.DeputyAdminEmail;

                CachedLists.RelationshipToCustomerList     = Mapper.Map <IEnumerable <RelationshipToCustomerDC>, List <RelationshipToCustomerModel> >(returnObject.RelationshipToCustomerList);
                CachedLists.ContingencyArrangementBaseList = Mapper.Map <IEnumerable <ContingencyArrangementDC>, List <ContingencyArrangementModel> >(returnObject.ContingencyArrangementList);
                CachedLists.ControlMeasureBaseList         = Mapper.Map <IEnumerable <ControlMeasureDC>, List <ControlMeasureModel> >(returnObject.ControlMeasureList);
                CachedLists.SystemMarkedBaseList           = Mapper.Map <IEnumerable <SystemMarkedDC>, List <SystemMarkedModel> >(returnObject.SystemMarkedList);
                CachedLists.InterestedPartyBaseList        = Mapper.Map <IEnumerable <InterestedPartyDC>, List <InterestedPartyModel> >(returnObject.InterestedPartyList);

                //Select Lists
                CachedLists.ContingencyArrangementList = returnObject.ContingencyArrangementList.Select(x => new SelectListItem()
                {
                    Value = x.Code.ToString(), Text = x.Description
                }).ToList();
                CachedLists.ControlMeasureList = returnObject.ControlMeasureList.Select(x => new SelectListItem()
                {
                    Value = x.Code.ToString(), Text = x.ControlMeasureDescription
                }).ToList();
                CachedLists.SystemMarkedList = returnObject.SystemMarkedList.Select(x => new SelectListItem()
                {
                    Value = x.Code.ToString(), Text = x.Description
                }).ToList();
                CachedLists.InterestedPartyList = returnObject.InterestedPartyList.Select(x => new SelectListItem()
                {
                    Value = x.Code.ToString(), Text = x.Description
                }).ToList();



                return(CachedLists);
            }
            catch (Exception e)
            {
                // Handle the exception
                string message = ExceptionManager.HandleException(e, sc);

                return(null);
            }
        }
コード例 #22
0
ファイル: MenuHelper.cs プロジェクト: MustaqHussain/UCB
        private static void CreateSubMenu(TagBuilder accordion, string menu, string userName)
        {
            TagBuilder h3;

            h3 = new TagBuilder("h3");

            var a1 = new TagBuilder("a");

            a1.Attributes["href"] = "#";
            a1.InnerHtml          = menu;
            h3.InnerHtml         += a1.ToString();

            TagBuilder h4;
            TagBuilder div;

            var accordionSub = new TagBuilder("div");
            var extraDiv     = new TagBuilder("div");

            accordionSub.GenerateId("accordionSub");

            UcbServiceClient sc = new UcbServiceClient();

            try
            {
                var publishedReportsByCategory = sc.GetPublishedReportsByCategory(userName, userName, "Ucb", "");
                foreach (var category in publishedReportsByCategory)
                {
                    h4 = new TagBuilder("h4");

                    var a = new TagBuilder("a");
                    a.Attributes["href"] = "#";
                    a.InnerHtml          = category.Category;

                    div = new TagBuilder("div");
                    var ul = new TagBuilder("ul");
                    ul.GenerateId("nav");

                    foreach (var li in CreateSubMenuItem(category.StandardReports))
                    {
                        ul.InnerHtml += li.ToString();
                    }


                    div.InnerHtml = ul.ToString();

                    h4.InnerHtml += a.ToString();

                    accordionSub.InnerHtml += h4.ToString();
                    accordionSub.InnerHtml += div.ToString();
                }
            }
            catch (Exception e)
            {
                string message = ExceptionManager.HandleException(e, sc);
            }

            finally
            {
                sc.Close();
            }


            accordion.InnerHtml += h3.ToString();
            extraDiv.InnerHtml  += accordionSub.ToString();
            accordion.InnerHtml += extraDiv.ToString();
        }