コード例 #1
0
        public IEnumerable <SelectListItem> GroupBySales(string id)
        {
            SalesGroupDAL dal   = new SalesGroupDAL();
            SalesManDAL   sd    = new SalesManDAL();
            var           sales = sd.Get(id);

            var viewList = new List <SelectListItem>();
            var list     = dal.GetAll();

            foreach (var vi in list)
            {
                SelectListItem se = new SelectListItem();
                se.Text  = vi.Name;
                se.Value = vi.ID.ToString();
                if (sales != null && sales.GroupID == vi.ID)
                {
                    se.Selected = true;;
                }
                viewList.Add(se);
            }
            viewList.Insert(0, new SelectListItem()
            {
                Value = string.Empty, Text = "请选择"
            });
            return(viewList);
        }
コード例 #2
0
        public ActionResult Index()
        {
            SalesManDAL smdal = new SalesManDAL();
            var         model = smdal.GetAll().ToList().Select(t => new SalesManViewModel().CastModel(t));

            return(View(model));
        }
コード例 #3
0
        public ActionResult Edit(SalesManViewModel model)
        {
            SalesManDAL smdal = new SalesManDAL();

            smdal.Update(model.CastDB(model));
            smdal.AcceptAllChange();
            return(GetBaseResponse <SalesManViewModel>(true));
        }
コード例 #4
0
        public ActionResult Edit(string id)
        {
            SalesManDAL smdal = new SalesManDAL();
            var         model = new SalesManViewModel();

            model = model.CastModel(smdal.Get(id));
            return(View(model));
        }
コード例 #5
0
        public ActionResult Delete(string id)
        {
            SalesManDAL smdal = new SalesManDAL();
            var         model = smdal.Get(id);

            smdal.Delete(model);
            smdal.AcceptAllChange();
            return(GetBaseResponse <SalesManViewModel>(true));
        }
コード例 #6
0
        public ActionResult Create(SalesManViewModel model)
        {
            SalesManDAL smdal = new SalesManDAL();

            model.ID = Guid.NewGuid().ToString();
            smdal.Add(model.CastDB(model));
            smdal.AcceptAllChange();

            return(GetBaseResponse <SalesManViewModel>(true));
        }
コード例 #7
0
        public ActionResult GetSales(string groupid)
        {
            SalesManDAL           smdal    = new SalesManDAL();
            var                   salesman = smdal.GetAll().Where(t => t.GroupID == groupid && t.State == 1).ToList().Select(t => new SalesManViewModel().CastModel(t));
            BaseResponse <object> br       = new BaseResponse <object>();

            br.Status = "Success";
            br.Data   = salesman;
            return(Json(br, JsonRequestBehavior.AllowGet));
        }
コード例 #8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult GetCaseDetails(string id)
        {
            var response     = new BaseResponse <CaseAllDetailsViewModel>();
            var ch           = new AuditController.AuditHelper();
            var baseAuditDal = new BaseAuditDAL();
            var lendal       = new LendingDAL();
            var dicdal       = new DictionaryDAL();
            var sales        = new SalesManDAL();
            var lendvm       = new LendingViewModel();
            var mortgagevm   = new PublicMortgageViewModel();
            var mortgageBll  = new MortgageBll();
            var caseallmodel = new CaseAllDetailsViewModel();

            var baseauditvm = ch.FindByID(id, CurrentUser);

            if (baseauditvm != null)
            {
                var ahp  = new AuditHisHelper();
                var list = baseAuditDal.GetListByCaseNum(baseauditvm.CaseNum);
                baseauditvm.AuditHistory = ahp.GetHistory(list);
            }
            var mort = mortgageBll.QueryById(id);

            if (mort != null)
            {
                mortgagevm = mortgagevm.CastModel(mort);
                mortgagevm.ContractFileName          = GetFiles(mortgagevm.ContractFile);
                mortgagevm.OtherFileName             = GetFiles(mortgagevm.OtherFile);
                mortgagevm.FourFileName              = GetFiles(mortgagevm.FourFile);
                mortgagevm.RepaymentAttorneyFileName = GetFiles(mortgagevm.RepaymentAttorneyFile);
                mortgagevm.PowerAttorneyFileName     = GetFiles(mortgagevm.PowerAttorneyFile);
                mortgagevm.CollectionFileName        = GetFiles(mortgagevm.CollectionFile);
            }
            var lend = lendal.Get(id);

            if (lend != null)
            {
                lendvm = lendvm.CastModel(lend);
                lendvm.LendFileName        = GetFiles(lendvm.LendFile);
                lendvm.IsActivitieRateText = dicdal.GetText(lendvm.IsActivitieRate.ToString());
                lendvm.CaseModeText        = dicdal.GetText(lendvm.CaseMode);
                lendvm.ThirdPartyText      = dicdal.GetText(lendvm.ThirdParty);
                lendvm.AuditTermText       = dicdal.GetText(lendvm.AuditTerm);
                lendvm.SalesIDText         = sales.FindBySalesID(lendvm.SalesID) == null ? null : sales.FindBySalesID(lendvm.SalesID).Name;
            }

            caseallmodel.Baseauditvm = baseauditvm;
            caseallmodel.Mortgagevm  = mortgagevm;
            caseallmodel.Lendingvm   = lendvm;
            response.Status          = "Success";
            response.Data            = caseallmodel;
            return(Json(response, JsonRequestBehavior.AllowGet));
        }
