Example #1
0
        public OtherOutReport(string FromDate, string ToDate, string FromTime, string ToTime, string FromTrafficNumber, string ToTrafficNumber)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            FromDatetxt.Text = FromDate;
            ToDatetxt.Text   = ToDate;

            HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
            DataTable TrafficDataTable = new DataTable();
            string    Condition        = string.Empty;

            //if (!(string.IsNullOrEmpty(FromTrafficNumber) && string.IsNullOrEmpty(ToTrafficNumber)) && (string.IsNullOrEmpty(FromTime) && string.IsNullOrEmpty(ToTime)))
            //{
            //    Condition = "(T.In_bit='False') AND (T.TrafficTypeID_int<>'1') AND (T.TrafficTypeID_int<>'2')  AND (T.Date_nvc>='" + FromDatetxt.Text + "') AND (T.Date_nvc<='" + ToDate + "') AND (T.Time_nvc>='" + FromTime + "') AND (T.Time_nvc<='" + ToTime + "') AND (T.TrafficNumber_bint>='" + FromTrafficNumber + "') AND (T.TrafficNumber_bint<='" + ToTrafficNumber + "')";
            //}
            //if (string.IsNullOrEmpty(FromTrafficNumber) && string.IsNullOrEmpty(ToTrafficNumber) && !((string.IsNullOrEmpty(FromTrafficNumber) && string.IsNullOrEmpty(ToTrafficNumber))))
            //{
            //    Condition = "(T.In_bit='False') AND (T.TrafficTypeID_int<>'1') AND (T.TrafficTypeID_int<>'2')  AND (T.Date_nvc>='" + FromDate + "') AND (T.Date_nvc<='" + ToDate + "') AND (T.Time_nvc>='" + FromTime + "') AND (T.Time_nvc<='" + ToTime + "')";
            //}
            //else if (string.IsNullOrEmpty(FromTime) && string.IsNullOrEmpty(ToTime) || (string.IsNullOrEmpty(FromTrafficNumber) && string.IsNullOrEmpty(ToTrafficNumber)))
            //{
            //    Condition = "(T.In_bit='False') AND (T.TrafficTypeID_int<>'1') AND (T.TrafficTypeID_int<>'2')  AND (T.Date_nvc>='" + FromDate + "') AND (T.Date_nvc<='" + ToDate + "')";
            //}

            if (!(string.IsNullOrEmpty(FromTrafficNumber) && string.IsNullOrEmpty(ToTrafficNumber)) && (string.IsNullOrEmpty(FromTime) && string.IsNullOrEmpty(ToTime)))
            {
                Condition = "(T.In_bit='False') AND (T.TrafficTypeID_int<>'1') AND (T.TrafficTypeID_int<>'2') AND (T.Date_nvc>='" + FromDate + "') AND (T.Date_nvc<='" + ToDate + "') AND (T.TrafficNumber_bint>='" + FromTrafficNumber + "') AND (T.TrafficNumber_bint<='" + ToTrafficNumber + "')";
            }
            else if (string.IsNullOrEmpty(FromTime) && string.IsNullOrEmpty(ToTime) && (string.IsNullOrEmpty(FromTrafficNumber) && string.IsNullOrEmpty(ToTrafficNumber)))
            {
                Condition = "(T.In_bit='False') AND (T.TrafficTypeID_int<>'1') AND (T.TrafficTypeID_int<>'2') AND (T.Date_nvc>='" + FromDate + "') AND (T.Date_nvc<='" + ToDate + "')";
            }
            else if (!(string.IsNullOrEmpty(FromTime) && string.IsNullOrEmpty(ToTime)) && string.IsNullOrEmpty(FromTrafficNumber) && string.IsNullOrEmpty(ToTrafficNumber))
            {
                Condition = "(T.In_bit='False') AND (T.TrafficTypeID_int<>'1') AND (T.TrafficTypeID_int<>'2') AND (T.Date_nvc+ ' ' +T.Time_nvc>='" + FromDate + ' ' + FromTime + "' ) AND (T.Date_nvc + ' ' + T.Time_nvc<='" + ToDate + ' ' + ToTime + "')";
            }

            else if (!((string.IsNullOrEmpty(FromTime) && string.IsNullOrEmpty(ToTime)) && string.IsNullOrEmpty(FromTrafficNumber) && string.IsNullOrEmpty(ToTrafficNumber)))
            {
                Condition = "(T.In_bit='False') AND (T.TrafficTypeID_int<>'1') AND (T.TrafficTypeID_int<>'2') AND (T.Date_nvc + ' ' + T.Time_nvc>='" + FromDate + ' ' + FromTime + "' ) AND (T.Date_nvc + ' ' + T.Time_nvc<='" + ToDate + ' ' + ToTime + "') AND (T.TrafficNumber_bint>='" + FromTrafficNumber + "') AND (T.TrafficNumber_bint<='" + ToTrafficNumber + "')";
            }
            TrafficFactory.GetAllByConditionAllTraffic(Condition, ref TrafficDataTable);
            this.DataSource              = TrafficDataTable;
            Datetxt.DataField            = "Date_nvc";
            Timetxt.DataField            = "Time_nvc";
            TrafficNumbertxt.DataField   = "TrafficNumber_bint";
            NumberPlateTextBox.DataField = "NumberPlate_nvc";
            PlateCitytxt.DataField       = "PlateCityID_intPlateCity_nvc";
            SerialPlateTextBox.DataField = "SerialPlate_nvc";
            Pricetxt.DataField           = "Price_dec";
            Usertxt.DataField            = "UserName_nvc";
            AllPricetxt.DataField        = "Price_dec";
            DateTextBox.Text             = TrafficFactory.ServerJalaliDate;
            TimeTextBox.Text             = TrafficFactory.ServerTime;
            UserNameTextBox.Text         = HPS.Common.CurrentUser.user.UserName_nvc;
        }
