Пример #1
0
 /// <summary>
 /// [Son.Vo] - Lấy dữ liệu Địa Chỉ(Hre_Address) theo Id
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public Hre_AddressModel GetById(Guid id)
 {
     string status = string.Empty;
     var model = new Hre_AddressModel();
     ActionService service = new ActionService(UserLogin);
     //var entity = service.GetByIdUseStore<Hre_AddressEntity>(id, ConstantSql.hrm_hr_sp_get_AddressById, ref status);
     var entity = service.GetData<Hre_AddressEntity>(Common.DotNetToOracle(id.ToString()), ConstantSql.hrm_hr_sp_get_AddressById, ref status).FirstOrDefault();
     if (entity != null)
     {
         model = entity.CopyData<Hre_AddressModel>();
     }
     model.ActionStatus = status;
     return model;
 }
Пример #2
0
 public ActionResult Create(Hre_AddressModel model)
 {
     //var isAccess = CheckPermission(UserId, PrivilegeType.Create, ConstantPermission.Hre_Address);
     //if (!isAccess)
     //{
     //    return PartialView("AccessDenied");
     //}
     if (ModelState.IsValid)
     {
         var service = new RestServiceClient<Hre_AddressModel>(UserLogin);
         service.SetCookies(this.Request.Cookies, _hrm_Hr_Service);
         var result = service.Put(_hrm_Hr_Service, "api/Hre_Address/", model);
         ViewBag.MsgInsert = ConstantDisplay.HRM_Hr_Address_CreateSuccess.TranslateString();
     }
     return View();
 }