示例#1
0
 public ActionResult Create(Can_CateringModel model)
 {
     if (ModelState.IsValid)
     {
         var service = new RestServiceClient<Can_CateringModel>(UserLogin);
         service.SetCookies(this.Request.Cookies, _hrm_Can_Service);
         var result = service.Put(_hrm_Can_Service, "api/Can_Catering/", model);
         ViewBag.MsgInsert = ConstantDisplay.HRM_Canteen_Catering_InsertSuccess.TranslateString();
     }
     return View();
 }
示例#2
0
 /// <summary>
 /// [Tam.Le] - Lấy dữ liệu Canteen theo Id
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public Can_CateringModel GetById(Guid id)
 {
     string status = string.Empty;
     var model = new Can_CateringModel();
     ActionService service = new ActionService(UserLogin);
     var entity = service.GetData<Can_CateringEntity>(id, ConstantSql.hrm_can_sp_get_cateringbyid, ref status).FirstOrDefault();
     if (entity != null)
     {
         model = entity.CopyData<Can_CateringModel>();
     }
     model.ActionStatus = status;
     return model;
 }
示例#3
0
 public ActionResult Edit([DataSourceRequest] DataSourceRequest request, Can_CateringModel Can_Catering)
 {
     if(ModelState.IsValid)
     {
         var service = new RestServiceClient<Can_CateringModel>(UserLogin);
         service.SetCookies(this.Request.Cookies, _hrm_Can_Service);
         var result = service.Put(_hrm_Can_Service, "api/Can_Catering/", Can_Catering);
         //return Json(result);
         ViewBag.MsgUpdate = ConstantDisplay.HRM_Canteen_Catering_UpdateSuccess.TranslateString();
     }
     return View();
 }