Example #2
0
        public CarAllTrafficReport(string FromDate, string Todate, string NumberPlate, string SerialPlate, string CarCardNumber)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            FromDatetxt.Text      = FromDate;
            ToDatetxt.Text        = Todate;
            CarCardNumbertxt.Text = CarCardNumber;
            UserNameTextBox.Text  = HPS.Common.CurrentUser.user.UserName_nvc;

            HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
            string TrafficCondition = string.Empty;

            if (!string.IsNullOrEmpty(NumberPlate) && !string.IsNullOrEmpty(SerialPlate))
            {
                TrafficCondition += string.Format(" T.NumberPlate_nvc='{0}' AND T.SerialPlate_nvc='{1}' ", NumberPlate, SerialPlate);

                if (!string.IsNullOrEmpty(CarCardNumber))
                {
                    TrafficCondition += string.Format(" AND T.CarCardNumber_nvc={0} ", CarCardNumber);
                }
            }
            else if (!string.IsNullOrEmpty(CarCardNumber))
            {
                TrafficCondition += string.Format(" T.CarCardNumber_nvc={0} ", CarCardNumber);
            }

            if (!string.IsNullOrEmpty(FromDate) && !string.IsNullOrEmpty(Todate))
            {
                TrafficCondition += string.Format(" AND T.Date_nvc>='{0}' AND T.Date_nvc<='{1}' ", FromDate, Todate);
            }
            DataTable CarTrafficDatatable = new DataTable();

            TrafficFactory.GetAllByConditionAllTraffic(TrafficCondition, ref CarTrafficDatatable);
            this.DataSource  = CarTrafficDatatable;
            DateTextBox.Text = TrafficFactory.ServerJalaliDate;
            TimeTextBox.Text = TrafficFactory.ServerTime;


            Datetxt.DataField             = "Date_nvc";
            Timetxt.DataField             = "Time_nvc";
            InTextTextBox.DataField       = "InText";
            TurnNumbertxt.DataField       = "TurnNumber_bint";
            TrafficNumbertxt.DataField    = "TrafficNumber_bint";
            DriverCardNumbertxt.DataField = "DriverCardNumber_nvc";
            FullNameTextBox.DataField     = "FullName_nvc";
            //FirstNameTextBox.DataField = "FirstName_nvc";
            //LastNameTextBox.DataField = "LastName_nvc";
            Pricetxt.DataField      = "Price_dec";
            Usertxt.DataField       = "UserName_nvc";
            PlateTypetxt.DataField  = "PlateType_nvc";
            NumberPlateTextBox.Text = NumberPlate + "-";
            SerialPlateTextBox.Text = SerialPlate;
            AllPricetxt.DataField   = "Price_dec";
        }
Example #3
0
        private void LoadCarTraffic()
        {
            HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
            string    TrafficCondition    = "([T].[NumberPlate_nvc]= '" + NumberPlate + "')  AND ([T].[SerialPlate_nvc]='" + SerialPlate + "') AND ([T].[PlateCityID_int]= '" + PlateCityID + "')";
            DataTable CarTrafficDatatable = new DataTable();

            TrafficFactory.GetAllByConditionAllTraffic(TrafficCondition, ref CarTrafficDatatable);
            CarTrafficGridView.DataSource = CarTrafficDatatable;
        }
