Ejemplo n.º 1
0
        private void CarLadeBillReportForm_Load(object sender, EventArgs e)
        {
            HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
            this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(TrafficFactory.ServerJalaliDate);
            this.ToDatefaDatePicker.SelectedDateTime   = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(TrafficFactory.ServerJalaliDate);

            HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory();
            DataTable LaderTypeDataTable = new DataTable();

            LaderTypeFactory.GetAll(ref LaderTypeDataTable);
            this.LaderTypecheckedComboBox.DropDownDataSource    = LaderTypeDataTable;
            this.LaderTypecheckedComboBox.DropDownDataMember    = "LaderType_T";
            this.LaderTypecheckedComboBox.DropDownDisplayMember = HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderType_nvc.ToString();
            this.LaderTypecheckedComboBox.DropDownValueMember   = HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeID_int.ToString();
            LaderTypecheckedComboBox.RetrieveStructure();
            LaderTypecheckedComboBox.DropDownList.Columns[1].Visible  = false;
            LaderTypecheckedComboBox.DropDownList.Columns[2].Visible  = false;
            LaderTypecheckedComboBox.DropDownList.Columns[4].Visible  = false;
            LaderTypecheckedComboBox.DropDownList.Columns[5].Visible  = false;
            LaderTypecheckedComboBox.DropDownList.Columns[6].Visible  = false;
            LaderTypecheckedComboBox.DropDownList.Columns[7].Visible  = false;
            LaderTypecheckedComboBox.DropDownList.Columns[8].Visible  = false;
            LaderTypecheckedComboBox.DropDownList.Columns[9].Visible  = false;
            LaderTypecheckedComboBox.DropDownList.Columns[3].Caption  = "نوع بارگیر";
            LaderTypecheckedComboBox.DropDownList.Columns[10].Caption = "تعداد محور";
            LaderTypecheckedComboBox.DropDownList.Columns[3].Width    = 300;
        }
Ejemplo n.º 2
0
 public AcceptedTurnNumberRemainedByLaderTypeCountReport(string FromDate, string ToDate)
 {
     //
     // Required for Windows Form Designer support
     //
     InitializeComponent();
     try
     {
         HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
         DataTable LaderTypeReportTable = new DataTable();
         TrafficFactory.SelectRemainedAcceptedTurnNumberByLaderTypeReport(FromDate, ToDate, LaderTypeReportTable);
         this.DataSource            = LaderTypeReportTable;
         FromDatetxt.Text           = FromDate;
         ToDatetxt.Text             = ToDate;
         UserNametxt.Text           = HPS.Common.CurrentUser.user.UserName_nvc;
         Datetxt.Text               = TrafficFactory.ServerJalaliDate;
         Timetxt.Text               = TrafficFactory.ServerTime;
         LaderType_nvctxt.DataField = "LaderType_nvc";
         Counttxt.DataField         = "RemainedCount_int";
         Int64?AllcountRecords = (from row in LaderTypeReportTable.AsEnumerable() select(Int32) row["RemainedCount_int"]).Sum();
         AllCounttxt.Text = AllcountRecords.HasValue ? AllcountRecords.ToString() : "0";
     }
     catch (Exception ex)
     {
         Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
     }
 }
Ejemplo n.º 3
0
        public ForeignInNotOutReport(string FromDate, string ToDate, int TrafficType)
        {
            //
            // 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        = "(T1.TrafficTypeID_int='2') AND (T1.Date_nvc>='" + FromDatetxt.Text + "') AND (T1.Date_nvc<='" + ToDate + "')";

            TrafficFactory.GetAllByConditionAllInTrafficNotTemporaryOut(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";
            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";
        }
Ejemplo n.º 4
0
        private void AllInfoByDateReportForm_Load(object sender, EventArgs e)
        {
            HPS.BLL.TrafficBLL.BLLTraffic_TFactory Factory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
            this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate);
            this.ToDatefaDatePicker.SelectedDateTime   = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate);
            //this.FromTimeTextBox.Text = "08:00:00";
            //this.ToTimeTextBox.Text = Factory.ServerTime.ToString();

            HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeID_intFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory();
            DataTable LaderTypeID_intDataTable = new DataTable();
            string    laderCondition           = "[LaderType_T].[Active_bit]='true'";

            LaderTypeID_intFactory.GetAllByCondition(laderCondition, ref LaderTypeID_intDataTable);
            laderTypeGrid.SetDataBinding(LaderTypeID_intDataTable, "LaderTypeID_intDataTable");

            //CompanyGroupComboBox Fill.
            HPS.BLL.CompanyGroupBLL.BLLCompanyGroup_TFactory GroupID_intFatory = new BLL.CompanyGroupBLL.BLLCompanyGroup_TFactory();
            DataTable GroupID_intDataTable = new DataTable();

            GroupID_intFatory.GetAll(ref GroupID_intDataTable);
            this.CompanyGroupComboBox.DisplayMember = "GroupName_nvc";
            this.CompanyGroupComboBox.ValueMember   = "GroupID_int";
            this.CompanyGroupComboBox.DataSource    = GroupID_intDataTable;
            this.CompanyGroupComboBox.SelectedIndex = -1;

            var    LadeAssignmentFactory = new BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory();
            string LastDate_vc           = string.Empty;

            LadeAssignmentFactory.SelectLastPerBarnameDate(out LastDate_vc);
            LastDateLabel.Text = LastDate_vc;
        }
