public ActionResult AddRatioTotal(TreatmentRatioTotalView model)
 {
     if (ModelState.IsValid)
     {
         ViewBag.Tid = new SelectList(_treatmentBl.GetAllT(), "Tid", "Tname");
         _treatmentRatioBl.Add(model);
         return(RedirectToAction("GetAllRatioTotal"));
     }
     return(View(model));
 }
コード例 #2
0
        public void Add(TreatmentRatioTotalView model)
        {
            using (var ratio = new TreatmentRatioTotalRepository())
            {
                List <TreatmentRatio> total = _ratio.GetAll().ToList().FindAll(x => x.Tid == model.Tid);

                var treat = new TreatmentRatioTotal
                {
                    TreatmentRatioTotalId = model.TreatmentRatioTotalId,
                    Price = total.Sum(x => x.TreatPrice),
                    Tid   = model.Tid
                };
                ratio.Insert(treat);
            }
        }
コード例 #3
0
 public void Update(TreatmentRatioTotalView model)
 {
     throw new NotImplementedException();
 }