示例#1
0
        /// <summary>
        /// Method to convert SkillExpertBECollection to Model
        /// </summary>
        /// <param name="argApprovalsBECollection">Business Entity collection for skill expert approval</param>
        /// <returns></returns>
        private PendingSkillExpertApprovalsCollection ConverPendingSkillExpertApprovalsToModel(PendingSkillExpertApprovalBECollection argApprovalsBECollection)
        {
            #region Declarations
            PendingSkillExpertApprovalsCollection l_PendingApprovalsCollection = new PendingSkillExpertApprovalsCollection();
            PendingSkillExpertApprovals           l_Approvals;
            #endregion
            try
            {
                if (argApprovalsBECollection != null && argApprovalsBECollection.Count > 0)
                {
                    foreach (var item in argApprovalsBECollection)
                    {
                        l_Approvals = new PendingSkillExpertApprovals();
                        l_Approvals.ManagerComments     = item.ManagerComments;
                        l_Approvals.UserComments        = item.UserComments;
                        l_Approvals.SkillExpertComments = item.SkillExpertComments;
                        l_Approvals.DemoSchedule        = item.DemoSchedule;
                        l_Approvals.Room          = item.Room;
                        l_Approvals.Status        = item.Status;
                        l_Approvals.RequestedDate = item.RequestedDate;
                        l_Approvals.RequestType   = item.RequestType;
                        l_Approvals.SkillName     = item.SkillName;
                        l_Approvals.SkillPoints   = item.SkillPoints;
                        l_Approvals.SubSkillName  = item.SubSkillName;
                        l_Approvals.RequestedBy   = item.RequestedBy;
                        l_Approvals.UniqueID      = item.UniqueID;
                        l_Approvals.FileGUID      = item.FileGUID;
                        l_Approvals.FileName      = item.FileName;
                        l_Approvals.RequestCode   = item.RequestCode;
                        l_PendingApprovalsCollection.Add(l_Approvals);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(l_PendingApprovalsCollection);
        }
示例#2
0
        public async Task <ActionResult> GetPendingSkillExpertApprovals(string argRequestType)
        {
            #region Declarations
            PendingSkillExpertApprovals            l_Requests             = new PendingSkillExpertApprovals();
            PendingSkillExpertApprovalBECollection l_ApprovalBECollection = new PendingSkillExpertApprovalBECollection();
            PendingSkillExpertApprovalsCollection  l_ApprovalCollection   = new PendingSkillExpertApprovalsCollection();
            string l_skillsURL = string.Empty;
            #endregion


            l_skillsURL = apiBaseURL + "/GetSkillExpertApprovals?argLoggedInUser="******"&argType=" + argRequestType + "";
            HttpResponseMessage l_SkillsData = await client.GetAsync(l_skillsURL);

            if (l_SkillsData != null && l_SkillsData.IsSuccessStatusCode)
            {
                var l_SkillResponse = l_SkillsData.Content.ReadAsStringAsync().Result;
                l_ApprovalBECollection = JsonConvert.DeserializeObject <PendingSkillExpertApprovalBECollection>(l_SkillResponse);
            }

            l_ApprovalCollection = ConverPendingSkillExpertApprovalsToModel(l_ApprovalBECollection);
            return(PartialView("_partialPendingSkillExpertApprovals", l_ApprovalCollection));
        }