예제 #1
0
 public ActionResult Create(Can_CanteenModel model)
 {
     if (ModelState.IsValid)
     {
         var service = new RestServiceClient<Can_CanteenModel>(UserLogin);
         service.SetCookies(this.Request.Cookies, _hrm_Can_Service);
         var result = service.Put(_hrm_Can_Service, "api/Can_Canteen/", model);
         ViewBag.MsgInsert = ConstantDisplay.HRM_Canteen_Canteen_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_CanteenModel GetById(Guid id)
 {
     string status = string.Empty;
     var model = new Can_CanteenModel();
     ActionService service = new ActionService(UserLogin);
     var entity = service.GetData<Can_CanteenEntity>(id, ConstantSql.hrm_can_sp_get_canteenbyid, ref status).FirstOrDefault();
     if (entity != null)
     {
         model = entity.CopyData<Can_CanteenModel>();
     }
     model.ActionStatus = status;
     return model;
 }
예제 #3
0
 public ActionResult Edit([DataSourceRequest] DataSourceRequest request, Can_CanteenModel Can_Canteen)
 {
     if (ModelState.IsValid)
     {
         var service = new RestServiceClient<Can_CanteenModel>(UserLogin);
         service.SetCookies(this.Request.Cookies, _hrm_Can_Service);
         var result = service.Put(_hrm_Can_Service, "api/Can_Canteen/", Can_Canteen);
         //return Json(result);
         ViewBag.MsgUpdate = ConstantDisplay.HRM_Canteen_Canteen_UpdateSuccess.TranslateString();
     }
     return View();
 }