コード例 #9
0
        public BaseCaseListViewModel CastModel(BaseCase baseCase)
        {
            BaseCaseListViewModel baseCaseListViewModel = new BaseCaseListViewModel();
            CollateralDAL         collateralDal         = new CollateralDAL();
            SalesManDAL           salesManDal           = new SalesManDAL();

            Framework.DAL.Audit.BaseAuditDAL badit = new Framework.DAL.Audit.BaseAuditDAL();
            var saleGroups = new SalesGroupBll().GetAll().ToList();

            Infrastructure.ExtendTools.ObjectExtend.CopyTo(baseCase, baseCaseListViewModel);
            baseCaseListViewModel.CaseNum = baseCase.NewCaseNum;

            var sale = salesManDal.Get(baseCase.SalesID);

            baseCaseListViewModel.SalesDisplay = sale == null ? "" : sale.Name;

            var firstcoll = collateralDal.FindByCaseID(baseCase.ID).FirstOrDefault(t => t.CollateralType == DictionaryString.CollateralType);

            if (firstcoll != null)
            {
                baseCaseListViewModel.FirstCollateral = string.Format("{0}({1})", firstcoll.Address, firstcoll.BuildingName);
            }

            if (baseCase.NewCaseNum != null && baseCase.Version > 0)
            {
                var audit = badit.GetbyCaseNum(baseCase.NewCaseNum);

                var CaseStatus = audit == null ? "数据不完整" : audit.CaseStatus;
                baseCaseListViewModel.CaseStatus     = CaseStatus == null ? "" : CaseStatus;
                baseCaseListViewModel.CaseStatusText = CaseStatus == null ? "" : Helper.CaseStatusHelper.GetBigStatusText(CaseStatus);
            }
            else if (baseCase.NewCaseNum != null && baseCase.Version == 0)
            {
                baseCaseListViewModel.CaseStatus     = "";
                baseCaseListViewModel.CaseStatusText = "预提交";
            }
            else
            {
                baseCaseListViewModel.CaseStatus = null;
            }

            if (baseCaseListViewModel.SalesGroupID != null)
            {
                baseCaseListViewModel.SalesGroupText = saleGroups.Single(x => x.ID == baseCaseListViewModel.SalesGroupID).Name;
            }

            return(baseCaseListViewModel);
        }
コード例 #10
0
        public IEnumerable <SelectListItem> SalesList(string id)
        {
            SalesManDAL dal      = new SalesManDAL();
            var         viewList = new List <SelectListItem>();
            var         model    = dal.Get(id);
            var         list     = dal.GetAll().Where(t => t.GroupID == model.GroupID);

            foreach (var vi in list)
            {
                SelectListItem se = new SelectListItem();
                se.Text  = vi.Name;
                se.Value = vi.ID.ToString();
                if (id == vi.ID)
                {
                    se.Selected = true;;
                }
                viewList.Add(se);
            }
            return(viewList);
        }
コード例 #11
0
        public ActionResult GetLending(string id)
        {
            LendingDAL    bd     = new LendingDAL();
            DictionaryDAL dicdal = new DictionaryDAL();
            SalesManDAL   Sales  = new SalesManDAL();

            BaseResponse <LendingViewModel> br = new BaseResponse <LendingViewModel>();
            var mor   = bd.Get(id);
            var morvm = new LendingViewModel();

            if (mor != null)
            {
                morvm = morvm.CastModel(mor);
                morvm.LendFileName        = GetFiles(morvm.LendFile);
                morvm.Introducer          = GetIntroducer(id);
                morvm.IsActivitieRateText = dicdal.GetText(morvm.IsActivitieRate.ToString());
                morvm.CaseModeText        = dicdal.GetText(morvm.CaseMode);
                morvm.ThirdPartyText      = dicdal.GetText(morvm.ThirdParty);
                morvm.AuditTermText       = dicdal.GetText(morvm.AuditTerm);
                morvm.SalesIDText         = Sales.FindBySalesID(morvm.SalesID) == null ? null : Sales.FindBySalesID(morvm.SalesID).Name;
            }
            else
            {
                mor                       = new Lending();
                mor.ID                    = id;
                morvm                     = morvm.CastModel(mor);
                morvm.Introducer          = GetIntroducer(id);
                morvm.IsActivitieRateText = dicdal.GetText(morvm.IsActivitieRate.ToString());
                morvm.CaseModeText        = dicdal.GetText(morvm.CaseMode);
                morvm.ThirdPartyText      = dicdal.GetText(morvm.ThirdParty);
                morvm.AuditTermText       = dicdal.GetText(morvm.AuditTerm);
                morvm.SalesIDText         = Sales.FindBySalesID(morvm.SalesID) == null ? null : Sales.FindBySalesID(morvm.SalesID).Name;
            }
            br.Data   = morvm;
            br.Status = "Success";
            return(Json(br, JsonRequestBehavior.AllowGet));
        }