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