/// <summary> /// [Tam.Le] - Lấy dữ liệu Location theo Id /// </summary> /// <param name="id"></param> /// <returns></returns> public Can_LocationModel GetById(Guid id) { string status = string.Empty; var model = new Can_LocationModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetData<Can_LocationEntity>(id, ConstantSql.hrm_can_sp_get_locationbyid, ref status).FirstOrDefault(); if (entity != null) { model = entity.CopyData<Can_LocationModel>(); } model.ActionStatus = status; return model; }
public ActionResult Create(Can_LocationModel model) { if (ModelState.IsValid) { var service = new RestServiceClient<Can_LocationModel>(UserLogin); service.SetCookies(this.Request.Cookies, _hrm_Can_Service); var result = service.Put(_hrm_Can_Service, "api/Can_Location/", model); ViewBag.MsgInsert = ConstantDisplay.HRM_Canteen_Location_InsertSuccess.TranslateString(); } return View(); }
public ActionResult Edit([DataSourceRequest] DataSourceRequest request, Can_LocationModel Can_Location) { if(ModelState.IsValid) { var service = new RestServiceClient<Can_LocationModel>(UserLogin); service.SetCookies(this.Request.Cookies, _hrm_Can_Service); var result = service.Put(_hrm_Can_Service, "api/Can_Location/", Can_Location); //return Json(result); ViewBag.MsgUpdate = ConstantDisplay.HRM_Canteen_Location_UpdateSuccess.TranslateString(); } return View(); }