示例#1
0
 /// <summary>
 /// [Son.Vo] - Lấy dữ liệu Discipline(Hre_Discipline) theo Id
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public Hre_DisciplineModel GetById(Guid id)
 {
     string status = string.Empty;
     var model = new Hre_DisciplineModel();
     ActionService service = new ActionService(UserLogin);
     //var entity = service.GetByIdUseStore<Hre_DisciplineEntity>(id, ConstantSql.hrm_hr_sp_get_DisciplineById, ref status);
     var entity = service.GetData<Hre_DisciplineEntity>(Common.DotNetToOracle(id.ToString()), ConstantSql.hrm_hr_sp_get_DisciplineById, ref status).FirstOrDefault();
     if (entity != null)
     {
         model = entity.CopyData<Hre_DisciplineModel>();
     }
     model.ActionStatus = status;
     return model;
 }
示例#2
0
 public ActionResult Edit([DataSourceRequest] DataSourceRequest request, Hre_DisciplineModel Discipline)
 {
     //var isAccess = CheckPermission(UserId, PrivilegeType.Modify, ConstantPermission.Hre_Discipline);
     //if (!isAccess)
     //{
     //    return PartialView("AccessDenied");
     //}
     if (ModelState.IsValid)
     {
         var service = new RestServiceClient<Hre_DisciplineModel>(UserLogin);
         service.SetCookies(this.Request.Cookies, _hrm_Hr_Service);
         var result = service.Put(_hrm_Hr_Service, "api/Hre_Discipline/", Discipline);
         //return Json(result);
         ViewBag.MsgUpdate = "Update success";
     }
     return View();
 }
示例#3
0
 public ActionResult Create(Hre_DisciplineModel model)
 {
     //var isAccess = CheckPermission(UserId, PrivilegeType.Create, ConstantPermission.Hre_Discipline);
     //if (!isAccess)
     //{
     //    return PartialView("AccessDenied");
     //}
     //if (ModelState.IsValid)
     //{
         var service = new RestServiceClient<Hre_DisciplineModel>(UserLogin);
         service.SetCookies(this.Request.Cookies, _hrm_Hr_Service);
         var result = service.Put(_hrm_Hr_Service, "api/Hre_Discipline/", model);
         ViewBag.MsgInsert = "Insert success";
     //}
     return View();
 }