예제 #1
0
        public ActionResult EditMehvar(Mehvar model)
        {
            try
            {
                var objmehvar = new Mehvar
                {
                    Name = model.Name,
                    PositiveModality = model.PositiveModality,
                    SystemType = model.SystemType,
                    MehvarId = model.MehvarId

                };
                _mehvarRepository.Update(objmehvar);
                _success = _mehvarRepository.Save();
                return new HttpStatusCodeResult(HttpStatusCode.Created);  // OK = 200
            }
            catch
            {
                return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
        }
예제 #2
0
        public JsonResult Edit(string id)
        {
           var objMehvar = new Mehvar();
            try
            {
                objMehvar = _mehvarRepository.SelectByID(Convert.ToInt64(id));
                
                return Json(objMehvar, JsonRequestBehavior.AllowGet);
            }
            catch (Exception ex)
            {

            }
            return Json(objMehvar, JsonRequestBehavior.AllowGet);
        }