Ejemplo n.º 1
0
 public AllExpensesController(IAllExpenses allExpenses, IExpenseCategory expenseCategory, IUtilityCostsCategory utilityCostsCategory, ICostCategories costCategories)
 {
     _allExpenses          = allExpenses;
     _expenseCategory      = expenseCategory;
     _utilityCostsCategory = utilityCostsCategory;
     _costCategories       = costCategories;
 }
Ejemplo n.º 2
0
 public AdminController(
     IPriceTireFittingAdditionalServices priceTireFittingAdditionalServices,
     IGroupWashServices groupWashServices,
     IExpenseCategory expenseCategory,
     IUtilityCostsCategory utilityCostsCategory,
     ICostCategories costCategories)
 {
     _priceTireFittingAdditionalServices = priceTireFittingAdditionalServices;
     _groupWashServices    = groupWashServices;
     _costCategories       = costCategories;
     _expenseCategory      = expenseCategory;
     _utilityCostsCategory = utilityCostsCategory;
 }
        public void GetHouseTypeCategoryObject()
        {
            DomainFacade df = new DomainFacade();

            ICase c = df.CreateCase();
            List <ITechnicalSpecification> tspec = new List <ITechnicalSpecification>();

            IExpenseCategory   expenseCategory   = c.GetExpenseCategory(Category.HouseType);
            IHouseTypeExpenses houseTypeExpenses = (IHouseTypeExpenses)expenseCategory;

            Assert.AreEqual(typeof(IHouseTypeExpenses), houseTypeExpenses.GetType());
            Assert.AreNotEqual(null, expenseCategory);
        }
Ejemplo n.º 4
0
        public void PriceIsBaseWithoutAnySpecifiedExpenses()
        {
            ICase case1 = ObjectFactory.Instance.CreateNewCase();

            IExpenseCategory ec = case1.GetExpenseCategory(Comforthuse.Category.HouseType);


            IHouseTypeExpenses hte = (IHouseTypeExpenses)ec;

            hte.HouseType.TotalPrice = 123456;


            Assert.AreEqual(123456, case1.Price);
        }
Ejemplo n.º 5
0
 private void InsertTechnicalSpecifications(Dictionary <Category, IExpenseCategory> dictionary, int caseYear,
                                            int caseNumber)
 {
     DeleteCaseTechnicalSpecifications(caseYear, caseNumber);
     foreach (KeyValuePair <Category, IExpenseCategory> kvp in dictionary)
     {
         IExpenseCategory iec = kvp.Value;
         foreach (ITechnicalSpecification iees in iec.TechnicalSpecifications)
         {
             if (iees.Description != null)
             {
                 InsertTechnicalSpecification(iees.Description, iees.Editable, caseNumber, caseYear, kvp.Key.ToString());
             }
         }
     }
 }
Ejemplo n.º 6
0
        public void PriceChangeOnUpdatedPriceOfMaterial()
        {
            ICase case1 = ObjectFactory.Instance.CreateNewCase();

            IExpenseCategory ec = case1.GetExpenseCategory(Comforthuse.Category.CarportGarage);

            IExtraExpenseSpecification ees = new ExtraExpenseSpecification();

            ees.PricePerUnit = 10;
            ees.Amount       = 1;
            ec.ExtraExpenses.Add(ees);

            Assert.AreEqual(10, case1.Price);

            ees.PricePerUnit = 20;
            Assert.AreEqual(20, case1.Price);
        }
Ejemplo n.º 7
0
 private void InsertExtraExpenses(Dictionary <Category, IExpenseCategory> expenseCategories, int caseYear,
                                  int caseNumber)
 {
     DeleteCaseExtraExpenses(caseYear, caseNumber);
     foreach (KeyValuePair <Category, IExpenseCategory> kvp in expenseCategories)
     {
         IExpenseCategory iec      = kvp.Value;
         string           category = kvp.Key.ToString();
         foreach (IExtraExpenseSpecification iees in iec.ExtraExpenses)
         {
             if (iees.Title != "" && iees.Description != "" && iees.Amount != 0)
             {
                 InsertExtraExpense(iees.Description, iees.Amount, iees.PricePerUnit, caseNumber, caseYear,
                                    iees.Title, category);
             }
         }
     }
 }
Ejemplo n.º 8
0
        private void GetCaseDependencies(List <TempCase> tempCases)
        {
            foreach (TempCase tc in tempCases)
            {
                tc.Case.Customer = GetCustomerByEmail(tc.CustomerEmail);

                if (tc.MoneyInstituteId == null)
                {
                    tc.Case.MoneyInstitute = new MoneyInstitute();
                }
                else
                {
                    tc.Case.MoneyInstitute = GetMoneyInstituteById(Convert.ToInt32(tc.MoneyInstituteId));
                }

                if (tc.PlotId == null)
                {
                    tc.Case.Plot = ObjectFactory.Instance.CreatePlot();
                }
                else
                {
                    tc.Case.Plot = GetPlotById(Convert.ToInt32(tc.PlotId));
                }


                if (tc.ImageId == null)
                {
                    tc.Case.Image = new Image();
                }
                else
                {
                    tc.Case.Image = GetImageById(Convert.ToInt32(tc.ImageId));
                }

                IExpenseCategory   iec  = tc.Case.GetExpenseCategory(Category.HouseType);
                IHouseTypeExpenses ihte = (IHouseTypeExpenses)iec;
                ihte.HouseType = GetHouseType(tc);

                tc.Case.Employee = EmployeeRepository.Instance.Load(tc.EmployeeEmail);

                GetAllTechnicalSpecificationForCase(tc.Case);
                GetAllExtraExpenseForCase(tc.Case);
            }
        }
Ejemplo n.º 9
0
 public HouseTypeViewModel(IExpenseCategory expenseCategory)
 {
     // if(expenseCategory.Category == 0)
 }
Ejemplo n.º 10
0
 public CostsCarWashAndDeteylingController(ICostsCarWashAndDeteyling costsCarWashAndDeteyling, IExpenseCategory expenseCategory)
 {
     _costsCarWashAndDeteyling = costsCarWashAndDeteyling;
     _expenseCategory          = expenseCategory;
 }
Ejemplo n.º 11
0
 public OtherExpensesController(IOtherExpenses otherExpenses, IExpenseCategory expenseCategory)
 {
     _otherExpenses   = otherExpenses;
     _expenseCategory = expenseCategory;
 }
 public SalaryExpensesController(ISalaryExpenses salaryExpenses, IExpenseCategory expenseCategory, ICarWashWorkersServices carWashWorkers)
 {
     _salaryExpenses  = salaryExpenses;
     _expenseCategory = expenseCategory;
     _carWashWorkers  = carWashWorkers;
 }
Ejemplo n.º 13
0
 public UtilityCostsController(IUtilityCosts utilityCosts, IExpenseCategory expenseCategory)
 {
     _utilityCosts    = utilityCosts;
     _expenseCategory = expenseCategory;
 }