コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: Create.cs プロジェクト: neekgreen/incentives
            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();
            }
コード例 #3
0
        public override void Selected(UIPickerView pickerView, nint row, nint component)
        {
            _selectedCostCode = _viewModel.CostCodes[_selectedJobType][(int)row];

            if (_textField != null)
            {
                _textField.Text = _selectedCostCode.Description;
            }
        }
コード例 #4
0
        public CostCodePickerModel(ItemsViewModel viewModel, JobType selectedJobType)
        {
            _viewModel       = viewModel;
            _selectedJobType = selectedJobType;

            if (viewModel.CostCodes.ContainsKey(selectedJobType) && viewModel.CostCodes.Count > 0)
            {
                _selectedCostCode = viewModel.CostCodes[selectedJobType][0];
            }
        }
コード例 #5
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));
        }
コード例 #6
0
 public void SetSelectedJobType(JobType jobType)
 {
     _selectedJobType = jobType;
     if (_viewModel.CostCodes.ContainsKey(jobType))
     {
         _selectedCostCode = _viewModel.CostCodes[jobType][0];
     }
     else
     {
         _selectedCostCode = null;
     }
 }
コード例 #7
0
        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));
        }
コード例 #8
0
        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);
        }
コード例 #9
0
 public void SetSelectedPickerObject(object o)
 {
     _selectedCostCode = (CostCode)o;
 }