示例#1
0
        public FIN_ClaimCostPaymentApproveModel GetById(Guid id)
        {
            string        status  = string.Empty;
            var           model   = new FIN_ClaimCostPaymentApproveModel();
            ActionService service = new ActionService(UserLogin);
            var           entity  = service.GetByIdUseStore <FIN_ClaimCostPaymentApproveEntity>(id, ConstantSql.hrm_hr_sp_get_ClaimById, ref status);

            if (entity != null)
            {
                model = entity.CopyData <FIN_ClaimCostPaymentApproveModel>();
                if (!string.IsNullOrEmpty(model.Other))
                {
                    model.IsOther = true;
                }
                else
                {
                    model.IsPaymentType = true;
                }

                if (model.IsCashAdvance != null && model.IsCashAdvance == false)
                {
                    model.IsNoneCashAdvance = true;
                }
                if (model.IsCashAdvance != null && model.IsCashAdvance == true)
                {
                    model.IsNoneCashAdvance = false;
                }
            }
            model.ActionStatus = status;
            return(model);
        }
示例#2
0
        public FIN_ClaimCostPaymentApproveModel Post([Bind] FIN_ClaimCostPaymentApproveModel model)
        {
            #region Validate

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

            #endregion
            ActionService service = new ActionService(UserLogin);
            if (!string.IsNullOrEmpty(model.Other))
            {
                model.IsCashAdvance   = null;
                model.CashAdvanceID   = null;
                model.TravelRequestID = null;
            }
            if (model.IsCashAdvance != null && model.IsCashAdvance == false)
            {
                model.CashAdvanceID = null;
            }
            return(service.UpdateOrCreate <FIN_ClaimCostPaymentApproveEntity, FIN_ClaimCostPaymentApproveModel>(model));
        }
 public ActionResult Create(FIN_ClaimCostPaymentApproveModel model)
 {
     if (ModelState.IsValid)
     {
         var service = new RestServiceClient <FIN_ClaimCostPaymentApproveModel>(UserLogin);
         service.SetCookies(this.Request.Cookies, _hrm_Hr_Service);
         var result = service.Put(_hrm_Hr_Service, "api/FIN_ClaimCostPaymentApprove/", model);
     }
     return(View());
 }