Example #1
0
 public JsonResult SaveDMLinhVuc()
 {
     try
     {
         using (MotCuaService = new MotCuaServiceClient())
         {
             var model = Request.Form["model"];
             var item  = JsonConvert.DeserializeObject <DM_LinhVuc>(model);
             if (Session["DMLinhVucID"] != null && Session["DMLinhVucID"].ToString() != "0")
             {
                 item.LinhVucID = Session["DMLinhVucID"].ToString().ToInt();
             }
             var response = MotCuaService.MotCua_DM_LinhVuc_Save(item);
             Session["DMLinhVucID"] = null;
             return(Json(response.StatusCode != HttpStatusCode.OK ? null : new { response.Content }, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception e)
     {
         Logger.Error(e.Message);
         Console.WriteLine(e);
         throw;
     }
 }