public CatalogInfoViewModel getCatalogInfoValues(int custAutoID)
        {
            CatalogInfoViewModel catalogInfoVM = new CatalogInfoViewModel();
            QuoteViewService     quoteService  = new QuoteViewService();

            catalogInfoVM.ThisUserID     = custAutoID;
            catalogInfoVM.CatalogOptions = FillCatalogOptionsInfo(catalogInfoVM.ThisUserID);
            catalogInfoVM.ValidationCatalogBasicProfileModel = FillValidationsInfo();
            CustomerCatalogInformation ccInfo = _Context.CustomerCatalogInformation.GetAll(e => e.CustAutoID == custAutoID).OrderByDescending(e => e.UpdatedDate).FirstOrDefault();

            catalogInfoVM.UpdatedDate     = ccInfo != null ? ccInfo.UpdatedDate : (DateTime?)null;
            catalogInfoVM.UpdatedUserName = ccInfo != null ? ccInfo.User != null?ccInfo.User.UserName.ToString() : string.Empty : string.Empty;

            quoteService.UserVM   = UserVM;
            UserVM.CurrentQuoteID = quoteService.getCustomerSCQuoteID();
            catalogInfoVM.UserVM  = UserVM;
            return(catalogInfoVM);
        }
        public ContactViewModel getPenworthyContactDetails(int userID)
        {
            ContactViewModel contactVM   = new ContactViewModel();
            QuoteViewService qvs         = new QuoteViewService();
            RepUser          userProfile = new RepUser();
            User             repuser     = new User();
            string           dir         = ConfigurationManager.AppSettings["ContactusImageDirectory"];

            User crtuserdetails = _Context.User.GetSingle(e => e.UserId == userID);

            if (UserVM != null)
            {
                if (UserVM.CRMModelProperties != null && !UserVM.CRMModelProperties.IsRepLoggedIN)
                {
                    // repuser = _Context.User.GetSingle(e => e.CustAutoID == crtuserdetails.CustAutoID);
                    repuser = crtuserdetails.Customer.CustomerRep.RepUser.User;
                }
                else
                {
                    repuser = _Context.User.GetSingle(e => e.UserId == userID);
                }
            }
            else
            {
                repuser = _Context.User.GetSingle(e => e.UserId == userID);
            }
            //int repID = repuser.RepID == null ? repuser.Customer.CustomerRep.RepID :(int) repuser.RepID;
            //int repUserId = _Context.User.GetSingle(e => e.RepID == repID).UserId;
            //userProfile = _Context.RepUser.GetSingle(e => e.RepID == UserVM.CRMModelProperties.RepID);
            if (repuser != null)
            {
                contactVM.RepName              = repuser.FirstName + " " + repuser.LastName;
                contactVM.RepEmail             = repuser.Email;
                contactVM.PhoneCustomerService = repuser.RepUsers.FirstOrDefault().PhoneCustomerService;
                contactVM.PhoneDirect          = repuser.RepUsers.FirstOrDefault().PhoneDirect;
                contactVM.AboutRep             = repuser.RepUsers.FirstOrDefault().Biodata;
                contactVM.RepImage             = dir + repuser.RepUsers.FirstOrDefault().RepID + ".jpg";
                contactVM.Title = repuser.RepUsers.FirstOrDefault().Title;
            }
            contactVM.UserVM = UserVM;
            qvs.UserVM       = UserVM;
            contactVM.UserVM.CurrentQuoteID = qvs.getCustomerSCQuoteID();
            return(contactVM);
        }
Example #3
0
        public LibrarianResourcesViewModel GetLibraryResource()
        {
            LibrarianResourcesViewModel LRVM = new LibrarianResourcesViewModel();
            QuoteViewService            qvs  = new QuoteViewService();

            LRVM.DictlibraryResource = new Dictionary <string, Dictionary <string, string> >();
            string dir = ConfigurationManager.AppSettings["CommonRepository"] + ConfigurationManager.AppSettings["LibraryResourseRootDirectory"];

            DirSearch(dir, LRVM);
            //foreach(string folderName in LRVM.DictlibraryResource.Keys)
            //{
            //    string path = LRVM.DictlibraryResource[folderName].Keys.Select(e => LRVM.DictlibraryResource[folderName][e] == "MainImage" ? e : string.Empty).FirstOrDefault();
            //}
            LRVM.UserVM = UserVM;
            qvs.UserVM  = UserVM;
            if (UserVM != null)
            {
                LRVM.UserVM.CurrentQuoteID = qvs.getCustomerSCQuoteID();
            }
            return(LRVM);
        }
Example #4
0
        public FAQViewModel GetDetails()
        {
            FAQViewModel       FAQVM       = new FAQViewModel();
            QuoteViewService   qvs         = new QuoteViewService();
            List <FAQCategory> faqCategory = _Context.FAQCategory.GetAll().ToList();

            FAQVM.FAQCategories = AutoMapper.Mapper.Map <IList <FAQCategory>, IList <FAQCategoriesViewModel> >(faqCategory).ToList();

            List <FAQ> faqQuestion = _Context.FAQ.GetAll().ToList();

            FAQVM.FAQuestions = AutoMapper.Mapper.Map <IList <FAQ>, IList <FAQuestionsViewModel> >(faqQuestion).ToList();

            List <FAQDetail> faqAnswers = _Context.FAQDetail.GetAll().ToList();

            FAQVM.FAQAnswers = AutoMapper.Mapper.Map <IList <FAQDetail>, IList <FAQDetailsViewModel> >(faqAnswers).ToList();
            FAQVM.UserVM     = UserVM;
            qvs.UserVM       = UserVM;
            if (UserVM != null)
            {
                FAQVM.UserVM.CurrentQuoteID = qvs.getCustomerSCQuoteID();
            }
            return(FAQVM);
        }