/// <summary> /// [Chuc.Nguyen] - Lấy dữ liệu bảng Tai Nạn(Hre_Accident) theo Id /// </summary> /// <param name="id"></param> /// <returns></returns> public Hre_PlanHeadCountModel GetById(Guid id) { string status = string.Empty; var model = new Hre_PlanHeadCountModel(); ActionService service = new ActionService(UserLogin); var entity = service.GetByIdUseStore<Hre_PlanHeadCountEntity>(id, ConstantSql.hrm_hr_sp_get_PlanHeadCountById, ref status); //var entity = service.GetData<Hre_PlanHeadCountEntity>(Common.DotNetToOracle(id.ToString()), ConstantSql.hrm_hr_sp_get_AccidentById, ref status).FirstOrDefault(); if (entity != null) { model = entity.CopyData<Hre_PlanHeadCountModel>(); } model.ActionStatus = status; return model; }
public ActionResult Create(Hre_PlanHeadCountModel model) { //var isAccess = CheckPermission(UserId, PrivilegeType.Create, ConstantPermission.Hre_PlanHeadCount); //if (!isAccess) //{ // return PartialView("AccessDenied"); //} if (ModelState.IsValid) { var service = new RestServiceClient<Hre_PlanHeadCountModel>(UserLogin); service.SetCookies(this.Request.Cookies, _hrm_Hr_Service); var result = service.Put(_hrm_Hr_Service, "api/Hre_PlanHeadCount/", model); ViewBag.MsgInsert = ConstantDisplay.HRM_HR_Accident_InsertSuccess.TranslateString(); } return View(); }
public ActionResult Edit([DataSourceRequest] DataSourceRequest request, Hre_PlanHeadCountModel Accident) { //var isAccess = CheckPermission(UserId, PrivilegeType.Modify, ConstantPermission.Hre_PlanHeadCount); //if (!isAccess) //{ // return PartialView("AccessDenied"); //} if (ModelState.IsValid) { var service = new RestServiceClient<Hre_PlanHeadCountModel>(UserLogin); service.SetCookies(this.Request.Cookies, _hrm_Hr_Service); var result = service.Put(_hrm_Hr_Service, "api/Hre_PlanHeadCount/", Accident); //return Json(result); ViewBag.MsgUpdate = ConstantDisplay.HRM_HR_Accident_UpdateSuccess.TranslateString(); } return View(); }