Exemple #1
0
 public static List <SourceTypeInfo> GetSourceTypeCheckUpdate()
 {
     if (_SourceTypes.IsNullOrEmpty())
     {
         _SourceTypes = SourceTypeRepository.GetAll();
     }
     return(_SourceTypes.Where(c => c.IsCheckUpdate).ToList());
 }
        //
        // GET: /Admin/ImportExcel/

        public ActionResult Index()
        {
            ViewBag.DefaultBranchId = UserContext.GetDefaultBranch();
            ViewBag.Collectors      = CollectorRepository.GetAll();
            ViewBag.Channels        = ChannelRepository.GetAll();
            ViewBag.SourceTypes     = SourceTypeRepository.GetAll();
            var levels = LevelRepository.GetAll();
            var L1n2   = levels.Where(x => x.LevelId < 3).ToList();

            ViewBag.Levels   = L1n2;
            ViewBag.Branches = BranchRepository.GetAll();
            return(View());
        }
Exemple #3
0
        //
        // GET: /Admin/HandoverAdvisor/

        public ActionResult HandoverContact(int id, ContactLevelInfoModel modelCache = null)
        {
            ViewBag.SourceTypes = SourceTypeRepository.GetAll();

            var user = UserContext.GetCurrentUser();

            if (user == null)
            {
                return(RedirectToAction("FilterContactToday", "ContactFilter", new { area = "Admin" }));
            }

            var contactInfo = ContactRepository.GetInfo(id);

            if (contactInfo == null)
            {
                return(RedirectToAction("FilterContactToday", "ContactFilter", new { area = "Admin" }));
            }

            if (user.GroupConsultantType == (int)GroupConsultantType.Consultant && user.UserID != contactInfo.UserConsultantId)
            {
                return(RedirectToAction("FilterContactToday", "ContactFilter", new { area = "Admin" }));
            }

            string TransactionReason = "";

            List <LogsMoneyInfo> logMoneyInfos = MoneyLogsRepository.GetAllByContactId(id);

            foreach (var logMoney in logMoneyInfos)
            {
                TransactionReason += logMoney.NoteChuyenKhoan + "@@@";
            }

            ViewBag.Id     = id;
            ViewBag.IsView = user.UserID != contactInfo.UserConsultantId ? 1 : 0;

            if (user.GroupConsultantType == (int)GroupConsultantType.ManagerConsultant)
            {
                ViewBag.IsView = 0;
            }
            var contactLevelInfo = ContactLevelInfoRepository.GetInfoByContactId(id) ?? new ContactLevelInfo();
            var model            = InitModel(contactInfo, contactLevelInfo);

            model.ContactInfo.Consultant             = user.UserName;
            model.ContactInfo.UserName               = user.FullName; //Lay ten TVTS
            model.ContactLevelInfo.TransactionReason = TransactionReason;
            model.PhoneTVTS = user.Mobile;                            //điện thoại TVTS
            model.EmailTVTS = user.Email;                             //Email TVTS

            if (model.ContactInfo != null)
            {
                if (modelCache != null && modelCache.ContactInfo != null)
                {
                    model.ContactInfo.QualityId              = modelCache.ContactInfo.QualityId;
                    model.ContactInfo.CallInfoConsultant     = modelCache.ContactInfo.CallInfoConsultant;
                    model.ContactInfo.StatusMapConsultantId  = modelCache.ContactInfo.StatusMapConsultantId;
                    model.ContactInfo.StatusCareConsultantId = modelCache.ContactInfo.StatusCareConsultantId;
                }
                else
                {
                    model.ContactInfo.QualityId              = 0;
                    model.ContactInfo.StatusMapConsultantId  = 0;
                    model.ContactInfo.StatusCareConsultantId = 0;
                    model.ContactInfo.CallInfoConsultant     = string.Empty;
                }
            }
            return(View(model));
        }
Exemple #4
0
 public IEnumerable <SourceTypeInfo> Get()
 {
     return(SourceTypeRepository.GetAll());
 }