Ejemplo n.º 5
0
        public AllInTrafficReport(string FromDate, string FromTime, string ToDate, string ToTime)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            try
            {
                HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
                DataTable LaderTypeReportTable = new DataTable();
                TrafficFactory.SelectAllInTrafficReport(FromDate, FromTime, ToDate, ToTime, ref LaderTypeReportTable);
                this.DataSource           = LaderTypeReportTable;
                FromDatetxt.Text          = FromDate;
                FromTimetxt.Text          = FromTime;
                ToDatetxt.Text            = ToDate;
                ToTimetxt.Text            = ToTime;
                UserNametxt.Text          = HPS.Common.CurrentUser.user.UserName_nvc;
                Datetxt.Text              = TrafficFactory.ServerJalaliDate;
                Timetxt.Text              = TrafficFactory.ServerTime;
                Cartxt.DataField          = "LaderType_nvc";
                Counttxt.DataField        = "Count_int";
                CountPercenttxt.DataField = "CountPercent";
                Pricetxt.DataField        = "Price_dec";
                PricePercenttxt.DataField = "PricePercent";
                Int64?AllcountRecords = (from row in LaderTypeReportTable.AsEnumerable() select(Int32) row["Count_int"]).Sum();
                AllCounttxt.Text = AllcountRecords.HasValue ? AllcountRecords.ToString() : "0";

                decimal?AllPriceRecords = (from row in LaderTypeReportTable.AsEnumerable() select(decimal) row["Price_dec"]).Sum();
                AllPricetxt.Text = AllPriceRecords.HasValue ? AllPriceRecords.ToString() : "0";
            }
            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
Ejemplo n.º 6
0
 private void PrinterSelectionButton_Click(object sender, EventArgs e)
 {
     ShowwithConditionbutton.Visible = true;
     HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
     this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(TrafficFactory.ServerJalaliDate);
     this.ToDatefaDatePicker.SelectedDateTime   = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(TrafficFactory.ServerJalaliDate);
 }
