示例#1
0
        public Decimal GetAverageTurnOverMonthGreaterThanDateByCustomer(DateTime date, CustomerObject customer)
        {
            TurnOverObjectCollection turnOvers;
            Decimal turnOver = 0;

            try
            {
                if (customer == null)
                {
                    turnOvers = new TurnOverDataService().GetByGreaterThanDate(date);
                }
                else
                {
                    turnOvers = new TurnOverDataService().GetByCustomerGreaterThanDate(customer, date);
                }

                for (int i = 0; i < turnOvers.Count; i++)
                {
                    turnOver += turnOvers[i].TurnOver;
                }
                decimal months = Math.Round(Convert.ToDecimal(System.DateTime.Now.Subtract(date).TotalDays) / Convert.ToDecimal(30.5), 0);
                turnOver = turnOver / months;
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(turnOver);
        }
示例#2
0
        //public TurnOverObjectCollection GetByYear()
        //{
        //    TurnOverObjectCollection turnOvers;
        //    try
        //    {
        //        turnOvers = new TurnOverDataService().GetAll();
        //    }
        //    catch (System.Exception exception1)
        //    {
        //        System.Exception innerException = exception1;
        //        throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
        //    }
        //    return turnOvers;
        //}

        public string[] GetVehicles()
        {
            string[] vehicles;
            try
            {
                vehicles = new TurnOverDataService().GetVehicles();
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(vehicles);
        }
示例#3
0
        public TurnOverObjectCollection GetByCustomer(CustomerObject customer)
        {
            TurnOverObjectCollection turnOvers;

            try
            {
                turnOvers = new TurnOverDataService().GetByCustomer(customer);
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(turnOvers);
        }
示例#4
0
        public Decimal GetAverageTurnOverMonthByYear(int year)
        {
            Decimal turnOver;

            try
            {
                turnOver = new TurnOverDataService().GetAverageTurnOverMonthByYear(year);
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(turnOver);
        }
示例#5
0
        public TurnOverObjectCollection GetByMonth(int year, int month)
        {
            TurnOverObjectCollection turnOvers;

            try
            {
                turnOvers = new TurnOverDataService().GetByMonth(year, month);
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(turnOvers);
        }
示例#6
0
        public TurnOverObjectCollection GetByVehicleGreaterThanDate(DateTime date, string vehicle)
        {
            TurnOverObjectCollection turnOvers;

            try
            {
                turnOvers = new TurnOverDataService().GetByVehicleGreaterThanDate(date, vehicle);
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(turnOvers);
        }
示例#7
0
        public TurnOverObjectCollection GetByVehicleByYear(int year, string vehicle)
        {
            TurnOverObjectCollection turnOvers;

            try
            {
                turnOvers = new TurnOverDataService().GetByVehicleByYear(year, vehicle);
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(turnOvers);
        }
示例#8
0
        public Decimal GetTurnOverByYearByCustomer(CustomerObject customer, int year)
        {
            Decimal turnOver = 0;

            try
            {
                if (customer != null)
                {
                    turnOver = new TurnOverDataService().GetTurnOverByYearByCustomer(customer, year);
                }
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(turnOver);
        }
示例#9
0
        public TurnOverObjectCollection GetByYear(int year, CustomerObject customer)
        {
            TurnOverObjectCollection turnOvers;

            try
            {
                if (customer == null)
                {
                    turnOvers = new TurnOverDataService().GetByYear(year);
                }
                else
                {
                    turnOvers = new TurnOverDataService().GetByCustomerByYear(customer, year);
                }
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(turnOvers);
        }
示例#10
0
        public TurnOverObjectCollection GetByCustomerGreaterThanDate(DateTime date, CustomerObject customer)
        {
            TurnOverObjectCollection turnOvers;

            try
            {
                if (customer == null)
                {
                    turnOvers = new TurnOverDataService().GetByGreaterThanDate(date);
                }
                else
                {
                    turnOvers = new TurnOverDataService().GetByCustomerGreaterThanDate(customer, date);
                }
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(turnOvers);
        }