예제 #1
0
        public ActionResult Add(string name, string Sex, string age, string phone, string address, string Complaint, string MedicalHistory, string Checkup, string Treatment
                                , int MaterialCategory, string Cost, string IsWear)
        {
            var cases = new OutpatientCases();

            cases.AddTime        = DateTime.Now;
            cases.VisitingTime   = cases.AddTime.Value.ToShortDateString();
            cases.Name           = name;
            cases.age            = age;
            cases.Phone          = phone;
            cases.Address        = address;
            cases.Complaint      = Complaint;
            cases.MedicalHistory = MedicalHistory;

            cases.TeethUpLeft    = Request.Form["TeethUpLeft"];
            cases.TeethUpRight   = Request.Form["TeethUpRight"];
            cases.TeethDownLeft  = Request.Form["TeethDownLeft"];
            cases.TeethDownRight = Request.Form["TeethDownRight"];
            cases.Sex            = "男";
            if (Sex == "1")
            {
                cases.Sex = "女";
            }

            cases.Checkup          = Checkup;
            cases.Treatment        = Treatment;
            cases.Cost             = decimal.Parse(Cost);
            cases.IsWear           = false || IsWear == "0";
            cases.MaterialCategory = _material.Get(MaterialCategory);
            _outpatientCases.Add(cases);
            return(JumpUrl("List", "系统设置-材料类别-创建成功!"));
        }
예제 #2
0
        public ActionResult Edit(OutpatientCases oc)
        {
            var old = _outpatientCases.Get(oc.OutpatientCasesId);

            //old.Title = article.Title;
            //old.Body = article.Body.Replace(" ", "&nbsp").Replace("\r\n", "<br />"); ;
            //old.ManagerName = _simpleAccount.GetUserElement().Name;
            //old.IsDraft = article.IsDraft;
            //old.IsRelease = old.IsDraft == 0 ? 1 : 0;

            _outpatientCases.Update(old);
            return(JumpUrl("List", "编辑成功!"));
        }
예제 #3
0
 public void Update(OutpatientCases oc)
 {
     _appDbContext.Entry(oc).State = EntityState.Modified;
     _appDbContext.SaveChanges();
 }
예제 #4
0
 public void Add(OutpatientCases oc)
 {
     _appDbContext.OutpatientCases.Add(oc);
     _appDbContext.SaveChanges();
 }