Ejemplo n.º 7
0
        private void TurnPrintStripButton_Click(object sender, EventArgs e)
        {
            try
            {
                HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_TFactory LadBillCreditFactory = new HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_TFactory();
                string condition = "LadBillCredit_T.TrafficID_bint='" + Hepsa.Core.Common.PersentationController.GetEntityValue(this.TrafficGridView.CurrentRow.Cells[colTrafficID_bint.Name].Value, TypeCode.Int64) + "' or (LadBillCredit_T.LadBillCreditID_int is not null and LadBillCredit_T.Canceled_bit=0 AND LadBillCredit_T.Turn_bit is not NULL)";
                List <HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_T> LadBillCreditList = LadBillCreditFactory.GetAllByCondition(condition);

                if (LadBillCreditList != null && LadBillCreditList.Count > 0)
                {
                    bool?ladturn = LadBillCreditList[LadBillCreditList.Count - 1].Turn_bit;
                    if (LadBillCreditList[LadBillCreditList.Count - 1].Canceled_bit == false || (LadBillCreditList[LadBillCreditList.Count - 1].Canceled_bit == true && ladturn == false))
                    {
                        throw new ApplicationException("نوبت مورد نظر مجوز گرفته است");
                    }
                }
                HPS.BLL.TurnManagementBLL.BLLTurnManagement_TFactory TurnManagementFactory = new HPS.BLL.TurnManagementBLL.BLLTurnManagement_TFactory();
                string    conditionTurnManagement = string.Format("TurnManagement_T.TrafficID_bint='{0}' ", Hepsa.Core.Common.PersentationController.GetEntityValue(this.TrafficGridView.CurrentRow.Cells[colTrafficID_bint.Name].Value, TypeCode.Int64));
                DataTable TurnManagementTable     = new DataTable();
                TurnManagementFactory.GetAllByCondition(conditionTurnManagement, ref TurnManagementTable);
                if (TurnManagementTable != null && TurnManagementTable.Rows.Count > 0)
                {
                    if (TurnManagementTable.Rows[TurnManagementTable.Rows.Count - 1]["Return_bit"].ToString() == "False")
                    {
                        throw new ApplicationException("نوبت مورد نظر باطل شده است");
                    }
                }

                //HPS.Reports.ReportDoc.AcceptedTurnReport rpt = new HPS.Reports.ReportDoc.AcceptedTurnReport((Int64)Hepsa.Core.Common.PersentationController.GetEntityValue(this.TrafficGridView.CurrentRow.Cells[colTrafficID_bint.Name].Value, TypeCode.Int64));
                //rpt.Document.Printer.PrinterName = string.Empty;
                //rpt.Run();

                //Properties.Settings s = new HPS.Properties.Settings();
                //if (string.IsNullOrEmpty(s.PrinterName))
                //{
                //    rpt.Document.Print(true, true, true);
                //}
                //else
                //{
                //    rpt.Document.Printer.PrinterName = s.PrinterName;
                //    rpt.Document.Print(false, true, true);
                //}
                ///


                HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory   = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
                HPS.BLL.TrafficBLL.BLLTraffic_TKeys    TrafficKey       = new HPS.BLL.TrafficBLL.BLLTraffic_TKeys();
                HPS.BLL.TrafficBLL.BLLTraffic_T        TrafficEntityrpt = new HPS.BLL.TrafficBLL.BLLTraffic_T();
                TrafficKey.TrafficID_bint = (Int64)Hepsa.Core.Common.PersentationController.GetEntityValue(this.TrafficGridView.CurrentRow.Cells[colTrafficID_bint.Name].Value, TypeCode.Int64);
                TrafficEntityrpt          = TrafficFactory.GetBy(TrafficKey);

                HPS.Reports.Forms.StimulViewer frm = new Reports.Forms.StimulViewer(TrafficEntityrpt, false, false);
                frm.ShowDialog();
                //
            }
            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
Ejemplo n.º 8
0
        private void PrintCanceledButton_Click(object sender, EventArgs e)
        {
            try
            {
                HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
                string Condition = string.Empty;
                AllCanceledTurnstiReport.Dictionary.Synchronize();
                AllCanceledTurnstiReport.Dictionary.Databases.Clear();
                AllCanceledTurnstiReport.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", Hepsa.Core.Common.ConnectionString.ConnectionString));
                AllCanceledTurnstiReport.Compile();
                AllCanceledTurnstiReport["organ"] = new HPS.BLL.SettingsBLL.BLLSetting_TFactory().GetBy(new BLL.SettingsBLL.BLLSetting_TKeys()
                {
                    SettingID_int = 1029
                }).Value_nvc.ToString();
                HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory PortPlaceFactory = new HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory();
                AllCanceledTurnstiReport["@FromDate_nvc"] = FromDatefaDatePicker.Text;
                AllCanceledTurnstiReport["@ToDate_nvc"]   = ToDatefaDatePicker.Text;
                AllCanceledTurnstiReport["@FromTime_nvc"] = FromTimeTextBox.Text;
                AllCanceledTurnstiReport["@ToTime_nvc"]   = ToTimeTextBox.Text;
                AllCanceledTurnstiReport["fromdate_vc"]   = FromDatefaDatePicker.Text;
                AllCanceledTurnstiReport["todate_vc"]     = ToDatefaDatePicker.Text;
                AllCanceledTurnstiReport["date_vc"]       = PortPlaceFactory.ServerJalaliDate + "   " + PortPlaceFactory.ServerTime;;
                AllCanceledTurnstiReport["UserName_vc"]   = HPS.Common.CurrentUser.user.UserName_nvc;

                AllCanceledTurnstiReport.Render();
                AllCanceledTurnstiReport.Show();
            }
            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
Ejemplo n.º 9
0
 private void AllOutTrafficReportForm_Load(object sender, EventArgs e)
 {
     HPS.BLL.TrafficBLL.BLLTraffic_TFactory Factory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
     //this.ToTimeTextBox.Text = Factory.ServerTime;
     this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate);
     this.ToDatefaDatePicker.SelectedDateTime   = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate);
 }
Ejemplo n.º 10
0
        private void ShowButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (FromDatefaDatePicker.IsNull)
                {
                    throw new ApplicationException("از تاریخ خالی است");
                }
                else if (ToDatefaDatePicker.IsNull)
                {
                    throw new ApplicationException("تا تاریخ خالی است");
                }
                Hepsa.Core.Validation.DateRule <string> FromDateValidator = new Hepsa.Core.Validation.DateRule <string>("FromDate", "از تاریخ", null, null);
                if (FromDateValidator.Validate(FromDatefaDatePicker.Text) == false)
                {
                    throw new ApplicationException(FromDateValidator.Description);
                }

                Hepsa.Core.Validation.DateRule <string> ToDateValidator = new Hepsa.Core.Validation.DateRule <string>("ToDate", "تا تاریخ", null, null);
                if (ToDateValidator.Validate(ToDatefaDatePicker.Text) == false)
                {
                    throw new ApplicationException(ToDateValidator.Description);
                }

                string Condition = string.Empty;
                if (WithProductionYear == true)
                {
                    Condition = "T1.TurnDate_nvc>='" + FromDatefaDatePicker + "' AND T1.TurnDate_nvc<='" + ToDatefaDatePicker.Text + "' And T1.Area_bit=1 AND T1.ProductionYear_int IS NOT NULL";
                }
                else
                {
                    Condition = "T1.TurnDate_nvc>='" + FromDatefaDatePicker.Text + "' AND T1.TurnDate_nvc<='" + ToDatefaDatePicker.Text + " And T1.Area_bit=1'";
                }
                if (!string.IsNullOrEmpty(AcceptedTurnNumber_binttextBox.Text))
                {
                    Condition = string.Format("  T1.AcceptedTurnNumber_bint={0} And T1.Area_bit=1 ", AcceptedTurnNumber_binttextBox.Text);
                }
                if (!string.IsNullOrEmpty(TrafficNumber_binttextBox.Text))
                {
                    Condition = string.Format("  T1.TrafficNumber_bint={0} And T1.Area_bit=1", TrafficNumber_binttextBox.Text);
                }
                if (!string.IsNullOrEmpty(NumberPlate_nvctextBox.Text) && !string.IsNullOrEmpty(SerialPlate_nvctextBox.Text))
                {
                    Condition = string.Format(" T1.NumberPlate_nvc ='{0}' AND T1.SerialPlate_nvc='{1}' And T1.Area_bit=1", NumberPlate_nvctextBox.Text, SerialPlate_nvctextBox.Text);
                }
                if (!string.IsNullOrEmpty(LastName_nvctextBox.Text))
                {
                    Condition = string.Format(" LastName_nvc LIKE '%{0}%' And T1.Area_bit=1", LastName_nvctextBox.Text);
                }
                HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
                DataTable TrafficDataTable = new DataTable();
                TrafficFactory.SelectAcceptedTurns(TrafficDataTable, Condition);
                this.TrafficGridView.DataSource = TrafficDataTable;
            }
            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