Example #4
0
        private void LoadDriverTraffic()
        {
            HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
            string    TrafficCondition       = "[T].[DriverCardNumber_nvc]= '" + DriverCardNumber + "'";
            DataTable DriverTrafficDatatable = new DataTable();

            TrafficFactory.GetAllByConditionAllTraffic(TrafficCondition, ref DriverTrafficDatatable);
            DriverTrafficGridView.DataSource = DriverTrafficDatatable;
        }
Example #5
0
        public ForeignInTrafficReport(string FromDate, string ToDate, int TrafficType, string FromTime, string ToTime, string FromTrafficNumber, string ToTrafficNumber)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            FromDatetxt.Text = FromDate;
            ToDatetxt.Text   = ToDate;

            HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
            DataTable TrafficDataTable = new DataTable();
            string    Condition        = string.Empty;

            if (!(string.IsNullOrEmpty(FromTrafficNumber) && string.IsNullOrEmpty(ToTrafficNumber)) && (string.IsNullOrEmpty(FromTime) && string.IsNullOrEmpty(ToTime)))
            {
                Condition = "(T.In_bit='True') AND (T.TrafficTypeID_int='2') AND (T.Date_nvc>='" + FromDate + "') AND (T.Date_nvc<='" + ToDate + "') AND (T.TrafficNumber_bint>='" + FromTrafficNumber + "') AND (T.TrafficNumber_bint<='" + ToTrafficNumber + "')";
            }
            else if (string.IsNullOrEmpty(FromTime) && string.IsNullOrEmpty(ToTime) && (string.IsNullOrEmpty(FromTrafficNumber) && string.IsNullOrEmpty(ToTrafficNumber)))
            {
                Condition = "(T.In_bit='True') AND (T.TrafficTypeID_int='2') AND (T.Date_nvc>='" + FromDate + "') AND (T.Date_nvc<='" + ToDate + "')";
            }
            else if (!(string.IsNullOrEmpty(FromTime) && string.IsNullOrEmpty(ToTime)) && string.IsNullOrEmpty(FromTrafficNumber) && string.IsNullOrEmpty(ToTrafficNumber))
            {
                Condition = "(T.In_bit='True') AND (T.TrafficTypeID_int='2') AND (T.Date_nvc+ ' ' +T.Time_nvc>='" + FromDate + ' ' + FromTime + "' ) AND (T.Date_nvc + ' ' + T.Time_nvc<='" + ToDate + ' ' + ToTime + "')";
            }

            else if (!((string.IsNullOrEmpty(FromTime) && string.IsNullOrEmpty(ToTime)) && string.IsNullOrEmpty(FromTrafficNumber) && string.IsNullOrEmpty(ToTrafficNumber)))
            {
                Condition = "(T.In_bit='True') AND (T.TrafficTypeID_int='2') AND (T.Date_nvc + ' ' + T.Time_nvc>='" + FromDate + ' ' + FromTime + "' ) AND (T.Date_nvc + ' ' + T.Time_nvc<='" + ToDate + ' ' + ToTime + "') AND (T.TrafficNumber_bint>='" + FromTrafficNumber + "') AND (T.TrafficNumber_bint<='" + ToTrafficNumber + "')";
            }
            TrafficFactory.GetAllByConditionAllTraffic(Condition, ref TrafficDataTable);
            this.DataSource              = TrafficDataTable;
            Datetxt.DataField            = "Date_nvc";
            Timetxt.DataField            = "Time_nvc";
            TrafficNumbertxt.DataField   = "TrafficNumber_bint";
            NumberPlateTextBox.DataField = "NumberPlate_nvc";
            SerialPlateTextBox.DataField = "SerialPlate_nvc";
            Pricetxt.DataField           = "Price_dec";
            Usertxt.DataField            = "UserName_nvc";
            FirstNametxt.DataField       = "FirstName_nvc";
            LastNametxt.DataField        = "LastName_nvc";
            WithLadeChkBox.DataField     = "WithLade_bit";
            Services_nvctxt.DataField    = "ServiceID_intServiceType_nvc";
            DateTextBox.Text             = TrafficFactory.ServerJalaliDate;
            TimeTextBox.Text             = TrafficFactory.ServerTime;
            UserNameTextBox.Text         = HPS.Common.CurrentUser.user.UserName_nvc;

            decimal?AllPrice = (from row in TrafficDataTable.AsEnumerable() select(decimal) row["Price_dec"]).Sum();

            AllPricetxt.Text = AllPrice.HasValue ? AllPrice.ToString() : "0";

            decimal?Allcount = (from row in TrafficDataTable.AsEnumerable() select(decimal?) row["Price_dec"]).Count();

            AllCounttxt.Text = Allcount.HasValue ? Allcount.ToString() : "0";
        }