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; }
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(); }