Ejemplo n.º 11
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;
        }
Ejemplo n.º 12
0
 private void AllInTrafficWithPriceReportForm_Load(object sender, EventArgs e)
 {
     HPS.BLL.TrafficBLL.BLLTraffic_TFactory factory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
     this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(factory.ServerJalaliDate);
     this.ToDatefaDatePicker.SelectedDateTime   = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(factory.ServerJalaliDate);
     //FromTimeTextBox.Text = "08:00:00";
     //ToTimeTextBox.Text = factory.ServerTime;
 }
Ejemplo n.º 13
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;
        }
Ejemplo n.º 14
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;
        }
Ejemplo n.º 15
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";
        }
Ejemplo n.º 16
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;
        }
Ejemplo n.º 17
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;
        }
Ejemplo n.º 18
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";
        }
Ejemplo n.º 19
0
        protected override void Edit()
        {
            try
            {
                if (TrafficGridView.CurrentRow != null && (Int64)TrafficGridView.CurrentRow.Cells[colTrafficID_bint.Name].Value != 0)
                {
                    HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
                    DataTable OutDataTable = new DataTable();
                    string    outcondition = "";
                    TrafficFactory.GetAllByConditionOut("", ref OutDataTable);
                    if ((Int64)TrafficGridView.CurrentRow.Cells[colTrafficID_bint.Name].Value != (Int64)TrafficGridView.CurrentRow.Cells[colMaxTrafficID_bint.Name].Value)
                    {
                        Hepsa.Core.Common.MessageBox.ErrorMessage("امکان احیای این خروج وجود ندارد ، این ناوگان ورود داشته است");
                        return;
                    }
                    if (Hepsa.Core.Common.MessageBox.ConfirmMessage("آیا از احیای این خروج اطمینان دارید؟") == true)
                    {
                        HPS.BLL.TrafficBLL.BLLTraffic_TFactory trafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
                        HPS.BLL.TrafficBLL.BLLTraffic_TKeys    trafficKey     = new HPS.BLL.TrafficBLL.BLLTraffic_TKeys();
                        trafficKey.TrafficID_bint = (Int64)TrafficGridView.CurrentRow.Cells[colTrafficID_bint.Name].Value;
                        string _LogBody = "<table border=\"1\">";
                        foreach (DataGridViewColumn col in TrafficGridView.Columns)
                        {
                            if (col.Visible)
                            {
                                _LogBody += string.Format("<tr><td>{0}</td><td>{1}</td></tr>", col.HeaderText, TrafficGridView.CurrentRow.Cells[col.Name].Value);
                            }
                        }
                        _LogBody += "</table>";

                        trafficFactory.BeginProc();
                        trafficFactory.Delete(trafficKey);
                        /********Start Logging********/
                        Hepsa.Core.BLL.BLLLog_TFactory LogFactory = new Hepsa.Core.BLL.BLLLog_TFactory();
                        Hepsa.Core.BLL.BLLLog_T        LogEntity  = new Hepsa.Core.BLL.BLLLog_T();
                        LogEntity.Date_nvc       = LogFactory.ServerJalaliDate;
                        LogEntity.Time_nvc       = LogFactory.ServerTime;
                        LogEntity.IPAddress_nvc  = Hepsa.Core.Common.ApplicationInfo.IpAddress;
                        LogEntity.MacAddress_nvc = Hepsa.Core.Common.ApplicationInfo.MacAddress;
                        LogEntity.UserName_nvc   = Hepsa.Core.Common.CurrentUser.User.UserName_nvc;
                        LogEntity.FormText_nvc   = String.IsNullOrEmpty(this.Text) ? this.Name : this.Text;
                        LogEntity.ActionID_int   = Convert.ToInt32(Hepsa.Core.BLL.BLLAction_T.Actions.Delete);
                        LogEntity.Body_nvc       = _LogBody;
                        LogFactory.Insert(LogEntity);
                        /********End Logging********/
                        trafficFactory.CommitProc();
                        this.LoadGrid();
                    }
                }
            }
            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
Ejemplo n.º 20
0
        private void Foreign()
        {
            HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
            TrafficCondition = "([Traffic_T].[NumberPlate_nvc]= '" + NumberPlate + "')  AND ([Traffic_T].[SerialPlate_nvc]=" + SerialPlate + ")";
            List <HPS.BLL.TrafficBLL.BLLTraffic_T> TrafficList = TrafficFactory.GetAllByCondition(TrafficCondition);

            if (TrafficList != null && TrafficList.Count > 0 && TrafficList[TrafficList.Count - 1].In_bit == true)
            {
                this.TrafficFields();
            }
        }
Ejemplo n.º 21
0
        private void LoadWithoutDriverCardNumber()
        {
            HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_TFactory DriverSpecificationFactory = new HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_TFactory();
            DataTable DriverFieldTable = new DataTable();

            DriverSpecificationFactory.SelectByDriverField(_FirstName, _LastName, _NationalCode, ref DriverFieldTable);
            if (DriverFieldTable != null && DriverFieldTable.Rows.Count > 0)
            {
                _DriverSpecificationID = (Int32)DriverFieldTable.Rows[0]["DriverSpecificationID_int"];
                Key = new HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_TKeys();
                Key.DriverSpecificationID_int       = _DriverSpecificationID;
                DriverCardNumber_nvcTextBox.Text    = DriverFieldTable.Rows[0]["DriverCardNumber_nvc"].ToString();
                FirstName_nvcTextBox.Text           = DriverFieldTable.Rows[0]["FirstName_nvc"].ToString();
                LastName_nvcTextBox.Text            = DriverFieldTable.Rows[0]["LastName_nvc"].ToString();
                NationalCode_intNumericTextBox.Text = DriverFieldTable.Rows[0]["NationalCode_int"].ToString();
                licenceNumber_nvcTextBox.Text       = DriverFieldTable.Rows[0]["licenceNumber_nvc"].ToString();

                LicenceEnd_nvcTextBox.Text            = DriverFieldTable.Rows[0]["LicenceEnd_nvc"].ToString();
                CarExaminationEndDate_nvcTextBox.Text = DriverFieldTable.Rows[0]["CarExaminationEndDate_nvc"].ToString();

                InsuranceEndDate_nvcTextBox.Text        = DriverFieldTable.Rows[0]["InsuranceEndDate_nvc"].ToString();
                ClassID_intComboBox.SelectedValue       = DriverFieldTable.Rows[0]["ClassID_int"];
                HealthCardEndDate_nvcTextBox.Text       = DriverFieldTable.Rows[0]["HealthCardEndDate_nvc"].ToString();
                DriverCardSharjeEndDate_nvcTextBox.Text = DriverFieldTable.Rows[0]["DriverCardSharjeEndDate_nvc"].ToString();
            }
            else
            {
                HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
                string Condition = "Traffic_T.FirstName_nvc=N'" + _FirstName + "' AND Traffic_T.LastName_nvc=N'" + _LastName + "' AND Traffic_T.NationalCode_int='" + _NationalCode + "'";
                List <HPS.BLL.TrafficBLL.BLLTraffic_T> TrafficList = TrafficFactory.GetAllByCondition(Condition);
                if (TrafficList != null && TrafficList.Count > 0)
                {
                    DriverCardNumber_nvcTextBox.Text    = TrafficList[TrafficList.Count - 1].DriverCardNumber_nvc;
                    FirstName_nvcTextBox.Text           = TrafficList[TrafficList.Count - 1].FirstName_nvc;
                    LastName_nvcTextBox.Text            = TrafficList[TrafficList.Count - 1].LastName_nvc;
                    NationalCode_intNumericTextBox.Text = Convert.ToString(TrafficList[TrafficList.Count - 1].NationalCode_int);
                    licenceNumber_nvcTextBox.Text       = Convert.ToString(TrafficList[TrafficList.Count - 1].licenceNumber_int);
                }
                else
                {
                    HPS.BLL.DriverBLL.BLLDriver_TFactory DriverFactory = new HPS.BLL.DriverBLL.BLLDriver_TFactory();
                    List <HPS.BLL.DriverBLL.BLLDriver_T> DriverList    = DriverFactory.GetAllBy(HPS.BLL.DriverBLL.BLLDriver_T.Driver_TField.DriverCardNumber_nvc, _DriverCardNumber);
                    if (DriverList != null && DriverList.Count > 0)
                    {
                        DriverCardNumber_nvcTextBox.Text    = DriverList[0].DriverCardNumber_nvc;
                        FirstName_nvcTextBox.Text           = DriverList[0].FirstName_nvc;
                        LastName_nvcTextBox.Text            = DriverList[0].LastName_nvc;
                        NationalCode_intNumericTextBox.Text = Convert.ToString(DriverList[0].NationalCode_int);
                        licenceNumber_nvcTextBox.Text       = Convert.ToString(DriverList[0].licenceNumber_nvc);
                    }
                }
            }
        }
Ejemplo n.º 22
0
        public AllAcceptedTurnReport(string FromDate, string ToDate, bool WithProductionYear)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

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

                HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
                string Condition = string.Empty;
                if (WithProductionYear == true)
                {
                    Condition = "[T1].[TurnAccepted_bit]='true' AND [T1].[TrafficTypeID_int]=1 AND (T1.TurnDate_nvc>='" + FromDatetxt.Text + "') AND (T1.TurnDate_nvc<='" + ToDate + "') AND T1.ProductionYear_int IS NOT NULL";
                }
                else
                {
                    Condition = "[T1].[TurnAccepted_bit]='true' AND [T1].[TrafficTypeID_int]=1 AND (T1.TurnDate_nvc>='" + FromDatetxt.Text + "') AND (T1.TurnDate_nvc<='" + ToDate + "')";
                }
                DataTable TrafficDataTable = new DataTable();
                TrafficFactory.SelectAcceptedTurns(TrafficDataTable, Condition);
                this.DataSource                 = TrafficDataTable;
                Datetxt.DataField               = "Date_nvc";
                Timetxt.DataField               = "Time_nvc";
                TurnNumbertxt.DataField         = "TurnNumber_bint";
                TrafficNumbertxt.DataField      = "TrafficNumber_bint";
                NumberPlateTextBox.DataField    = "NumberPlate_nvc";
                PlateCitytxt.DataField          = "PlateCityID_intPlateCity_nvc";
                SerialPlateTextBox.DataField    = "SerialPlate_nvc";
                CarCardNumbertxt.DataField      = "CarCardNumber_nvc";
                DriverCardNumbertxt.DataField   = "DriverCardNumber_nvc";
                Usertxt.DataField               = "UserName_nvc";
                FirstNametxt.DataField          = "FirstName_nvc";
                LastNametxt.DataField           = "LastName_nvc";
                TurnAcceptedchk.DataField       = "TurnAccepted_bit";
                TurnAcceptedNumbertxt.DataField = "AcceptedTurnNumber_bint";
                TurnAcceptedDatetxt.DataField   = "TurnDate_nvc";
                TurnAcceptedTimetxt.DataField   = "TurnTime_nvc";
                LaderTypetxt.DataField          = "LaderTypeID_intLaderType_nvc";
                DateTextBox.Text                = TrafficFactory.ServerJalaliDate;
                TimeTextBox.Text                = TrafficFactory.ServerTime;
                UserNameTextBox.Text            = HPS.Common.CurrentUser.user.UserName_nvc;
                PivotGrouptxt.Text              = "تمامی کامیون ها";
                ProductionYeartxt.DataField     = "ProductionYear_int";
            }
            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
