public ActionResult Add([Bind] FIN_TravelRequestModel model)
        {
            var service = new RestServiceClient <FIN_TravelRequestModel>(UserLogin);

            service.SetCookies(this.Request.Cookies, _hrm_Hr_Service);
            var result = service.Put(_hrm_Hr_Service, "api/FIN_ApproveTravelCost/", model);

            return(Json(result));
        }
 public ActionResult Edit([DataSourceRequest] DataSourceRequest request, FIN_TravelRequestModel Contract)
 {
     if (ModelState.IsValid)
     {
         var service = new RestServiceClient <FIN_TravelRequestModel>(UserLogin);
         service.SetCookies(this.Request.Cookies, _hrm_Hr_Service);
         var result = service.Put(_hrm_Hr_Service, "api/FIN_ApproveTravelCost/", Contract);
         ViewBag.MsgUpdate = "Update success";
     }
     return(View());
 }
Esempio n. 3
0
 public ActionResult Create(FIN_TravelRequestModel model)
 {
     if (ModelState.IsValid)
     {
         var service = new RestServiceClient <FIN_TravelRequestModel>(UserLogin);
         service.SetCookies(this.Request.Cookies, _hrm_Hr_Service);
         var result = service.Put(_hrm_Hr_Service, "api/FIN_TravelRequest/", model);
         ViewBag.MsgInsert = "Insert success";
     }
     return(View());
 }
Esempio n. 4
0
        /// <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 FIN_TravelRequestModel GetById(Guid id)
        {
            string        status  = string.Empty;
            var           model   = new FIN_TravelRequestModel();
            ActionService service = new ActionService(UserLogin);
            var           entity  = service.GetByIdUseStore <FIN_TravelRequestEntity>(id, ConstantSql.hrm_hr_sp_get_TravelRequestById, ref status);

            if (entity != null)
            {
                model = entity.CopyData <FIN_TravelRequestModel>();
            }
            model.ActionStatus = status;
            return(model);
        }
Esempio n. 5
0
        public FIN_TravelRequestModel Post([Bind] FIN_TravelRequestModel model)
        {
            #region Validate

            string message       = string.Empty;
            var    checkValidate = HRM.Business.Main.Domain.ValidatorService.OnValidateData <FIN_TravelRequestModel>(model, "FIN_TravelRequest", ref message);
            if (!checkValidate)
            {
                model.ActionStatus = message;
                return(model);
            }

            #endregion
            ActionService service = new ActionService(UserLogin);
            return(service.UpdateOrCreate <FIN_TravelRequestEntity, FIN_TravelRequestModel>(model));
        }