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); }
public UnitOfWork(AppDbContext context) { _dbContext = context; Countries = new CountryRepository(context); BudgetHeads = new BudgetHeadRepository(context); CostCodes = new CostCodeRepository(context); Currencies = new CurrencyRepository(context); Divisions = new DivisionRepository(context); Budgets = new BudgetRepository(context); Employees = new EmployeeRepository(context); Vendors = new VendorRepository(context); NumberingSequences = new NumberingSequenceRepository(context); BudgetCategories = new BudgetCategoriesRepository(context); Departments = new DepartmentRepository(context); }