Ejemplo n.º 23
0
 private void TrafficPicturesForm_Load(object sender, EventArgs e)
 {
     try
     {
         HPS.BLL.TrafficBLL.BLLTraffic_TFactory Factory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
         this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate);
         this.ToDatefaDatePicker.SelectedDateTime   = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate);
     }
     catch (Exception ex)
     {
         Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
     }
 }
Ejemplo n.º 24
0
 private void OnlineCardCheckingReportForm_Load(object sender, EventArgs e)
 {
     try
     {
         HPS.BLL.TrafficBLL.BLLTraffic_TFactory Factory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
         this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate);
         this.ToDatefaDatePicker.SelectedDateTime   = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Ejemplo n.º 25
0
        private void LoadDrivers()
        {
            HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
            DataTable DriverDataTable = new DataTable();
            string    Condition       = string.Empty;

            TrafficFactory.SelectDriverMobile_nvc(Condition, ref DriverDataTable);
            DriverDataTable.Columns.Add(new DataColumn("Checked_bit", Type.GetType("System.Boolean")));
            DriverDataTable.Columns["Checked_bit"].AllowDBNull  = true;
            DriverDataTable.Columns["Checked_bit"].DefaultValue = false;
            this.DriversdataGridView.AutoGenerateColumns        = false;
            this.DriversdataGridView.DataSource = DriverDataTable;
        }
Ejemplo n.º 26
0
        public override bool Validate(params object[] value)
        {
            try
            {
                this.Description = string.Empty;
                if (value.Length != Field.Length)
                {
                    this.Description = Hepsa.Core.My.Resources.ValidationMessage.IncorrectDataType;
                    return(false);
                }
                string DriverMobileNumber_nvc  = Convert.ToString(value[0]);
                Int64  DriverNationalCode_bint = Convert.ToInt64(value[1]);
                bool   In_bit = Convert.ToBoolean(value[2]);

                HPS.BLL.TrafficBLL.BLLTraffic_TFactory        TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
                List <HPS.BLL.TrafficBLL.BLLTraffic_TFactory> TrafficList    = new List <HPS.BLL.TrafficBLL.BLLTraffic_TFactory>();
                DataTable DublicateNumberDataTable = new DataTable();
                if (In_bit)
                {
                    if (!string.IsNullOrEmpty(DriverMobileNumber_nvc) && !string.IsNullOrEmpty(DriverNationalCode_bint.ToString()))
                    {
                        TrafficFactory.SelectDriverDuplicateNumber(DriverMobileNumber_nvc, DriverNationalCode_bint, DublicateNumberDataTable);
                        if (DublicateNumberDataTable != null && DublicateNumberDataTable.Rows.Count > 0)
                        {
                            //this.Description = "شماره موبایل از قبل موجود می باشد";
                            //return false;
                            DataRow[] dr = DublicateNumberDataTable.Select(string.Format("DriverMobileNumber_nvc={0} AND NationalCode_int={1}", DriverMobileNumber_nvc, DriverNationalCode_bint));
                            if (dr.Length > 0)
                            {
                                return(true);
                            }
                            else
                            {
                                DataRow[] drNotMine = DublicateNumberDataTable.Select(string.Format("DriverMobileNumber_nvc <> {0} OR NationalCode_int <> {1}", DriverMobileNumber_nvc, DriverNationalCode_bint));
                                if (drNotMine.Length > 0)
                                {
                                    this.Description = "شماره موبایل از قبل موجود می باشد";
                                    return(false);
                                }
                            }
                        }
                    }
                }
                return(true);
            }
            catch (System.Exception ex)
            {
                this.Description = ex.Message;
                return(false);
            }
        }
Ejemplo n.º 27
0
        private void ShowwithConditionbutton_Click(object sender, EventArgs e)
        {
            try
            {
                string AcceptedTurnNumber_nvc = string.Empty;
                string TrafficNumber_nvc      = string.Empty;
                string NumberPlate_nvc        = string.Empty;
                string SerialPlate_nvc        = string.Empty;
                string FromDate_nvc           = string.Empty;
                string ToDate_nvc             = string.Empty;
                string LastName_nvc           = string.Empty;

                HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
                if (!FromDatefaDatePicker.IsNull)
                {
                    FromDate_nvc = FromDatefaDatePicker.Text;
                }
                if (!ToDatefaDatePicker.IsNull)
                {
                    ToDate_nvc = ToDatefaDatePicker.Text;
                }
                if (string.IsNullOrEmpty(AcceptedTurnNumber_binttextBox.Text) == false)
                {
                    AcceptedTurnNumber_nvc = AcceptedTurnNumber_binttextBox.Text;
                }
                if (string.IsNullOrEmpty(TrafficNumber_binttextBox.Text) == false)
                {
                    TrafficNumber_nvc = TrafficNumber_binttextBox.Text;
                }
                if (string.IsNullOrEmpty(NumberPlate_nvctextBox.Text) == false)
                {
                    NumberPlate_nvc = NumberPlate_nvctextBox.Text;
                }
                if (string.IsNullOrEmpty(SerialPlate_nvctextBox.Text) == false)
                {
                    SerialPlate_nvc = SerialPlate_nvctextBox.Text;
                }
                if (string.IsNullOrEmpty(LastName_nvctextBox.Text) == false)
                {
                    LastName_nvc = LastName_nvctextBox.Text;
                }
                DataTable TrafficDataTable = new DataTable();
                TrafficFactory.SelectTurnAcceptedWithFields(ref TrafficDataTable, AcceptedTurnNumber_nvc, TrafficNumber_nvc, NumberPlate_nvc, SerialPlate_nvc, FromDate_nvc, ToDate_nvc, LastName_nvc);
                this.TrafficGridView.DataSource = TrafficDataTable;
            }
            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
Ejemplo n.º 28
0
 private void LoadActiveTurns()
 {
     try
     {
         HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
         DataTable TrafficDataTable = new DataTable();
         TrafficFactory.SelectActiveTurns(FromDatefaDatePicker.Text, FromTimeTextBox.Text, ToDatefaDatePicker.Text, ToTimeTextBox.Text, TrafficDataTable);
         this.TrafficGridView.DataSource = TrafficDataTable;
     }
     catch (Exception ex)
     {
         Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
     }
 }
Ejemplo n.º 29
0
        private void LoadWithDriverCardNumber()
        {
            HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_TFactory DriverSpecificationFactory = new HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_TFactory();
            List <HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_T> DriverSpecificationList    = DriverSpecificationFactory.GetAllBy(HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_T.DriverSpecification_TField.NationalCode_int, _NationalCode);

            if (DriverSpecificationList != null && DriverSpecificationList.Count > 0)
            {
                _DriverSpecificationID = DriverSpecificationList[0].DriverSpecificationID_int;
                Key = new HPS.BLL.DriverSpecificationBLL.BLLDriverSpecification_TKeys();
                Key.DriverSpecificationID_int           = _DriverSpecificationID;
                DriverCardNumber_nvcTextBox.Text        = DriverSpecificationList[0].DriverCardNumber_nvc;
                FirstName_nvcTextBox.Text               = DriverSpecificationList[0].FirstName_nvc;
                LastName_nvcTextBox.Text                = DriverSpecificationList[0].LastName_nvc;
                NationalCode_intNumericTextBox.Text     = Convert.ToString(DriverSpecificationList[0].NationalCode_int);
                licenceNumber_nvcTextBox.Text           = DriverSpecificationList[0].licenceNumber_nvc;
                LicenceEnd_nvcTextBox.Text              = DriverSpecificationList[0].LicenceEnd_nvc;
                ClassID_intComboBox.SelectedValue       = DriverSpecificationList[0].ClassID_int.HasValue?DriverSpecificationList[0].ClassID_int:0;
                HealthCardEndDate_nvcTextBox.Text       = DriverSpecificationList[0].HealthCardEndDate_nvc;
                DriverCardSharjeEndDate_nvcTextBox.Text = DriverSpecificationList[0].DriverCardSharjeEndDate_nvc;
                SaveAndCloseButton.Visible              = false;
            }
            else
            {
                Editbutton.Visible = false;
                HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
                List <HPS.BLL.TrafficBLL.BLLTraffic_T> TrafficList    = TrafficFactory.GetAllBy(HPS.BLL.TrafficBLL.BLLTraffic_T.Traffic_TField.NationalCode_int, _NationalCode);
                if (TrafficList != null && TrafficList.Count > 0)
                {
                    DriverCardNumber_nvcTextBox.Text    = TrafficList[TrafficList.Count - 1].DriverCardNumber_nvc;
                    FirstName_nvcTextBox.Text           = TrafficList[TrafficList.Count - 1].FirstName_nvc;
                    LastName_nvcTextBox.Text            = TrafficList[TrafficList.Count - 1].LastName_nvc;
                    NationalCode_intNumericTextBox.Text = Convert.ToString(TrafficList[TrafficList.Count - 1].NationalCode_int);
                    licenceNumber_nvcTextBox.Text       = Convert.ToString(TrafficList[TrafficList.Count - 1].licenceNumber_int);
                }
                else
                {
                    HPS.BLL.DriverBLL.BLLDriver_TFactory DriverFactory = new HPS.BLL.DriverBLL.BLLDriver_TFactory();
                    List <HPS.BLL.DriverBLL.BLLDriver_T> DriverList    = DriverFactory.GetAllBy(HPS.BLL.DriverBLL.BLLDriver_T.Driver_TField.NationalCode_int, _NationalCode);
                    if (DriverList != null && DriverList.Count > 0)
                    {
                        DriverCardNumber_nvcTextBox.Text    = DriverList[0].DriverCardNumber_nvc;
                        FirstName_nvcTextBox.Text           = DriverList[0].FirstName_nvc;
                        LastName_nvcTextBox.Text            = DriverList[0].LastName_nvc;
                        NationalCode_intNumericTextBox.Text = Convert.ToString(DriverList[0].NationalCode_int);
                        licenceNumber_nvcTextBox.Text       = Convert.ToString(DriverList[0].licenceNumber_nvc);
                    }
                }
            }
        }
Ejemplo n.º 30
0
        private void FillCombo()
        {
            try
            {
                HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory LaderPivotGroupID_intFactory = new HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory();
                DT.DataTable LaderPivotGroupID_intDataTable = new DT.DataTable();
                LaderPivotGroupID_intFactory.GetAll(ref LaderPivotGroupID_intDataTable);
                this.LaderPivotGroupID_intComboBox.DisplayMember = HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T.LaderPivotGroup_TField.LaderPivotGroup_nvc.ToString();
                this.LaderPivotGroupID_intComboBox.ValueMember   = HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T.LaderPivotGroup_TField.LaderPivotGroupID_int.ToString();
                this.LaderPivotGroupID_intComboBox.DataSource    = LaderPivotGroupID_intDataTable;
                this.LaderPivotGroupID_intComboBox.SelectedIndex = -1;

                HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeID_intFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory();
                DT.DataTable LaderTypeID_intDataTable = new DT.DataTable();
                string       laderCondition           = "[LaderType_T].[Active_bit]='true'";
                LaderTypeID_intFactory.GetAllByCondition(laderCondition, ref LaderTypeID_intDataTable);
                this.LaderTypeID_intComboBox.DisplayMember = HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderType_nvc.ToString();
                this.LaderTypeID_intComboBox.ValueMember   = HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeID_int.ToString();
                this.LaderTypeID_intComboBox.DataSource    = LaderTypeID_intDataTable;
                this.LaderTypeID_intComboBox.SelectedIndex = -1;

                HPS.BLL.ServicesBLL.BLLServices_TFactory ServicesFactory = new HPS.BLL.ServicesBLL.BLLServices_TFactory();
                DT.DataTable ServicesDataTable = new DT.DataTable();
                string       condition         = "[Services_T].[Activie_bit]='true'";
                ServicesFactory.GetAllByCondition(condition, ref ServicesDataTable);
                ServicescomboBox.DataSource    = ServicesDataTable;
                ServicescomboBox.DisplayMember = HPS.BLL.ServicesBLL.BLLServices_T.Services_TField.ServicesType_nvc.ToString();
                ServicescomboBox.ValueMember   = HPS.BLL.ServicesBLL.BLLServices_T.Services_TField.ServicesID_int.ToString();
                ServicescomboBox.SelectedIndex = -1;


                HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory TrafficTypeFactory = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory();
                string       TrafficTypeCondition = "[TrafficType_T].[TrafficTypeID_int]!=1 And [TrafficType_T].[TrafficTypeID_int]!=2";
                DT.DataTable TrafficTypeDataTable = new DT.DataTable();
                TrafficTypeFactory.GetAllByCondition(TrafficTypeCondition, ref TrafficTypeDataTable);
                TrafficTypeID_intComboBox.DataSource    = TrafficTypeDataTable;
                TrafficTypeID_intComboBox.DisplayMember = HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficType_nvc.ToString();
                TrafficTypeID_intComboBox.ValueMember   = HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficTypeID_int.ToString();
                TrafficTypeID_intComboBox.SelectedIndex = 0;

                HPS.BLL.TrafficBLL.BLLTraffic_TFactory Factory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
                this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate);
                this.ToDatefaDatePicker.SelectedDateTime   = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(Factory.ServerJalaliDate);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }