예제 #1
0
        public FIN_CashAdvanceModel Post([Bind] FIN_CashAdvanceModel model)
        {
            #region Validate

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

            #endregion
            ActionService service = new ActionService(UserLogin);
            if (!string.IsNullOrEmpty(model.Other))
            {
                model.IsEntertaiment  = null;
                model.TravelRequestID = null;
            }
            if (model.IsEntertaiment == true)
            {
                model.TravelRequestID = null;
            }

            return(service.UpdateOrCreate <Fin_CashAdvanceEntity, FIN_CashAdvanceModel>(model));
        }
예제 #2
0
 public ActionResult Create(FIN_CashAdvanceModel model)
 {
     if (ModelState.IsValid)
     {
         var service = new RestServiceClient <FIN_CashAdvanceModel>(UserLogin);
         service.SetCookies(this.Request.Cookies, _hrm_Hr_Service);
         var result = service.Put(_hrm_Hr_Service, "api/FIN_CashAdvance/", model);
     }
     return(View());
 }
예제 #3
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_CashAdvanceModel GetById(Guid id)
        {
            string        status  = string.Empty;
            var           model   = new FIN_CashAdvanceModel();
            ActionService service = new ActionService(UserLogin);
            var           entity  = service.GetByIdUseStore <Fin_CashAdvanceEntity>(id, ConstantSql.hrm_hr_sp_get_CashAdvanceById, ref status);

            if (entity != null)
            {
                model = entity.CopyData <FIN_CashAdvanceModel>();
                if (model.TravelRequestID != null)
                {
                    model.IsTravelRequest = true;
                }
                if (!string.IsNullOrEmpty(model.Other))
                {
                    model.IsOther = true;
                }
            }
            model.ActionStatus = status;
            return(model);
        }