/// <summary> /// Tạo mời một Uniform /// </summary> /// <param name="model"></param> /// <returns></returns> public ActionResult Add([Bind] Hre_UniformModel model) { var service = new RestServiceClient <Hre_UniformModel>(UserLogin); service.SetCookies(this.Request.Cookies, _hrm_Hr_Service); var result = service.Put(_hrm_Hr_Service, "api/Hre_Uniform/", model); return(Json(result)); }
public ActionResult Create(Hre_UniformModel model) { if (ModelState.IsValid) { var service = new RestServiceClient <Hre_UniformModel>(UserLogin); service.SetCookies(this.Request.Cookies, _hrm_Hr_Service); var result = service.Put(_hrm_Hr_Service, "api/Hre_Uniform/", model); ViewBag.MsgInsert = ConstantDisplay.HRM_Hr_Uniform_CreateSuccess.TranslateString(); } return(View()); }
public ActionResult Edit([DataSourceRequest] DataSourceRequest request, Hre_UniformModel Uniform) { if (ModelState.IsValid) { var service = new RestServiceClient <Hre_UniformModel>(UserLogin); service.SetCookies(this.Request.Cookies, _hrm_Hr_Service); var result = service.Put(_hrm_Hr_Service, "api/Hre_Uniform/", Uniform); ViewBag.MsgUpdate = ConstantDisplay.HRM_Hr_Uniform_UpdateSuccess.TranslateString(); } return(View()); }
/// <summary> /// [Son.Vo] - Lấy dữ liệu Uniform(Hre_Uniform) theo Id /// </summary> /// <param name="id"></param> /// <returns></returns> public Hre_UniformModel GetById(Guid id) { string status = string.Empty; var model = new Hre_UniformModel(); ActionService service = new ActionService(UserLogin); //var entity = service.GetByIdUseStore<Hre_UniformEntity>(id, ConstantSql.hrm_hr_sp_get_UniformById, ref status); var entity = service.GetData <Hre_UniformEntity>(Common.DotNetToOracle(id.ToString()), ConstantSql.hrm_hr_sp_get_UniformById, ref status).FirstOrDefault(); if (entity != null) { model = entity.CopyData <Hre_UniformModel>(); } model.ActionStatus = status; return(model); }
public Hre_UniformModel Post([Bind] Hre_UniformModel model) { #region Validate string message = string.Empty; var checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <Hre_UniformModel>(model, "Hre_Uniform", ref message); if (!checkValidate) { model.ActionStatus = message; return(model); } #endregion ActionService service = new ActionService(UserLogin); return(service.UpdateOrCreate <Hre_UniformEntity, Hre_UniformModel>(model)); }