コード例 #1
0
ファイル: Hre_AddressController.cs プロジェクト: radtek/vnr
        /// <summary>
        /// Tạo mời một AttInOut
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ActionResult Add([Bind] Hre_AddressModel model)
        {
            //var isAccess = CheckPermission(UserId, PrivilegeType.Create, ConstantPermission.Hre_Address);
            //if (!isAccess)
            //{
            //    return PartialView("AccessDenied");
            //}
            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);

            return(Json(result));
        }
コード例 #2
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);
        }
コード例 #3
0
ファイル: Hre_AddressController.cs プロジェクト: radtek/vnr
 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());
 }
コード例 #4
0
        public Hre_AddressModel Post([Bind] Hre_AddressModel model)
        {
            ActionService service = new ActionService(UserLogin);

            return(service.UpdateOrCreate <Hre_AddressEntity, Hre_AddressModel>(model));
        }