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(); }
/// <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; }
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(); }