Example #1
0
        private void LoadAllTraffic()
        {
            HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
            string    Condition        = "[T1].[TrafficTypeID_int]=1 AND T1.Date_nvc='" + TrafficFactory.ServerJalaliDate + "'";
            DataTable TrafficDataTable = new DataTable();

            TrafficFactory.GetAllByConditionAllInTrafficForTurnAcception(Condition, ref TrafficDataTable);
            this.TrafficGridView.DataSource = TrafficDataTable;
        }
Example #2
0
        private void AllTurntoolStripButton_Click(object sender, EventArgs e)
        {
            HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
            string    Condition        = "[T1].[TrafficTypeID_int]=1 ";
            DataTable TrafficDataTable = new DataTable();

            TrafficFactory.GetAllByConditionAllInTrafficForTurnAcception(Condition, ref TrafficDataTable);
            this.TrafficGridView.DataSource = TrafficDataTable;
        }
Example #3
0
        private void Search()
        {
            try
            {
                TrafficGridView.DataSource = null;

                DataTable TrafficDataTable = new DataTable();
                HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
                string Condition = string.Empty;
                if (!string.IsNullOrEmpty(TrafficNumberTextBox.Text))
                {
                    Condition = string.Format("[T1].[TrafficTypeID_int]=1  AND T1.TrafficNumber_bint={0} ", TrafficNumberTextBox.Text);
                }
                else if (!string.IsNullOrEmpty(TurnNumberTextBox.Text))
                {
                    Condition = string.Format("[T1].[TrafficTypeID_int]=1  AND T1.TurnNumber_bint={0} ", TurnNumberTextBox.Text);
                }
                else if (!string.IsNullOrEmpty(NumberPlate_nvcTextBox.Text) && !string.IsNullOrEmpty(SerialPlate_nvcTextBox.Text))
                {
                    Condition = string.Format("[T1].[TrafficTypeID_int]=1  AND T1.NumberPlate_nvc='{0}' AND T1.SerialPlate_nvc='{1}' ", NumberPlate_nvcTextBox.Text, SerialPlate_nvcTextBox.Text);
                }
                else
                {
                    Condition = string.Format("[T1].[TrafficTypeID_int]=1  AND T1.Date_nvc>='{0}' AND T1.Date_nvc<='{1}' ", FromDate_nvcTextBox.Text, ToDate_nvcTextBox.Text);
                }


                TrafficFactory.GetAllByConditionAllInTrafficForTurnAcception(Condition, ref TrafficDataTable);
                if (TrafficDataTable.Rows.Count > 0)
                {
                    this.TrafficGridView.DataSource = TrafficDataTable;
                }
                else
                {
                    this.TrafficGridView.DataSource = null;
                }
                if (TrafficDataTable.Rows.Count < 1)
                {
                    throw new ApplicationException("ناوگان مورد نظر یافت نشد");
                }
            }
            catch (System.Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }