public CostCodeModel SaveCostCode(CostCodeModel objCostCodeModel) { var objCostCodeRepository = new CostCodeRepository(); var objCostCode = new CostCode(); string action = ""; if (objCostCodeModel.CostCodeId == 0 && objCostCodeModel.CostCode == null) { action = "I"; var saveMasterCostCode = _workorderems.spSetCostCodeMaster(action, objCostCodeModel.QuickBookCostCodeMasterId, objCostCodeModel.CostCode, objCostCodeModel.Description, objCostCodeModel.ModifiedBy, objCostCodeModel.ApprovedBy, objCostCodeModel.IsActive); objCostCodeModel.Result = Result.Completed; } else if (objCostCodeModel.CostCode != null) { action = "I"; var saveMasterCostCode = _workorderems.spSetCostCode(action, objCostCodeModel.QuickBookCostCodeId, null, objCostCodeModel.CostCode, objCostCodeModel.Description, null, objCostCodeModel.ModifiedBy, objCostCodeModel.ApprovedBy, objCostCodeModel.IsActive); objCostCodeModel.Result = Result.Completed; } else { action = "U"; var saveMasterCostCode = _workorderems.spSetCostCodeMaster(action, null, objCostCodeModel.CostCode, objCostCodeModel.Description, objCostCodeModel.ModifiedBy, objCostCodeModel.ApprovedBy, objCostCodeModel.IsActive); objCostCodeModel.Result = Result.UpdatedSuccessfully; } return(objCostCodeModel); }
protected override async Task Handle(Request request, CancellationToken cancellationToken) { var aggregate = new CostCode(request.CodeCodeId.Value, request.CommonName, request.UniqueIdentifier); await session.Add(aggregate); await session.Commit(); }
public override void Selected(UIPickerView pickerView, nint row, nint component) { _selectedCostCode = _viewModel.CostCodes[_selectedJobType][(int)row]; if (_textField != null) { _textField.Text = _selectedCostCode.Description; } }
public CostCodePickerModel(ItemsViewModel viewModel, JobType selectedJobType) { _viewModel = viewModel; _selectedJobType = selectedJobType; if (viewModel.CostCodes.ContainsKey(selectedJobType) && viewModel.CostCodes.Count > 0) { _selectedCostCode = viewModel.CostCodes[selectedJobType][0]; } }
public IActionResult Put(int id, [FromBody] CostCode value) { if (value == null) { return(BadRequest()); } _repoWrapper.CostCode.Update(value); _repoWrapper.Save(); return(CreatedAtRoute("GetCostCode", new { Id = value.Id }, value)); }
public void SetSelectedJobType(JobType jobType) { _selectedJobType = jobType; if (_viewModel.CostCodes.ContainsKey(jobType)) { _selectedCostCode = _viewModel.CostCodes[jobType][0]; } else { _selectedCostCode = null; } }
public async Task <IActionResult> Create([FromBody] CostCodeCreateViewModel input) { var user = User.GetDetails(); var costCode = new CostCode(input.Code, input.Name, input.BHEmpCode, input.BH, input.ADGroup, input.ADEmpCode, input.Head, input.Status, user.Id); if (await _unitOfWork.CostCodes.AnyAsync(costCode)) { return(BadRequest("Cost Code Already Exists")); } _unitOfWork.CostCodes.Add(costCode); await _unitOfWork.CompleteAsync(user.Id); return(Ok(costCode)); }
public async Task <int> SaveCostCodeDetails(CostCodeViewModel costCodeViewModel) { CostCode costCodeItem = new CostCode { CostCodeId = costCodeViewModel.CostCodeId, CostCodeTitle = costCodeViewModel.CostCodeTitle ?? string.Empty, CostCategoryId = costCodeViewModel.CostCategoryId, CodeSubCodeId = costCodeViewModel.CodeSubCodeId, IsCostCodeActive = costCodeViewModel.IsCostCodeActive, IsTimeClockLabourCode = costCodeViewModel.IsTimeClockLabourCode, CostCodeDetails = costCodeViewModel.CostCodeDetails ?? string.Empty, DefaultLabourCode = costCodeViewModel.DefaultLabourCode }; var costCategoryObj = await _costCodeCategoryRespository.CreateAsync(costCodeItem); return(costCategoryObj.CostCategoryId); }
public void SetSelectedPickerObject(object o) { _selectedCostCode = (CostCode)o; }