示例#1
0
        public void InsertDatabase(List <ErshouFangInfo> infoList)
        {
            List <ErshouFangDataModel> models = infoList.Select(info => ObjectMapperHelper.Map <ErshouFangDataModel>(info)).ToList();

            foreach (ErshouFangDataModel model in models)
            {
                this.DataProvider.Insert(model);
            }
        }
示例#2
0
        public IActionResult GetIncomeList(IncomeSeachModel searchModel)
        {
            IncomeCalculateArgs incomeCalculateArgs = ObjectMapperHelper.Map <IncomeCalculateArgs>(searchModel);
            var incomes = JieshaiManager.Instace.IncomeManager.CalculateIncome(incomeCalculateArgs);

            var incomeModels = incomes
                               .Select(i => ObjectMapperHelper.Map <IncomeViewModel>(i));

            return(Json(new { incomes = incomeModels }));
        }
示例#3
0
        public IActionResult Create(InvestmentCreateModel createModel)
        {
            var createInfo = ObjectMapperHelper.Map <InvestmentCreateInfo>(createModel);

            createInfo.Investor = JieshaiManager.Instace.InvestorManager.GetById(createModel.InvestorId);
            var investor = JieshaiManager.Instace.InvestmentManager.Create(createInfo);


            return(this.RedirectToAction("Index"));
        }
示例#4
0
        public Guji Create(GujiCreateInfo createInfo)
        {
            GujiInfo gujiInfo = ObjectMapperHelper.Map <GujiInfo>(createInfo);

            gujiInfo.Id = Guid.NewGuid().ToString();
            Guji guji = new Guji(gujiInfo);

            this._dataManager.GujiDataProvider.Insert(guji);
            this._coreManager.GujiManager.Add(guji);
            return(guji);
        }
示例#5
0
        public Zhongyao Create(ZhongyaoCreateInfo createInfo)
        {
            ZhongyaoInfo zhongyaoInfo = ObjectMapperHelper.Map <ZhongyaoInfo>(createInfo);

            zhongyaoInfo.Id = Guid.NewGuid().ToString();
            Zhongyao zhongyao = new Zhongyao(zhongyaoInfo);

            this._dataManager.ZhongyaoDataProvider.Insert(zhongyao);
            this._coreManager.ZhongyaoManager.Add(zhongyao);
            return(zhongyao);
        }
示例#6
0
        public Fangji Create(FangjiCreateInfo createInfo)
        {
            FangjiInfo zhongyaoInfo = ObjectMapperHelper.Map <FangjiInfo>(createInfo);

            zhongyaoInfo.Id = Guid.NewGuid().ToString();
            Fangji zhongyao = new Fangji(zhongyaoInfo);

            this._dataManager.FangjiDataProvider.Insert(zhongyao);
            this._coreManager.FangjiManager.Add(zhongyao);
            return(zhongyao);
        }
示例#7
0
        public List <GujiDetailsModel> Find(GujiFilterModel filterModel, out int totalCount)
        {
            GujiFilter filter = new GujiFilter();

            ObjectMapperHelper.Map(filter, filterModel, this._mapper);
            List <Guji>             gujiList  = this._coreManager.GujiManager.Find(filter, out totalCount);
            List <GujiDetailsModel> modelList = gujiList
                                                .Select(d =>
            {
                GujiDetailsModel model = this._mapper.Map <GujiDetailsModel>(d);
                return(model);
            }).ToList();

            return(modelList);
        }
        public JsonResult Create(GongyingshangDataModel webModel)
        {
            try
            {
                using (var context = ZhangweiContextFactory.Create())
                {
                    GongyingshangDataModel dataModel = ObjectMapperHelper.Map<GongyingshangDataModel>(webModel);

                    context.Gongyingshang.Add(dataModel);
                    context.SaveChanges();
                }

                return Json(new { success = true });
            }
            catch (Exception ex)
            {
                return Json(new { success = false, message = ex.Message });
            }
        }
        public JsonResult Edit(GongyingshangDataModel webModel)
        {
            try
            {
                using (var context = ZhangweiContextFactory.Create())
                {
                    var dataModel = context.Gongyingshang.Where(p => p.Id == webModel.Id).First();
                    ObjectMapperHelper.Map(dataModel, webModel);

                    context.Gongyingshang.Update(dataModel);
                    context.SaveChanges();
                }

                return Json(new { success = true });
            }
            catch (Exception ex)
            {
                return Json(new { success = false, message = ex.Message });
            }
        }
示例#10
0
        public JsonResult Create(PeijianCreateModel webModel)
        {
            try
            {
                using (var context = ZhangweiContextFactory.Create())
                {
                    PeijianDataModel dataModel = ObjectMapperHelper.Map <PeijianDataModel>(webModel);
                    dataModel.Tag = WebHelper.PeijianManager.GetTag(dataModel);

                    context.Peijian.Add(dataModel);
                    context.SaveChanges();
                }

                return(Json(new { success = true }));
            }
            catch (Exception ex)
            {
                return(Json(new { success = false, message = ex.Message }));
            }
        }
示例#11
0
        public JsonResult Edit(PeijianDataModel webModel)
        {
            try
            {
                using (var context = ZhangweiContextFactory.Create())
                {
                    var dataModel = context.Peijian.Where(p => p.Id == webModel.Id).First();
                    ObjectMapperHelper.Map(dataModel, webModel);
                    dataModel.Tag = WebHelper.PeijianManager.GetTag(dataModel);

                    context.Peijian.Update(dataModel);
                    context.SaveChanges();
                }

                return(Json(new { success = true }));
            }
            catch (Exception ex)
            {
                return(Json(new { success = false, message = ex.Message }));
            }
        }
示例#12
0
文件: Guji.cs 项目: limufan/zhongyi
 private void SetInfo(GujiBaseInfo info)
 {
     ObjectMapperHelper.Map(this, info);
     this.BuildKeyword();
 }
示例#13
0
文件: UserInfo.cs 项目: limufan/EIM
 public UserChangeInfo(User user)
 {
     ObjectMapperHelper.Map(this, user);
     this.ChangeUser = user;
 }
示例#14
0
 protected virtual void SetInfo(UserBaseInfo info)
 {
     ObjectMapperHelper.Map(this, info);
 }
示例#15
0
 public InvestmentViewModel(Investment investment)
 {
     ObjectMapperHelper.Map(this, investment);
     this.InvestorId = investment.Investor.Id;
 }
示例#16
0
 public InvestorViewModel(Investor investor)
 {
     ObjectMapperHelper.Map(this, investor);
 }