Esempio n. 1
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;
        }
Esempio n. 2
0
        private void FillListBox()
        {
            HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory();
            try
            {
                String Condition = "[LaderType_T].[SaloonID_int] Is Null";
                if (this.State != enmFormState.Add && this.Key != null)
                {
                    Condition += " Or [LaderType_T].[SaloonID_int]= " + ((HPS.BLL.SaloonBLL.BLLSaloon_TKeys) this.Key).SaloonID_int.ToString();
                }
                List <HPS.BLL.LaderTypeBLL.BLLLaderType_T> LaderTypeList = LaderTypeFactory.GetAllByCondition(Condition);

                if (LaderTypeList != null && LaderTypeList.Count > 0)
                {
                    foreach (HPS.BLL.LaderTypeBLL.BLLLaderType_T item in LaderTypeList)
                    {
                        lstLaderTypeCheckBox.Items.Add(item, false);
                    }
                }
                this.lstLaderTypeCheckBox.GetType().GetProperty("DisplayMember").SetValue(this.lstLaderTypeCheckBox, HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderType_nvc.ToString(), null);
                this.lstLaderTypeCheckBox.GetType().GetProperty("ValueMember").SetValue(this.lstLaderTypeCheckBox, HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeID_int.ToString(), null);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 3
0
        private void FillCombo()
        {
            try
            {
                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);
                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.CompanyBLL.BLLCompany_TFactory CompanyID_intFactory = new HPS.BLL.CompanyBLL.BLLCompany_TFactory();

                //string CompanyCondition = "[Company_T].[Active_bit]='true'";
                //CompanyID_intFactory.GetAllByCondition(CompanyCondition, ref CompanyID_intDataTable);
                ////DataRow Companydr = CompanyID_intDataTable.NewRow();
                ////Companydr["CompanyID_int"] = 0;
                ////CompanyID_intDataTable.Rows.InsertAt(Companydr, 0);
                //this.CompanyID_intComboBox.DisplayMember = HPS.BLL.CompanyBLL.BLLCompany_T.Company_TField.Company_nvc.ToString();
                //this.CompanyID_intComboBox.ValueMember = HPS.BLL.CompanyBLL.BLLCompany_T.Company_TField.CompanyID_int.ToString();
                //this.CompanyID_intComboBox.DataSource = CompanyID_intDataTable;
                //this.CompanyID_intComboBox.SelectedIndex = -1;

                HPS.BLL.GoodBLL.BLLGood_TFactory GoodFactory = new HPS.BLL.GoodBLL.BLLGood_TFactory();
                DataTable GoodID_intDataTable = new DataTable();
                GoodFactory.GetAll(ref GoodID_intDataTable);
                this.GoodID_intcomboBox.DisplayMember = HPS.BLL.GoodBLL.BLLGood_T.Good_TField.Good_nvc.ToString();
                this.GoodID_intcomboBox.ValueMember   = HPS.BLL.GoodBLL.BLLGood_T.Good_TField.GoodID_int.ToString();
                this.GoodID_intcomboBox.DataSource    = GoodID_intDataTable;
                this.GoodID_intcomboBox.SelectedIndex = -1;

                HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory PortPlaceFactory = new HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory();
                DataTable PortPlaceID_intDataTable = new DataTable();
                PortPlaceFactory.GetAll(ref PortPlaceID_intDataTable);
                this.PortPlaceID_intcomboBox.DisplayMember = HPS.BLL.PortPlacesBLL.BLLPortPlaces_T.PortPlaces_TField.PortPlaces_nvc.ToString();
                this.PortPlaceID_intcomboBox.ValueMember   = HPS.BLL.PortPlacesBLL.BLLPortPlaces_T.PortPlaces_TField.PortPlacesID_int.ToString();
                this.PortPlaceID_intcomboBox.DataSource    = PortPlaceID_intDataTable;
                this.PortPlaceID_intcomboBox.SelectedIndex = -1;

                HPS.BLL.CityBLL.BLLCity_TFactory CityFactory = new HPS.BLL.CityBLL.BLLCity_TFactory();
                DataTable DestinationCityID_intDataTable     = new DataTable();
                CityFactory.GetAll(ref DestinationCityID_intDataTable);
                this.DestinationCityID_intcomboBox.DisplayMember = HPS.BLL.CityBLL.BLLCity_T.City_TField.City_nvc.ToString();
                this.DestinationCityID_intcomboBox.ValueMember   = HPS.BLL.CityBLL.BLLCity_T.City_TField.CityID_int.ToString();
                this.DestinationCityID_intcomboBox.DataSource    = DestinationCityID_intDataTable;
                this.DestinationCityID_intcomboBox.SelectedIndex = -1;
            }
            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
Esempio n. 4
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;
            }
        }
Esempio n. 5
0
 private void LoadLaderType()
 {
     try
     {
         HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory();
         string    Condition          = "[LaderType_T].[Active_bit]='true'";
         DataTable LaderTypeDataTable = new DataTable();
         LaderTypeFactory.GetAllByCondition(Condition, ref LaderTypeDataTable);
         this.LaderTypeGridView.DataSource = LaderTypeDataTable;
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }
Esempio n. 6
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);
            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;
        }
Esempio n. 7
0
 private void TrafficFields()
 {
     TrafficList = TrafficFactory.GetAllByCondition(TrafficCondition);
     if (TrafficList != null && TrafficList.Count > 0 && TrafficList[TrafficList.Count - 1].In_bit == true)
     {
         CarCardNumber_nvcTextBox.Text    = TrafficList[TrafficList.Count - 1].CarCardNumber_nvc;
         SavedCarCardDate_nvcTextBox.Text = TrafficList[TrafficList.Count - 1].CarCardDate_nvc;
         SavedPlateType_nvcTextBox.Text   = TrafficList[TrafficList.Count - 1].PlateType_nvc;
         SavedNumberPlate_nvcTextBox.Text = TrafficList[TrafficList.Count - 1].NumberPlate_nvc;
         SavedSerialPlate_nvcTextBox.Text = TrafficList[TrafficList.Count - 1].SerialPlate_nvc;
         HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory PlateCityFactory = new HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory();
         string PlateCityCondition = "[PlateCity_T].[PlateCityID_int] = '" + TrafficList[TrafficList.Count - 1].PlateCityID_int + "'";
         List <HPS.BLL.PlateCityBLL.BLLPlateCity_T> PlateCityList = PlateCityFactory.GetAllByCondition(PlateCityCondition);
         if (PlateCityList != null)
         {
             SavedPlateCityID_inttextBox.Text = PlateCityList[0].PlateCity_nvc;
         }
         HPS.BLL.ColorBLL.BLLColor_TFactory ColorFactory = new HPS.BLL.ColorBLL.BLLColor_TFactory();
         string ColorCondition = "[Color_T].[ColorID_int] = '" + TrafficList[TrafficList.Count - 1].PlateColorID_int + "'";
         List <HPS.BLL.ColorBLL.BLLColor_T> ColorList = ColorFactory.GetAllByCondition(ColorCondition);
         if (ColorList != null && ColorList.Count > 0)
         {
             SavedPlateColorID_inttextBox.Text = ColorList[0].Color_nvc;
         }
         SavedCountryID_inttextBox.Text             = TrafficList[TrafficList.Count - 1].Country_nvc;
         SavedYearType_nvcTextBox.Text              = TrafficList[TrafficList.Count - 1].YearType_nvc;
         SavedProductionYear_intNumericTextBox.Text = TrafficList[TrafficList.Count - 1].ProductionYear_int.Value.ToString();
         HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory();
         string LaderTypecondition = "[LaderType_T].[LaderTypeID_int] = '" + TrafficList[TrafficList.Count - 1].LaderTypeID_int + "'";
         List <HPS.BLL.LaderTypeBLL.BLLLaderType_T> LaderTypeList = LaderTypeFactory.GetAllByCondition(LaderTypecondition);
         if (LaderTypeList != null)
         {
             SavedLaderType_nvctextBox.Text = LaderTypeList[0].LaderType_nvc;
         }
         SavedLaderTypeCode_nvcTextBox.Text   = TrafficList[TrafficList.Count - 1].LaderTypeCode_nvc;
         SavedSystemCode_nvcTextBox.Text      = TrafficList[TrafficList.Count - 1].SystemCode_nvc;
         SavedSystem_nvcTextBox.Text          = TrafficList[TrafficList.Count - 1].System_nvc;
         SavedCapacity_intNumericTextBox.Text = TrafficList[TrafficList.Count - 1].Capacity_flt.Value.ToString();
     }
     else
     {
         Hepsa.Core.Common.MessageBox.ErrorMessage(string.Format(HPS.Exceptions.ExceptionCs.RecordNotFound, "ترددی با این مشخصات"));
     }
 }
Esempio n. 8
0
        private void FillGrid()
        {
            try
            {
                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");

                HPS.BLL.CompanyBLL.BLLCompany_TFactory CompanyID_intFactory = new HPS.BLL.CompanyBLL.BLLCompany_TFactory();
                string CompanyCondition = "[Company_T].[Active_bit]='true'";
                CompanyID_intFactory.GetAllByCondition(CompanyCondition, ref CompanyID_intDataTable);
                companyGrid.SetDataBinding(CompanyID_intDataTable, "CompanyID_intDataTable");

                HPS.BLL.GoodBLL.BLLGood_TFactory GoodFactory = new HPS.BLL.GoodBLL.BLLGood_TFactory();
                DataTable GoodID_intDataTable = new DataTable();
                GoodFactory.GetAll(ref GoodID_intDataTable);
                goodGrid.SetDataBinding(GoodID_intDataTable, "GoodID_intDataTable");


                HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory PortPlaceFactory = new HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory();
                DataTable PortPlaceID_intDataTable = new DataTable();
                string    PortPlacesCondition      = "[PortPlaces_T].[Active_bit]='true'";
                PortPlaceFactory.GetAllByCondition(PortPlacesCondition, ref PortPlaceID_intDataTable);
                portPlaceGrid.SetDataBinding(PortPlaceID_intDataTable, "PortPlaceID_intDataTable");

                HPS.BLL.CityBLL.BLLCity_TFactory CityFactory = new HPS.BLL.CityBLL.BLLCity_TFactory();
                DataTable DestinationCityID_intDataTable     = new DataTable();
                string    CityCondition = "[City_T].[Active_bit]='true'";
                CityFactory.GetAllByCondition(CityCondition, ref DestinationCityID_intDataTable);
                destinationCityGrid.SetDataBinding(DestinationCityID_intDataTable, "DestinationCityID_intDataTable");

                this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(CityFactory.ServerJalaliDate);
                this.ToDatefaDatePicker.SelectedDateTime   = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(CityFactory.ServerJalaliDate);
                //this.FromTimeTextBox.Text = "08:00:00";
                //this.ToTimeTextBox.Text = CityFactory.ServerTime;
            }
            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
Esempio n. 9
0
        private void FillCombo()
        {
            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);
            this.LaderTypecheckedComboBox.DropDownDataSource    = LaderTypeID_intDataTable;
            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[3].Caption  = "بارگیر";
            LaderTypecheckedComboBox.DropDownList.Columns[3].Width    = 300;
            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[10].Visible = false;
        }
Esempio n. 10
0
        public IranianTrafficEditReport(HPS.BLL.TrafficBLL.BLLTraffic_TKeys TrafficKey)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory   = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
            HPS.BLL.TrafficBLL.BLLTraffic_T        TrafficEntityrpt = TrafficFactory.GetBy(TrafficKey);
            DateTextBox.Text      = TrafficEntityrpt.Date_nvc;
            TimeTextBox.Text      = TrafficEntityrpt.Time_nvc;
            TrafficNumbertxt.Text = TrafficEntityrpt.TrafficNumber_bint.ToString();
            TurnNumbertxt.Text    = TrafficEntityrpt.TurnNumber_bint.ToString();
            HPS.BLL.ServicesBLL.BLLServices_TFactory servicesFactory = new HPS.BLL.ServicesBLL.BLLServices_TFactory();
            HPS.BLL.ServicesBLL.BLLServices_TKeys    ServicesKey     = new HPS.BLL.ServicesBLL.BLLServices_TKeys();
            ServicesKey.ServicesID_int = TrafficEntityrpt.ServiceID_int;
            HPS.BLL.ServicesBLL.BLLServices_T ServicesEntity = new HPS.BLL.ServicesBLL.BLLServices_T();
            ServicesEntity     = servicesFactory.GetBy(ServicesKey);
            Servicestxt.Text   = " مراجعه به : " + ServicesEntity.ServicesType_nvc;
            DriverNametxt.Text = " نام راننده : " + TrafficEntityrpt.FirstName_nvc + " " + TrafficEntityrpt.LastName_nvc;
            HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory laderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory();
            string LaderTypecondition = "[LaderType_T].[LaderTypeID_int]='" + TrafficEntityrpt.LaderTypeID_int + "'";
            List <HPS.BLL.LaderTypeBLL.BLLLaderType_T> LaderTypeLst = laderTypeFactory.GetAllByCondition(LaderTypecondition);

            if (LaderTypeLst != null)
            {
                CarTypetxt.Text = "نوع وسیله : " + TrafficEntityrpt.System_nvc + "-  " + LaderTypeLst[0].LaderType_nvc;
            }
            HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory PlatecityFactory = new HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory();
            HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys    Platecitykey     = new HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys();
            Platecitykey.PlateCityID_int = TrafficEntityrpt.PlateCityID_int;
            HPS.BLL.PlateCityBLL.BLLPlateCity_T PlateCityEntity = new HPS.BLL.PlateCityBLL.BLLPlateCity_T();
            PlateCityEntity = PlatecityFactory.GetBy(Platecitykey);
            if (PlateCityEntity != null)
            {
                NumberPlatetxt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + PlateCityEntity.PlateCity_nvc + " " + TrafficEntityrpt.SerialPlate_nvc;
            }
            else
            {
                NumberPlatetxt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + TrafficEntityrpt.SerialPlate_nvc;
            }
            if (TrafficEntityrpt.WithLade_bit == true)
            {
                WithLadetxt.Text = "وضعیت : " + "با بار" + "(" + TrafficEntityrpt.Comment_nvc + ") ";
            }
            else
            {
                WithLadetxt.Text = "وضعیت : " + "بدون بار";
            }
            HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory BillFactory = new HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory();
            if (TrafficEntityrpt.BillMessageID_int == 0 || TrafficEntityrpt.BillMessageID_int == null)
            {
            }
            else
            {
                string Billcondition = "[BillMessage_T].[BillMessageID_int]=" + TrafficEntityrpt.BillMessageID_int;
                List <HPS.BLL.BillMessageBLL.BLLBillMessage_T> BillLst = BillFactory.GetAllByCondition(Billcondition);
                if (BillLst != null)
                {
                    Messagetxt.Text = BillLst[0].Message_nvc;
                }
            }
            HamrahanSystem.TextBox.NumericTextBox txt = new HamrahanSystem.TextBox.NumericTextBox();
            txt.DigitsInGroup = 3;
            if (TrafficEntityrpt.Price_dec != null)
            {
                txt.Text      = TrafficEntityrpt.Price_dec.ToString();
                Pricetxt.Text = " مبلغ دریافتی هنگام ورود " + txt.Text + "  ريال می باشد";
            }
            //AllowableHourtxt.Text = TrafficEntityrpt.AllowableHour_int.ToString();
            //txt.Text = TrafficEntityrpt.Fee_dec.ToString();
            //Feetxt.Text = txt.Text;
            //ExtraHourtxt.Text = TrafficEntityrpt.ExtraHour_int.ToString();

            // txt.Text = TrafficEntityrpt.ExtraHourFee_dec.ToString();
            //ExtraHourFeetxt.Text = txt.Text;
            UserNametxt.Text          = TrafficEntityrpt.UserName_nvc;
            TrafficNumberbarcode.Text = TrafficEntityrpt.TrafficNumber_bint.ToString();
            if (TrafficEntityrpt.TurnAccepted_bit == false && TrafficEntityrpt.TurnHour_int != null)
            {
                TurnNumberAllerttxt.Text = " شماره نوبت شما رزرو می باشد لطفاً تا " + TrafficEntityrpt.TurnHour_int.ToString() + " ساعت نسبت به تأیید آن اقدام نمایید";
            }
        }
Esempio n. 11
0
        private void FillCombo()
        {
            try
            {
                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);
                this.LaderTypecheckedComboBox.DropDownDataSource    = LaderTypeID_intDataTable;
                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[3].Caption  = "بارگیر";
                LaderTypecheckedComboBox.DropDownList.Columns[3].Width    = 300;
                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[10].Visible = false;


                HPS.BLL.CompanyBLL.BLLCompany_TFactory CompanyID_intFactory = new HPS.BLL.CompanyBLL.BLLCompany_TFactory();
                DataTable CompanyID_intDataTable = new DataTable();
                string    CompanyCondition       = "[Company_T].[Active_bit]='true'";
                CompanyID_intFactory.GetAllByCondition(CompanyCondition, ref CompanyID_intDataTable);
                DataRow Companydr = CompanyID_intDataTable.NewRow();
                //Companydr["CompanyID_int"] = 0;
                //CompanyID_intDataTable.Rows.InsertAt(Companydr, 0);
                this.CompanyID_intcheckedComboBox.DropDownDataSource    = CompanyID_intDataTable;
                this.CompanyID_intcheckedComboBox.DropDownDataMember    = "Company_T";
                this.CompanyID_intcheckedComboBox.DropDownDisplayMember = HPS.BLL.CompanyBLL.BLLCompany_T.Company_TField.Company_nvc.ToString();
                this.CompanyID_intcheckedComboBox.DropDownValueMember   = HPS.BLL.CompanyBLL.BLLCompany_T.Company_TField.CompanyID_int.ToString();
                CompanyID_intcheckedComboBox.RetrieveStructure();
                CompanyID_intcheckedComboBox.DropDownList.Columns[1].Visible  = false;
                CompanyID_intcheckedComboBox.DropDownList.Columns[2].Visible  = false;
                CompanyID_intcheckedComboBox.DropDownList.Columns[4].Visible  = false;
                CompanyID_intcheckedComboBox.DropDownList.Columns[3].Caption  = "شرکت";
                CompanyID_intcheckedComboBox.DropDownList.Columns[3].Width    = 300;
                CompanyID_intcheckedComboBox.DropDownList.Columns[5].Visible  = false;
                CompanyID_intcheckedComboBox.DropDownList.Columns[6].Visible  = false;
                CompanyID_intcheckedComboBox.DropDownList.Columns[7].Visible  = false;
                CompanyID_intcheckedComboBox.DropDownList.Columns[8].Visible  = false;
                CompanyID_intcheckedComboBox.DropDownList.Columns[9].Visible  = false;
                CompanyID_intcheckedComboBox.DropDownList.Columns[10].Visible = false;
                CompanyID_intcheckedComboBox.DropDownList.Columns[11].Visible = false;
                CompanyID_intcheckedComboBox.DropDownList.Columns[12].Visible = false;
                CompanyID_intcheckedComboBox.DropDownList.Columns[13].Visible = false;
                CompanyID_intcheckedComboBox.DropDownList.Columns[14].Visible = false;
                CompanyID_intcheckedComboBox.DropDownList.Columns[15].Visible = false;
                CompanyID_intcheckedComboBox.DropDownList.Columns[16].Visible = false;
                CompanyID_intcheckedComboBox.DropDownList.Columns[17].Visible = false;
                CompanyID_intcheckedComboBox.DropDownList.Columns[18].Visible = false;


                HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_TFactory LadBillCreditFactory = new HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_TFactory();
                DataTable LadbillOrder1Table = new DataTable();
                LadBillCreditFactory.SelectLadBillCreditOrderColumn(LadbillOrder1Table);
                DataRow emptyRow1 = LadbillOrder1Table.NewRow();
                LadbillOrder1Table.Rows.InsertAt(emptyRow1, 0);
                this.Order1ComboBox.DisplayMember = "PropertyValue";
                this.Order1ComboBox.ValueMember   = "ColumnName";
                this.Order1ComboBox.DataSource    = LadbillOrder1Table;
                this.Order1ComboBox.SelectedIndex = 0;

                DataTable LadbillOrder2Table = new DataTable();
                LadBillCreditFactory.SelectLadBillCreditOrderColumn(LadbillOrder2Table);
                DataRow emptyRow2 = LadbillOrder2Table.NewRow();
                LadbillOrder2Table.Rows.InsertAt(emptyRow2, 0);
                this.Order2ComboBox.DisplayMember = "PropertyValue";
                this.Order2ComboBox.ValueMember   = "ColumnName";
                this.Order2ComboBox.DataSource    = LadbillOrder2Table;
                this.Order2ComboBox.SelectedIndex = 0;

                DataTable LadbillOrder3Table = new DataTable();
                LadBillCreditFactory.SelectLadBillCreditOrderColumn(LadbillOrder3Table);
                DataRow emptyRow3 = LadbillOrder3Table.NewRow();
                LadbillOrder3Table.Rows.InsertAt(emptyRow3, 0);
                this.Order3ComboBox.DisplayMember = "PropertyValue";
                this.Order3ComboBox.ValueMember   = "ColumnName";
                this.Order3ComboBox.DataSource    = LadbillOrder3Table;
                this.Order3ComboBox.SelectedIndex = 0;

                DataTable LadbillOrder4Table = new DataTable();
                LadBillCreditFactory.SelectLadBillCreditOrderColumn(LadbillOrder4Table);
                DataRow emptyRow4 = LadbillOrder4Table.NewRow();
                LadbillOrder4Table.Rows.InsertAt(emptyRow4, 0);
                this.Order4ComboBox.DisplayMember = "PropertyValue";
                this.Order4ComboBox.ValueMember   = "ColumnName";
                this.Order4ComboBox.DataSource    = LadbillOrder4Table;
                this.Order4ComboBox.SelectedIndex = 0;

                DataTable LadbillOrder5Table = new DataTable();
                LadBillCreditFactory.SelectLadBillCreditOrderColumn(LadbillOrder5Table);
                DataRow emptyRow5 = LadbillOrder5Table.NewRow();
                LadbillOrder5Table.Rows.InsertAt(emptyRow5, 0);
                this.Order5ComboBox.DisplayMember = "PropertyValue";
                this.Order5ComboBox.ValueMember   = "ColumnName";
                this.Order5ComboBox.DataSource    = LadbillOrder5Table;
                this.Order5ComboBox.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)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
Esempio n. 12
0
        public ForeignCarsReport(HPS.BLL.TrafficBLL.BLLTraffic_T TrafficEntity)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            this.TrafficEntityrpt = TrafficEntity;

            DateTextBox.Text      = TrafficEntityrpt.Date_nvc;
            TimeTextBox.Text      = TrafficEntityrpt.Time_nvc;
            TrafficNumbertxt.Text = TrafficEntityrpt.TrafficNumber_bint.ToString();
            DriverNametxt.Text    = " نام راننده : " + TrafficEntityrpt.FirstName_nvc + " " + TrafficEntityrpt.LastName_nvc;
            HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory laderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory();
            string LaderTypecondition = "[LaderType_T].[LaderTypeID_int]='" + TrafficEntityrpt.LaderTypeID_int + "'";
            List <HPS.BLL.LaderTypeBLL.BLLLaderType_T> LaderTypeLst = laderTypeFactory.GetAllByCondition(LaderTypecondition);

            if (LaderTypeLst != null)
            {
                CarTypetxt.Text = "نوع وسيله : " + TrafficEntityrpt.System_nvc + "-  " + LaderTypeLst[0].LaderType_nvc;
            }
            if (!string.IsNullOrEmpty(TrafficEntityrpt.SerialPlate_nvc))
            {
                NumberPlatetxt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + TrafficEntityrpt.SerialPlate_nvc;
            }
            else
            {
                NumberPlatetxt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc);
            }

            if (TrafficEntityrpt.WithLade_bit == true)
            {
                WithLadetxt.Text = "وضعیت : " + "با بار" + "(" + TrafficEntityrpt.Comment_nvc + ") ";
            }
            else
            {
                WithLadetxt.Text = "وضعیت : " + "بدون بار";
            }
            HamrahanSystem.TextBox.NumericTextBox txt = new HamrahanSystem.TextBox.NumericTextBox();
            txt.DigitsInGroup = 3;
            if (TrafficEntityrpt.Price_dec != null)
            {
                txt.Text      = TrafficEntityrpt.Price_dec.ToString();
                Pricetxt.Text = " مبلغ دریافتی هنگام ورود " + txt.Text + "  ريال می باشد";
            }
            AllowableHourtxt.Text = TrafficEntityrpt.AllowableHour_int.ToString();
            ExtraHourtxt.Text     = TrafficEntityrpt.ExtraHour_int.ToString();
            txt.Text                  = TrafficEntityrpt.Fee_dec.ToString();
            Feetxt.Text               = txt.Text;
            txt.Text                  = TrafficEntityrpt.ExtraHourFee_dec.ToString();
            ExtraHourFeetxt.Text      = txt.Text;
            UserNametxt.Text          = TrafficEntityrpt.UserName_nvc;
            TrafficNumberbarcode.Text = TrafficEntityrpt.TrafficNumber_bint.ToString();

            if (TrafficEntityrpt.Printed_bit == true)
            {
                this.txtPrintedAgain.Visible = true;
            }
            else
            {
                this.txtPrintedAgain.Visible = false;
                HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
                try
                {
                    HPS.BLL.TrafficBLL.BLLTraffic_TKeys TrafficKey = new HPS.BLL.TrafficBLL.BLLTraffic_TKeys();
                    TrafficKey.TrafficID_bint    = TrafficEntityrpt.TrafficID_bint;
                    TrafficEntityrpt.Printed_bit = true;
                    TrafficFactory.BeginProc();
                    TrafficFactory.Update(TrafficEntityrpt, TrafficKey);
                    TrafficFactory.CommitProc();
                }
                catch (Exception ex)
                {
                    TrafficFactory.RollBackProc();
                    throw ex;
                }
            }
        }
Esempio n. 13
0
        private void StimulViewer_Load(object sender, EventArgs e)
        {
            //try
            //{
            if (_Traffic_bit == false && _Othercar_bit == false)
            {
                AcceptedTurnstiReport.Dictionary.Synchronize();
                AcceptedTurnstiReport.Dictionary.Databases.Clear();
                AcceptedTurnstiReport.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", Hepsa.Core.Common.ConnectionString.ConnectionString));
                AcceptedTurnstiReport.Compile();
                AcceptedTurnstiReport["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();
                HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory BillFactory      = new HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory();
                if (TrafficEntity.BillMessageID_int == 0 || TrafficEntity.BillMessageID_int == null)
                {
                }
                else
                {
                    string Billcondition = "[BillMessage_T].[BillMessageID_int]=" + TrafficEntity.BillMessageID_int;
                    List <HPS.BLL.BillMessageBLL.BLLBillMessage_T> BillLst = BillFactory.GetAllByCondition(Billcondition);
                    if (BillLst != null)
                    {
                        AcceptedTurnstiReport["Messagetxt"]  = BillLst[0].Message_nvc;
                        AcceptedTurnstiReport["Message_bit"] = true;
                    }
                    else
                    {
                        AcceptedTurnstiReport["Message_bit"] = false;
                    }
                }
                NumericTextBox txt = new NumericTextBox();
                txt.DigitsInGroup = 3;
                if (TrafficEntity.Price_dec != null)
                {
                    txt.Text = TrafficEntity.Price_dec.ToString();
                    AcceptedTurnstiReport["Price_nvc"] = " مبلغ دریافت شده هنگام ورود " + txt.Text + "  ريال می باشد";
                }
                if (TrafficEntity.Price_dec != null)
                {
                    AcceptedTurnstiReport["PricewithOutTax_nvc"] = (TrafficEntity.Price_dec - TrafficEntity.PriceTax_dec).ToString();
                }

                if (!string.IsNullOrEmpty(TrafficEntity.AcceptedTurnComment_nvc))
                {
                    if (TrafficEntity.Area_bit)
                    {
                        AcceptedTurnstiReport["Comment_nvc"] = "توضيحات : " + TrafficEntity.AcceptedTurnComment_nvc;// +" حومه";
                    }
                    else
                    {
                        AcceptedTurnstiReport["Comment_nvc"] = "توضيحات : " + TrafficEntity.AcceptedTurnComment_nvc;
                    }
                }
                else
                {
                    //if (TrafficEntity.Area_bit)
                    //{
                    //    AcceptedTurnstiReport["Comment_nvc"] = "حومه";
                    //}
                }
                if (TrafficEntity.TurnPrinted_bit == true)
                {
                    AcceptedTurnstiReport["PrintedAgain_nvc"] = "المثنی";
                }
                else
                {
                    AcceptedTurnstiReport["PrintedAgain_nvc"] = "";
                }

                HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory PlatecityFactory = new HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory();
                HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys    Platecitykey     = new HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys();
                Platecitykey.PlateCityID_int = TrafficEntity.PlateCityID_int;
                HPS.BLL.PlateCityBLL.BLLPlateCity_T PlateCityEntity = new HPS.BLL.PlateCityBLL.BLLPlateCity_T();
                PlateCityEntity = PlatecityFactory.GetBy(Platecitykey);

                if (PlateCityEntity != null)
                {
                    AcceptedTurnstiReport["Number_nvc"] = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntity.NumberPlate_nvc) + " - " + PlateCityEntity.PlateCity_nvc + " " + TrafficEntity.SerialPlate_nvc;
                }
                else
                {
                    AcceptedTurnstiReport["Number_nvc"] = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntity.NumberPlate_nvc) + " - " + TrafficEntity.SerialPlate_nvc;
                }

                if (TrafficEntity.LadeReturn_bit == true)
                {
                    AcceptedTurnstiReport["TurnNumber"] = "برگشت از بار";
                }
                else
                {
                    if (TrafficEntity.AcceptedTurnNumber_bint.HasValue)
                    {
                        AcceptedTurnstiReport["TurnNumber"] = "شماره نوبت : " + TrafficEntity.AcceptedTurnNumber_bint.ToString();
                    }
                    else
                    {
                        AcceptedTurnstiReport["TurnNumber"] = "شماره نوبت رزرو : " + TrafficEntity.TurnNumber_bint.ToString();
                    }
                }

                AcceptedTurnstiReport["TrafficNumber"] = " شماره قبض پارکینگ: " + TrafficEntity.TrafficNumber_bint.ToString();


                AcceptedTurnstiReport["InDate_vc"]    = TrafficEntity.Date_nvc;
                AcceptedTurnstiReport["InTime_vc"]    = TrafficEntity.Time_nvc;
                AcceptedTurnstiReport["Time_vc"]      = PortPlaceFactory.ServerTime;
                AcceptedTurnstiReport["Date_vc"]      = PortPlaceFactory.ServerJalaliDate;
                AcceptedTurnstiReport["username_nvc"] = HPS.Common.CurrentUser.user.UserName_nvc;


                HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory laderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory();
                string LaderTypecondition = "[LaderType_T].[LaderTypeID_int]='" + TrafficEntity.LaderTypeID_int + "'";

                AcceptedTurnstiReport["@TrafficID_bint"] = TrafficEntity.TrafficID_bint;
                AcceptedTurnstiReport["@Condition"]      = LaderTypecondition;
                AcceptedTurnstiReport.Render();

                Properties.Settings s = new HPS.Properties.Settings();
                System.Drawing.Printing.PrinterSettings PrinterSetting = new System.Drawing.Printing.PrinterSettings();
                if (string.IsNullOrEmpty(s.PrinterName))
                {
                    AcceptedTurnstiReport.Print(true);
                }
                else
                {
                    PrinterSetting.PrinterName = s.PrinterName;
                    AcceptedTurnstiReport.Print(false, PrinterSetting);
                }

                this.Close();
            }

            else if (_Traffic_bit == true && _Othercar_bit == false)
            {
                TrafficstiReport.Dictionary.Synchronize();
                TrafficstiReport.Dictionary.Databases.Clear();
                TrafficstiReport.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", Hepsa.Core.Common.ConnectionString.ConnectionString));
                TrafficstiReport.Compile();
                TrafficstiReport["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();
                HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory BillFactory      = new HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory();
                if (TrafficEntity.BillMessageID_int == 0 || TrafficEntity.BillMessageID_int == null)
                {
                }
                else
                {
                    string Billcondition = "[BillMessage_T].[BillMessageID_int]=" + TrafficEntity.BillMessageID_int;
                    List <HPS.BLL.BillMessageBLL.BLLBillMessage_T> BillLst = BillFactory.GetAllByCondition(Billcondition);
                    if (BillLst != null)
                    {
                        TrafficstiReport["Messagetxt"]  = BillLst[0].Message_nvc;
                        TrafficstiReport["Message_bit"] = true;
                    }
                    else
                    {
                        TrafficstiReport["Message_bit"] = false;
                    }
                }
                NumericTextBox txt = new NumericTextBox();
                txt.DigitsInGroup = 3;
                if (TrafficEntity.Price_dec != null)
                {
                    txt.Text = TrafficEntity.Price_dec.ToString();
                    TrafficstiReport["Price_nvc"] = " مبلغ دریافت شده هنگام ورود " + txt.Text + "  ريال می باشد";
                }

                if (!string.IsNullOrEmpty(TrafficEntity.AcceptedTurnComment_nvc))
                {
                    if (TrafficEntity.Area_bit)
                    {
                        TrafficstiReport["Comment_nvc"] = "توضيحات : " + TrafficEntity.AcceptedTurnComment_nvc;// +" حومه";
                    }
                    else
                    {
                        TrafficstiReport["Comment_nvc"] = "توضيحات : " + TrafficEntity.AcceptedTurnComment_nvc;
                    }
                }
                else
                {
                    //if (TrafficEntity.Area_bit)
                    //{
                    //    TrafficstiReport["Comment_nvc"] = "حومه";
                    //}
                }
                if (TrafficEntity.TurnPrinted_bit == true)
                {
                    TrafficstiReport["PrintedAgain_nvc"] = "المثنی";
                }
                else
                {
                    TrafficstiReport["PrintedAgain_nvc"] = "";
                }

                HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory PlatecityFactory = new HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory();
                HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys    Platecitykey     = new HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys();
                Platecitykey.PlateCityID_int = TrafficEntity.PlateCityID_int;
                HPS.BLL.PlateCityBLL.BLLPlateCity_T PlateCityEntity = new HPS.BLL.PlateCityBLL.BLLPlateCity_T();
                PlateCityEntity = PlatecityFactory.GetBy(Platecitykey);

                if (PlateCityEntity != null)
                {
                    TrafficstiReport["Number_nvc"] = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntity.NumberPlate_nvc) + " - " + PlateCityEntity.PlateCity_nvc + " " + TrafficEntity.SerialPlate_nvc;
                }
                else
                {
                    TrafficstiReport["Number_nvc"] = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntity.NumberPlate_nvc) + " - " + TrafficEntity.SerialPlate_nvc;
                }


                if (TrafficEntity.ServiceID_int == 2)
                {
                    if (TrafficEntity.TurnAccepted_bit == true)
                    {
                        //نوبت تأیید شده داره
                        TrafficstiReport["TurnNumber"] = "شماره نوبت :   " + Convert.ToString(TrafficEntity.AcceptedTurnNumber_bint);
                        //AcceptedDate2TextBox.Text = TrafficEntityrpt.TurnDate_nvc;
                        //AcceptedTime2TextBox.Text = TrafficEntityrpt.TurnTime_nvc;
                        //TurnNumber2txt.Text = TrafficEntityrpt.AcceptedTurnNumber_bint.ToString();
                    }
                    else
                    {
                        //نوبت تأیید شده ندارد
                        TrafficstiReport["TurnNumber"] = "شماره نوبت رزرو :   " + Convert.ToString(TrafficEntity.TurnNumber_bint);
                    }
                }
                else
                {
                    // (عدم نمایش نوبت (مراجعه به غیر از نوبت
                    TrafficstiReport["TurnNumber"] = "";
                }

                TrafficstiReport["TrafficNumber"] = "شماره قبض پارکینگ : " + TrafficEntity.TrafficNumber_bint.ToString();

                HPS.BLL.SettingsBLL.BLLSetting_TFactory settingsFactory = new HPS.BLL.SettingsBLL.BLLSetting_TFactory();
                HPS.BLL.SettingsBLL.BLLSetting_T        SettingEntity   = new HPS.BLL.SettingsBLL.BLLSetting_T();
                HPS.BLL.SettingsBLL.BLLSetting_TKeys    SettingKey      = new HPS.BLL.SettingsBLL.BLLSetting_TKeys();
                SettingKey.SettingID_int = 1002;
                SettingEntity            = settingsFactory.GetBy(SettingKey);
                if (TrafficEntity.ServiceID_int == 2)
                {
                    TrafficstiReport["TAllowableHour"] = SettingEntity.Value_nvc; //TrafficEntityrpt.AllowableHour_int.ToString();
                }
                else
                {
                    TrafficstiReport["TAllowableHour"] = TrafficEntity.AllowableHour_int.ToString();
                }



                HPS.BLL.ServicesBLL.BLLServices_TFactory servicesFactory = new HPS.BLL.ServicesBLL.BLLServices_TFactory();
                HPS.BLL.ServicesBLL.BLLServices_TKeys    ServicesKey     = new HPS.BLL.ServicesBLL.BLLServices_TKeys();
                ServicesKey.ServicesID_int = TrafficEntity.ServiceID_int;
                HPS.BLL.ServicesBLL.BLLServices_T ServicesEntity = new HPS.BLL.ServicesBLL.BLLServices_T();
                ServicesEntity = servicesFactory.GetBy(ServicesKey);
                TrafficstiReport["system_nvc"] = " قبض مراجعه به : " + ServicesEntity.ServicesType_nvc;

                if (TrafficEntity.WithLade_bit == true)
                {
                    TrafficstiReport["WithLade_nvc"] = "وضعیت : " + "با بار" + "(" + TrafficEntity.Comment_nvc + ") ";
                }
                else
                {
                    TrafficstiReport["WithLade_nvc"] = "وضعیت : " + "بدون بار";
                }

                if (TrafficEntity.TurnHour_int != null)
                {
                    TrafficstiReport["TurnNumberAllert_nvc"] = " شماره نوبت شما رزرو می باشد لطفاً تا " + TrafficEntity.TurnHour_int.ToString() + " ساعت نسبت به تأیید آن اقدام نمایید";
                }


                TrafficstiReport["InDate_vc"]    = TrafficEntity.Date_nvc;
                TrafficstiReport["InTime_vc"]    = TrafficEntity.Time_nvc;
                TrafficstiReport["Time_vc"]      = PortPlaceFactory.ServerTime;
                TrafficstiReport["Date_vc"]      = PortPlaceFactory.ServerJalaliDate;
                TrafficstiReport["username_nvc"] = HPS.Common.CurrentUser.user.UserName_nvc;


                HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory laderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory();
                string LaderTypecondition = "[LaderType_T].[LaderTypeID_int]='" + TrafficEntity.LaderTypeID_int + "'";

                TrafficstiReport["@TrafficID_bint"] = TrafficEntity.TrafficID_bint;
                TrafficstiReport["@Condition"]      = LaderTypecondition;
                TrafficstiReport.Render();

                Properties.Settings s = new HPS.Properties.Settings();
                System.Drawing.Printing.PrinterSettings PrinterSetting = new System.Drawing.Printing.PrinterSettings();
                if (string.IsNullOrEmpty(s.PrinterName))
                {
                    TrafficstiReport.Print(true);
                }
                else
                {
                    PrinterSetting.PrinterName = s.PrinterName;
                    TrafficstiReport.Print(false, PrinterSetting);
                }

                this.Close();
            }
            //سواری وغیره
            else if (_Traffic_bit == false && _Othercar_bit == true)
            {
                //HPS.BLL.TrafficBLL.BLLTraffic_T TrafficEntityrpt = new HPS.BLL.TrafficBLL.BLLTraffic_T();
                OtherCarstiReport.Dictionary.Synchronize();
                OtherCarstiReport.Dictionary.Databases.Clear();
                OtherCarstiReport.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", Hepsa.Core.Common.ConnectionString.ConnectionString));
                OtherCarstiReport.Compile();
                OtherCarstiReport["organ"] = new HPS.BLL.SettingsBLL.BLLSetting_TFactory().GetBy(new BLL.SettingsBLL.BLLSetting_TKeys()
                {
                    SettingID_int = 1029
                }).Value_nvc.ToString();
                OtherCarstiReport["DateTextBox"]      = TrafficEntity.Date_nvc;
                OtherCarstiReport["TimeTextBox"]      = TrafficEntity.Time_nvc;
                OtherCarstiReport["TrafficNumbertxt"] = TrafficEntity.TrafficNumber_bint.ToString();
                OtherCarstiReport["Servicestxt"]      = " مراجعه به : " + TrafficEntity.Services_nvc;
                OtherCarstiReport["CarTypetxt"]       = "نوع وسیله : " + TrafficEntity.System_nvc;
                HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory PlateCityFactory = new HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory();
                HPS.BLL.PlateCityBLL.BLLPlateCity_T        PlatecityEntity  = new HPS.BLL.PlateCityBLL.BLLPlateCity_T();
                HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys    PlateCityKey     = new HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys();
                PlateCityKey.PlateCityID_int = TrafficEntity.PlateCityID_int;
                PlatecityEntity = PlateCityFactory.GetBy(PlateCityKey);
                OtherCarstiReport["NumberPlatetxt"] = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntity.NumberPlate_nvc) + " - " + PlatecityEntity.PlateCity_nvc + " " + TrafficEntity.SerialPlate_nvc;
                HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory BillFactory = new HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory();
                if (TrafficEntity.BillMessageID_int == 0 || TrafficEntity.BillMessageID_int == null)
                {
                    OtherCarstiReport["Messagetxt"] = "";
                }
                else
                {
                    string Billcondition = "[BillMessage_T].[BillMessageID_int]=" + TrafficEntity.BillMessageID_int;
                    List <HPS.BLL.BillMessageBLL.BLLBillMessage_T> BillLst = BillFactory.GetAllByCondition(Billcondition);
                    if (BillLst != null)
                    {
                        OtherCarstiReport["Messagetxt"] = BillLst[0].Message_nvc;
                    }
                    else
                    {
                        OtherCarstiReport["Messagetxt"] = "";
                    }
                }

                NumericTextBox txt = new NumericTextBox();
                txt.DigitsInGroup = 3;
                if (TrafficEntity.Price_dec != null)
                {
                    txt.Text = TrafficEntity.Price_dec.ToString();
                    OtherCarstiReport["Pricetxt"] = " مبلغ دریافتی هنگام ورود " + txt.Text + "  ريال می باشد";
                }
                OtherCarstiReport["AllowableHourtxt"] = TrafficEntity.AllowableHour_int.ToString();
                OtherCarstiReport["ExtraHourtxt"]     = TrafficEntity.ExtraHour_int.ToString();
                txt.Text = TrafficEntity.Fee_dec.ToString();
                OtherCarstiReport["Feetxt"] = txt.Text;
                txt.Text = TrafficEntity.ExtraHourFee_dec.ToString();
                OtherCarstiReport["ExtraHourFeetxt"]      = txt.Text;
                OtherCarstiReport["UserNametxt"]          = TrafficEntity.UserName_nvc;
                OtherCarstiReport["TrafficNumberbarcode"] = TrafficEntity.TrafficNumber_bint.ToString();

                if (TrafficEntity.Printed_bit == true)
                {
                    OtherCarstiReport["txtPrintedAgain"] = "المثنی";
                }
                else
                {
                    OtherCarstiReport["txtPrintedAgain"] = "";
                }

                //DriverName_nvc
                OtherCarstiReport["DriverName_nvc"] = "نام راننده : " + TrafficEntity.FirstName_nvc + " " + TrafficEntity.LastName_nvc;
                OtherCarstiReport["Fee_dec"]        = TrafficEntity.Fee_dec.ToString();
                OtherCarstiReport["PriceTax_dec"]   = TrafficEntity.PriceTax_dec.ToString();
                OtherCarstiReport.Render();

                Properties.Settings s = new HPS.Properties.Settings();
                System.Drawing.Printing.PrinterSettings PrinterSetting = new System.Drawing.Printing.PrinterSettings();
                if (string.IsNullOrEmpty(s.PrinterName))
                {
                    OtherCarstiReport.Print(true);
                }
                else
                {
                    PrinterSetting.PrinterName = s.PrinterName;
                    OtherCarstiReport.Print(false, PrinterSetting);
                }

                this.Close();
            }
            //خارجی
            else if (_Traffic_bit == true && _Othercar_bit == true)
            {
                //HPS.BLL.TrafficBLL.BLLTraffic_T TrafficEntityrpt = new HPS.BLL.TrafficBLL.BLLTraffic_T();
                ForeignCarstiReport.Dictionary.Synchronize();
                ForeignCarstiReport.Dictionary.Databases.Clear();
                ForeignCarstiReport.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", Hepsa.Core.Common.ConnectionString.ConnectionString));
                ForeignCarstiReport.Compile();
                ForeignCarstiReport["organ"] = new HPS.BLL.SettingsBLL.BLLSetting_TFactory().GetBy(new BLL.SettingsBLL.BLLSetting_TKeys()
                {
                    SettingID_int = 1029
                }).Value_nvc.ToString();
                ForeignCarstiReport["DateTextBox"]      = TrafficEntity.Date_nvc;
                ForeignCarstiReport["TimeTextBox"]      = TrafficEntity.Time_nvc;
                ForeignCarstiReport["TrafficNumbertxt"] = TrafficEntity.TrafficNumber_bint.ToString();
                ForeignCarstiReport["DriverNametxt"]    = " نام راننده : " + TrafficEntity.FirstName_nvc + " " + TrafficEntity.LastName_nvc;
                HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory laderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory();
                string LaderTypecondition = "[LaderType_T].[LaderTypeID_int]='" + TrafficEntity.LaderTypeID_int + "'";
                List <HPS.BLL.LaderTypeBLL.BLLLaderType_T> LaderTypeLst = laderTypeFactory.GetAllByCondition(LaderTypecondition);
                if (LaderTypeLst != null)
                {
                    ForeignCarstiReport["CarTypetxt"] = "نوع وسيله : " + TrafficEntity.System_nvc + "-  " + LaderTypeLst[0].LaderType_nvc;
                }
                if (!string.IsNullOrEmpty(TrafficEntity.SerialPlate_nvc))
                {
                    ForeignCarstiReport["NumberPlatetxt"] = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntity.NumberPlate_nvc) + " - " + TrafficEntity.SerialPlate_nvc;
                }
                else
                {
                    ForeignCarstiReport["NumberPlatetxt"] = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntity.NumberPlate_nvc);
                }

                if (TrafficEntity.WithLade_bit == true)
                {
                    ForeignCarstiReport["WithLadetxt"] = "وضعیت : " + "با بار" + "(" + TrafficEntity.Comment_nvc + ") ";
                }
                else
                {
                    ForeignCarstiReport["WithLadetxt"] = "وضعیت : " + "بدون بار";
                }
                NumericTextBox txt = new NumericTextBox();
                txt.DigitsInGroup = 3;
                if (TrafficEntity.Price_dec != null)
                {
                    txt.Text = TrafficEntity.Price_dec.ToString();
                    ForeignCarstiReport["Pricetxt"] = " مبلغ دریافتی هنگام ورود " + txt.Text + "  ريال می باشد";
                }
                ForeignCarstiReport["AllowableHourtxt"] = TrafficEntity.AllowableHour_int.ToString();
                ForeignCarstiReport["ExtraHourtxt"]     = TrafficEntity.ExtraHour_int.ToString();
                txt.Text = TrafficEntity.Fee_dec.ToString();
                ForeignCarstiReport["Feetxt"] = txt.Text;
                txt.Text = TrafficEntity.ExtraHourFee_dec.ToString();
                ForeignCarstiReport["ExtraHourFeetxt"]      = txt.Text;
                ForeignCarstiReport["UserNametxt"]          = TrafficEntity.UserName_nvc;
                ForeignCarstiReport["TrafficNumberbarcode"] = TrafficEntity.TrafficNumber_bint.ToString();
                if (TrafficEntity.Printed_bit == true)
                {
                    ForeignCarstiReport["txtPrintedAgain"] = "المثنی";
                }
                else
                {
                    ForeignCarstiReport["txtPrintedAgain"] = "";
                }
                ForeignCarstiReport["Fee_dec"]      = TrafficEntity.Fee_dec.ToString();
                ForeignCarstiReport["PriceTax_dec"] = TrafficEntity.PriceTax_dec.ToString();
                ForeignCarstiReport.Render();

                Properties.Settings s = new HPS.Properties.Settings();
                System.Drawing.Printing.PrinterSettings PrinterSetting = new System.Drawing.Printing.PrinterSettings();
                if (string.IsNullOrEmpty(s.PrinterName))
                {
                    ForeignCarstiReport.Print(true);
                }
                else
                {
                    PrinterSetting.PrinterName = s.PrinterName;
                    ForeignCarstiReport.Print(false, PrinterSetting);
                }

                this.Close();
            }
            else if (_type == "dublicateTurns")
            {
                BLL.TrafficBLL.BLLTraffic_TFactory trafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
                DataTable duplicateTurnDataTable = new DataTable();
                trafficFactory.DuplicateTurnsReport(duplicateTurnDataTable);
                stiViewerControl1.Report = _sti;


                DuplicateTurnsReport.Dictionary.Synchronize();
                DuplicateTurnsReport.Dictionary.Databases.Clear();
                DuplicateTurnsReport.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", Hepsa.Core.Common.ConnectionString.ConnectionString));
                DuplicateTurnsReport.Compile();
                DuplicateTurnsReport["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();
                DuplicateTurnsReport["date_vc"]     = PortPlaceFactory.ServerJalaliDate + "   " + PortPlaceFactory.ServerTime;;
                DuplicateTurnsReport["userName_vc"] = HPS.Common.CurrentUser.user.UserName_nvc;
                DuplicateTurnsReport.Render();
                DuplicateTurnsReport.Show();
            }
            else if (_again == 1)
            {
                HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_TFactory LadBillCreditFactory = new HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_TFactory();
                HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_TKeys    LadBillKey           = new HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_TKeys();
                LadBillKey.LadBillCreditID_int = _LadBIillCreditID;
                DataTable LadBillLadeAssignmentDataTable = new DataTable();
                LadBillCreditFactory.GetAllLadeAssignment(LadBillKey, ref LadBillLadeAssignmentDataTable);
                Stimulsoft.Report.StiReport LadBillReportstiReport = new Stimulsoft.Report.StiReport();
                LadBillReportstiReport.Load(Application.StartupPath + "\\LadBillCredit.mrt");
                LadBillReportstiReport.Dictionary.Synchronize();
                LadBillReportstiReport.Dictionary.Databases.Clear();
                LadBillReportstiReport.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", Hepsa.Core.Common.ConnectionString.ConnectionString));
                LadBillReportstiReport.Compile();
                LadBillReportstiReport["organ"] = new HPS.BLL.SettingsBLL.BLLSetting_TFactory().GetBy(new BLL.SettingsBLL.BLLSetting_TKeys()
                {
                    SettingID_int = 1029
                }).Value_nvc.ToString();
                if (!string.IsNullOrEmpty(LadBillLadeAssignmentDataTable.Rows[0]["DriverCardNumber_nvc"].ToString()))
                {
                    LadBillReportstiReport["DriverCardNumber_vc"] = " کارت هوشمند راننده: " + LadBillLadeAssignmentDataTable.Rows[0]["DriverCardNumber_nvc"].ToString();
                }
                else
                {
                    LadBillReportstiReport["DriverCardNumber_vc"] = " کارت هوشمند راننده:فاقد كارت ";
                }
                if (!string.IsNullOrEmpty(LadBillLadeAssignmentDataTable.Rows[0]["CarCardNumber_nvc"].ToString()))
                {
                    LadBillReportstiReport["CarCardNumber_vc"] = " کارت هوشمند کامیون : " + LadBillLadeAssignmentDataTable.Rows[0]["CarCardNumber_nvc"].ToString();
                }
                else
                {
                    LadBillReportstiReport["CarCardNumber_vc"] = " کارت هوشمند کامیون :فاقد كارت ";
                }

                LadBillReportstiReport["MobileNumber_vc"]       = string.Format("موبایل راننده: {0}", LadBillLadeAssignmentDataTable.Rows[0]["DriverMobileNumber_nvc"].ToString());
                LadBillReportstiReport["Company_nvc"]           = LadBillLadeAssignmentDataTable.Rows[0]["CompanyID_intCompany_nvc"].ToString() + "(" + LadBillLadeAssignmentDataTable.Rows[0]["CompanyCode_nvc"].ToString() + ")" + "(" + LadBillLadeAssignmentDataTable.Rows[0]["Phone_nvc"].ToString() + ")";                                         //Cmp_nvc
                LadBillReportstiReport["LaderType_nvc"]         = LadBillLadeAssignmentDataTable.Rows[0]["LaderTypeID_intLaderType_nvc"].ToString();
                LadBillReportstiReport["Boxing_nvc"]            = LadBillLadeAssignmentDataTable.Rows[0]["BoxingID_intBoxingType_nvc"].ToString();                                                                                                                                                                                                       //LaderType
                LadBillReportstiReport["PlateNumber_nvc"]       = Hepsa.Core.Common.PersentationController.CorrectNumberPlate(LadBillLadeAssignmentDataTable.Rows[0]["NumberPlate_nvc"].ToString()) + " - " + LadBillLadeAssignmentDataTable.Rows[0]["PlateCity_nvc"].ToString() + LadBillLadeAssignmentDataTable.Rows[0]["SerialPlate_nvc"].ToString(); //Plaque
                LadBillReportstiReport["DriverName_nvc"]        = LadBillLadeAssignmentDataTable.Rows[0]["DriverName"].ToString();                                                                                                                                                                                                                       //Driver
                LadBillReportstiReport["LicenceNumber_bint"]    = (LadBillLadeAssignmentDataTable.Rows[0]["licenceNumber_int"] != DBNull.Value?Convert.ToInt64(LadBillLadeAssignmentDataTable.Rows[0]["licenceNumber_int"]):0);                                                                                                                          //LicenceNumber
                LadBillReportstiReport["LicenceCity_nvc"]       = LadBillLadeAssignmentDataTable.Rows[0]["LicenceCityID_intCity_nvc"].ToString();                                                                                                                                                                                                        //LicenceCity
                LadBillReportstiReport["Good_nvc"]              = LadBillLadeAssignmentDataTable.Rows[0]["GoodID_intGood_nvc"].ToString();                                                                                                                                                                                                               //Good
                LadBillReportstiReport["Date_vc"]               = LadBillLadeAssignmentDataTable.Rows[0]["LadingDate_nvc"].ToString();                                                                                                                                                                                                                   //
                LadBillReportstiReport["Destination_nvc"]       = LadBillLadeAssignmentDataTable.Rows[0]["CityID_intCity_nvc"].ToString() + "-" + LadBillLadeAssignmentDataTable.Rows[0]["Address_nvc"].ToString();
                LadBillReportstiReport["PortajeFee_dec"]        = LadBillLadeAssignmentDataTable.Rows[0]["PortageFee_dec"].ToString();
                LadBillReportstiReport["AssignmentComment_nvc"] = LadBillLadeAssignmentDataTable.Rows[0]["AssignmentComment_nvc"].ToString();
                LadBillReportstiReport["Date_vc"]               = LadBillLadeAssignmentDataTable.Rows[0]["LadBillDate"].ToString();
                LadBillReportstiReport["Time_vc"]               = LadBillLadeAssignmentDataTable.Rows[0]["LadBillTime"].ToString();
                LadBillReportstiReport["TurnNumber_bint"]       = Convert.ToInt64(LadBillLadeAssignmentDataTable.Rows[0]["AcceptedTurnNumber_bint"]);
                LadBillReportstiReport["LadBillNumber_bint"]    = Convert.ToInt64(LadBillLadeAssignmentDataTable.Rows[0]["LadBillCreditID_int"]);
                LadBillReportstiReport["UserName_nvc"]          = LadBillLadeAssignmentDataTable.Rows[0]["LadBillUser"].ToString();
                LadBillReportstiReport["PortPlace_nvc"]         = LadBillLadeAssignmentDataTable.Rows[0]["PortPlaceID_intPortPlaces_nvc"].ToString();
                LadBillReportstiReport["MinWeight_nvc"]         = "از وزن: " + LadBillLadeAssignmentDataTable.Rows[0]["MinWeight_dec"];
                LadBillReportstiReport["MaxWeight_nvc"]         = "تا وزن: " + LadBillLadeAssignmentDataTable.Rows[0]["MaxWeight_dec"];
                LadBillReportstiReport["TrafficNumber_bint"]    = Convert.ToInt64(LadBillLadeAssignmentDataTable.Rows[0]["TrafficNumber_bint"]);
                LadBillReportstiReport["System_nvc"]            = LadBillLadeAssignmentDataTable.Rows[0]["System_nvc"].ToString();
                HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory BillMessage_TFactory = new HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory();
                List <HPS.BLL.BillMessageBLL.BLLBillMessage_T> BillMessage_TList    = new List <HPS.BLL.BillMessageBLL.BLLBillMessage_T>();
                string Condition = string.Format("TrafficType_T.TrafficTypeID_int=9 AND [BillMessage_T].StartDate_nvc<='{0}' AND [BillMessage_T].[EndDate_nvc]>='{0}' ", BillMessage_TFactory.ServerJalaliDate);
                BillMessage_TList = BillMessage_TFactory.GetAllByCondition(Condition);
                if (BillMessage_TList != null && BillMessage_TList.Count > 0)
                {
                    LadBillReportstiReport["BillMessage_nvc"] = BillMessage_TList[0].Message_nvc;
                }
                if (_again != 1)
                {
                    if (LadBillLadeAssignmentDataTable.Rows[0]["LadeDate"].ToString().CompareTo(LadBillCreditFactory.ServerJalaliDate) < 0)
                    {
                        LadBillReportstiReport["Remained_bit"] = true;
                    }
                    else
                    {
                        LadBillReportstiReport["Remained_bit"] = false;
                    }
                }

                if (_again == 1)
                {
                    LadBillReportstiReport["Again_bit"]          = true;
                    LadBillReportstiReport["AgainPrintDate_vc"]  = LadBillCreditFactory.ServerJalaliDate;
                    LadBillReportstiReport["AgainPrintTime_vc"]  = LadBillCreditFactory.ServerTime;
                    LadBillReportstiReport["AgainPrintUser_vnc"] = HPS.Common.CurrentUser.user.UserName_nvc;
                }
                LadBillReportstiReport.Render();
                Properties.Settings s = new HPS.Properties.Settings();
                System.Drawing.Printing.PrinterSettings PrinterSetting = new System.Drawing.Printing.PrinterSettings();
                if (string.IsNullOrEmpty(s.PrinterName))
                {
                    LadBillReportstiReport.PrinterSettings.Copies = 3;
                    LadBillReportstiReport.Print(true);
                }

                else
                {
                    LadBillReportstiReport.PrinterSettings.Copies = 3;
                    PrinterSetting.PrinterName = s.PrinterName;
                    LadBillReportstiReport.Print(false, PrinterSetting);
                }
            }
            else
            {
                stiViewerControl1.Report = _sti;
            }
            this.Close();
        }
Esempio n. 14
0
        public AcceptedTurnReport(HPS.BLL.TrafficBLL.BLLTraffic_T TrafficEntityrpt)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            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 = TrafficID_bint;
            //TrafficEntityrpt = TrafficFactory.GetBy(TrafficKey);

            AcceptedDateTextBox.Text = TrafficEntityrpt.TurnDate_nvc;

            AcceptedTimeTextBox.Text = TrafficEntityrpt.TurnTime_nvc;

            InDateTextBox.Text = TrafficEntityrpt.Date_nvc;
            InTimeTextBox.Text = TrafficEntityrpt.Time_nvc;

            InDatetext2Box.Text = TrafficEntityrpt.Date_nvc;
            InTimetext2Box.Text = TrafficEntityrpt.Time_nvc;

            DateTextBox.Text = TrafficFactory.ServerJalaliDate;
            TimeTextBox.Text = TrafficFactory.ServerTime;

            if (TrafficEntityrpt.AcceptedTurnNumber_bint.HasValue)
            {
                TurnNumber2txt.Text = "شماره نوبت : " + TrafficEntityrpt.AcceptedTurnNumber_bint.ToString();
                TurnNumbertxt.Text  = "شماره نوبت : " + TrafficEntityrpt.AcceptedTurnNumber_bint.ToString();
            }
            else
            {
                TurnNumber2txt.Text = "شماره نوبت رزرو : " + TrafficEntityrpt.TurnNumber_bint.ToString();
                TurnNumbertxt.Text  = "شماره نوبت رزرو : " + TrafficEntityrpt.TurnNumber_bint.ToString();
            }


            TrafficNumbertxt.Text  = "شماره قبض : " + TrafficEntityrpt.TrafficNumber_bint.ToString();
            TrafficNumber2txt.Text = "شماره قبض : " + TrafficEntityrpt.TrafficNumber_bint.ToString();

            DriverNametxt.Text  = " نام راننده : " + TrafficEntityrpt.FirstName_nvc + " " + TrafficEntityrpt.LastName_nvc;
            DriverName2txt.Text = " نام راننده : " + TrafficEntityrpt.FirstName_nvc + " " + TrafficEntityrpt.LastName_nvc;

            HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory laderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory();
            string LaderTypecondition = "[LaderType_T].[LaderTypeID_int]='" + TrafficEntityrpt.LaderTypeID_int + "'";
            List <HPS.BLL.LaderTypeBLL.BLLLaderType_T> LaderTypeLst = laderTypeFactory.GetAllByCondition(LaderTypecondition);

            if (LaderTypeLst != null)
            {
                CarTypetxt.Text  = "نوع وسیله : " + TrafficEntityrpt.System_nvc + "-  " + LaderTypeLst[0].LaderType_nvc; //+ "- کد:" + LaderTypeLst[0].LaderTypeID_int.ToString() ;
                CarType2txt.Text = "نوع وسیله : " + TrafficEntityrpt.System_nvc + "-  " + LaderTypeLst[0].LaderType_nvc;
            }
            HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory PlatecityFactory = new HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory();
            HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys    Platecitykey     = new HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys();
            Platecitykey.PlateCityID_int = TrafficEntityrpt.PlateCityID_int;
            HPS.BLL.PlateCityBLL.BLLPlateCity_T PlateCityEntity = new HPS.BLL.PlateCityBLL.BLLPlateCity_T();
            PlateCityEntity = PlatecityFactory.GetBy(Platecitykey);

            if (PlateCityEntity != null)
            {
                NumberPlatetxt.Text  = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + PlateCityEntity.PlateCity_nvc + " " + TrafficEntityrpt.SerialPlate_nvc;
                NumberPlate2txt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + PlateCityEntity.PlateCity_nvc + " " + TrafficEntityrpt.SerialPlate_nvc;
            }
            else
            {
                NumberPlatetxt.Text  = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + TrafficEntityrpt.SerialPlate_nvc;
                NumberPlate2txt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + TrafficEntityrpt.SerialPlate_nvc;
            }


            DriverCardNumbertxt.Text = "شماره كارت راننده :" + TrafficEntityrpt.DriverCardNumber_nvc;

            CarCardNumbertxt.Text = "شماره كارت كاميون :" + TrafficEntityrpt.CarCardNumber_nvc;

            HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory BillFactory = new HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory();
            if (TrafficEntityrpt.BillMessageID_int == 0 || TrafficEntityrpt.BillMessageID_int == null)
            {
            }
            else
            {
                string Billcondition = "[BillMessage_T].[BillMessageID_int]=" + TrafficEntityrpt.BillMessageID_int;
                List <HPS.BLL.BillMessageBLL.BLLBillMessage_T> BillLst = BillFactory.GetAllByCondition(Billcondition);
                if (BillLst != null)
                {
                    Messagetxt.Text = BillLst[0].Message_nvc;
                }
            }
            HamrahanSystem.TextBox.NumericTextBox txt = new HamrahanSystem.TextBox.NumericTextBox();
            txt.DigitsInGroup = 3;
            if (TrafficEntityrpt.Price_dec != null)
            {
                txt.Text      = TrafficEntityrpt.Price_dec.ToString();
                Pricetxt.Text = " مبلغ دریافت شده هنگام ورود " + txt.Text + "  ريال می باشد";
            }
            UserNametxt.Text = HPS.Common.CurrentUser.user.UserName_nvc;
            if (!string.IsNullOrEmpty(TrafficEntityrpt.AcceptedTurnComment_nvc))
            {
                if (TrafficEntityrpt.Area_bit)
                {
                    Commenttxt.Text = "توضيحات : " + TrafficEntityrpt.AcceptedTurnComment_nvc + " حومه";
                }
                else
                {
                    Commenttxt.Text = "توضيحات : " + TrafficEntityrpt.AcceptedTurnComment_nvc;
                }
            }
            else
            {
                if (TrafficEntityrpt.Area_bit)
                {
                    Commenttxt.Text = "حومه";
                }
            }
            TrafficNumberbarcode.Text     = TrafficEntityrpt.TrafficNumber_bint.ToString();
            TrafficNumber_intbarcode.Text = TrafficEntityrpt.TrafficNumber_bint.ToString();
            //if (!TrafficEntityrpt.DriverOffline_bit)
            //{
            //    OfflineReadtxt.Text = "آنلاین";
            //}
            //else
            //{
            //    OfflineReadtxt.Text = "آفلاین";
            //}
            //////////////
            HPS.BLL.SettingsBLL.BLLSetting_TFactory settingsFactory = new HPS.BLL.SettingsBLL.BLLSetting_TFactory();
            HPS.BLL.SettingsBLL.BLLSetting_T        SettingEntity   = new HPS.BLL.SettingsBLL.BLLSetting_T();
            HPS.BLL.SettingsBLL.BLLSetting_TKeys    SettingKey      = new HPS.BLL.SettingsBLL.BLLSetting_TKeys();
            SettingKey.SettingID_int = 1002;
            SettingEntity            = settingsFactory.GetBy(SettingKey);
            AllowableHourtxt.Text    = SettingEntity.Value_nvc; //TrafficEntityrpt.AllowableHour_int.ToString();
            Feetxt.Text       = txt.Text;
            ExtraHourtxt.Text = TrafficEntityrpt.ExtraHour_int.ToString();

            //if (TrafficEntityrpt.WithFlat_bit==true)
            //{
            //txt.Text = TrafficEntityrpt.ExtraHourFee_dec.ToString();
            //}
            ExtraHourFeetxt.Text = TrafficEntityrpt.ExtraHourFee_dec.ToString();
            //////////////
            if (TrafficEntityrpt.TurnPrinted_bit == true)
            {
                this.txtPrintedAgain.Visible = true;
                UserNametxt.Text             = Hepsa.Core.Common.CurrentUser.User.UserName_nvc;
            }
            else
            {
                this.txtPrintedAgain.Visible = false;
                try
                {
                    TrafficKey.TrafficID_bint        = TrafficEntityrpt.TrafficID_bint;
                    TrafficEntityrpt.TurnPrinted_bit = true;
                    TrafficFactory.BeginProc();
                    TrafficFactory.Update(TrafficEntityrpt, TrafficKey);
                    TrafficFactory.CommitProc();
                }
                catch (Exception ex)
                {
                    TrafficFactory.RollBackProc();
                    throw ex;
                }
            }
        }
Esempio n. 15
0
        public TrafficReport(HPS.BLL.TrafficBLL.BLLTraffic_T TrafficEntity)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();


            this.TrafficEntityrpt = TrafficEntity;

            InDateTextBox.Text = TrafficEntityrpt.Date_nvc;
            InTimeTextBox.Text = TrafficEntityrpt.Time_nvc;

            //InDatetext2Box.Text = TrafficEntityrpt.Date_nvc;
            //InTimetext2Box.Text = TrafficEntityrpt.Time_nvc;

            TrafficNumbertxt.Text = "شماره قبض :   " + TrafficEntityrpt.TrafficNumber_bint.ToString();
            //TrafficNumber2txt.Text = TrafficEntityrpt.TrafficNumber_bint.ToString();
            //DriverName2txt.Text = " نام راننده : " + TrafficEntityrpt.FirstName_nvc + " " + TrafficEntityrpt.LastName_nvc;

            if (TrafficEntityrpt.ServiceID_int == 2)
            {
                if (TrafficEntityrpt.TurnAccepted_bit == true)
                {
                    //نوبت تأیید شده داره
                    TurnNumbertxt.Text = "شماره نوبت :   " + Convert.ToString(TrafficEntityrpt.AcceptedTurnNumber_bint);
                    //AcceptedDate2TextBox.Text = TrafficEntityrpt.TurnDate_nvc;
                    //AcceptedTime2TextBox.Text = TrafficEntityrpt.TurnTime_nvc;
                    //TurnNumber2txt.Text = TrafficEntityrpt.AcceptedTurnNumber_bint.ToString();
                }
                else
                {
                    //نوبت تأیید شده ندارد
                    TurnNumbertxt.Text = "شماره نوبت رزرو :   " + Convert.ToString(TrafficEntityrpt.TurnNumber_bint);
                }
            }
            else
            {
                // (عدم نمایش نوبت (مراجعه به غیر از نوبت

                TurnNumbertxt.Visible       = false;
                TurnNumberAllerttxt.Visible = false;
            }

            //DriverCardNumber2txt.Text = "شماره كارت راننده :" + TrafficEntityrpt.DriverCardNumber_nvc;
            //CarCardNumber2txt.Text = "شماره كارت كاميون :" + TrafficEntityrpt.CarCardNumber_nvc;


            HPS.BLL.ServicesBLL.BLLServices_TFactory servicesFactory = new HPS.BLL.ServicesBLL.BLLServices_TFactory();
            HPS.BLL.ServicesBLL.BLLServices_TKeys    ServicesKey     = new HPS.BLL.ServicesBLL.BLLServices_TKeys();
            ServicesKey.ServicesID_int = TrafficEntity.ServiceID_int;
            DateTextBox.Text           = servicesFactory.ServerJalaliDate;
            TimeTextBox.Text           = servicesFactory.ServerTime;
            HPS.BLL.ServicesBLL.BLLServices_T ServicesEntity = new HPS.BLL.ServicesBLL.BLLServices_T();
            ServicesEntity     = servicesFactory.GetBy(ServicesKey);
            Servicestxt.Text   = " قبض مراجعه به : " + ServicesEntity.ServicesType_nvc;
            DriverNametxt.Text = " نام راننده : " + TrafficEntityrpt.FirstName_nvc + " " + TrafficEntityrpt.LastName_nvc;
            HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory laderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory();
            string LaderTypecondition = "[LaderType_T].[LaderTypeID_int]='" + TrafficEntityrpt.LaderTypeID_int + "'";
            List <HPS.BLL.LaderTypeBLL.BLLLaderType_T> LaderTypeLst = laderTypeFactory.GetAllByCondition(LaderTypecondition);

            if (LaderTypeLst != null)
            {
                CarTypetxt.Text = "نوع وسیله : " + TrafficEntityrpt.System_nvc + "-  " + LaderTypeLst[0].LaderType_nvc;
                //CarType2txt.Text = "نوع وسیله : " + TrafficEntityrpt.System_nvc + "-  " + LaderTypeLst[0].LaderType_nvc; //+ "- کد:" + LaderTypeLst[0].LaderTypeID_int.ToString() ;
            }
            HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory PlatecityFactory = new HPS.BLL.PlateCityBLL.BLLPlateCity_TFactory();
            HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys    Platecitykey     = new HPS.BLL.PlateCityBLL.BLLPlateCity_TKeys();
            Platecitykey.PlateCityID_int = TrafficEntityrpt.PlateCityID_int;
            HPS.BLL.PlateCityBLL.BLLPlateCity_T PlateCityEntity = new HPS.BLL.PlateCityBLL.BLLPlateCity_T();
            PlateCityEntity = PlatecityFactory.GetBy(Platecitykey);
            if (PlateCityEntity != null)
            {
                NumberPlatetxt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + PlateCityEntity.PlateCity_nvc + " " + TrafficEntityrpt.SerialPlate_nvc;
                //NumberPlate2txt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + PlateCityEntity.PlateCity_nvc + " " + TrafficEntityrpt.SerialPlate_nvc;
            }
            else
            {
                NumberPlatetxt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + TrafficEntityrpt.SerialPlate_nvc;
                //NumberPlate2txt.Text = "شماره پلاک : " + Hepsa.Core.Common.PersentationController.CorrectNumberPlate(TrafficEntityrpt.NumberPlate_nvc) + " - " + TrafficEntityrpt.SerialPlate_nvc;
            }
            if (TrafficEntityrpt.WithLade_bit == true)
            {
                WithLadetxt.Text = "وضعیت : " + "با بار" + "(" + TrafficEntityrpt.Comment_nvc + ") ";
            }
            else
            {
                WithLadetxt.Text = "وضعیت : " + "بدون بار";
            }
            HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory BillFactory = new HPS.BLL.BillMessageBLL.BLLBillMessage_TFactory();
            if (TrafficEntityrpt.BillMessageID_int == 0 || TrafficEntityrpt.BillMessageID_int == null)
            {
            }
            else
            {
                string Billcondition = "[BillMessage_T].[BillMessageID_int]=" + TrafficEntityrpt.BillMessageID_int;
                List <HPS.BLL.BillMessageBLL.BLLBillMessage_T> BillLst = BillFactory.GetAllByCondition(Billcondition);
                if (BillLst != null)
                {
                    Messagetxt.Text = BillLst[0].Message_nvc;
                }
            }
            HamrahanSystem.TextBox.NumericTextBox txt = new HamrahanSystem.TextBox.NumericTextBox();
            txt.DigitsInGroup = 3;
            if (TrafficEntityrpt.Price_dec != null)
            {
                txt.Text      = TrafficEntityrpt.Price_dec.ToString();
                Pricetxt.Text = " مبلغ دریافتی هنگام ورود " + txt.Text + "  ريا ل می باشد";
            }

            HPS.BLL.SettingsBLL.BLLSetting_TFactory settingsFactory = new HPS.BLL.SettingsBLL.BLLSetting_TFactory();
            HPS.BLL.SettingsBLL.BLLSetting_T        SettingEntity   = new HPS.BLL.SettingsBLL.BLLSetting_T();
            HPS.BLL.SettingsBLL.BLLSetting_TKeys    SettingKey      = new HPS.BLL.SettingsBLL.BLLSetting_TKeys();
            SettingKey.SettingID_int = 1002;
            SettingEntity            = settingsFactory.GetBy(SettingKey);
            if (TrafficEntityrpt.ServiceID_int == 2)
            {
                AllowableHourtxt.Text = SettingEntity.Value_nvc; //TrafficEntityrpt.AllowableHour_int.ToString();
            }
            else
            {
                AllowableHourtxt.Text = TrafficEntityrpt.AllowableHour_int.ToString();
            }
            txt.Text          = TrafficEntityrpt.Fee_dec.ToString();
            Feetxt.Text       = txt.Text;
            ExtraHourtxt.Text = TrafficEntityrpt.ExtraHour_int.ToString();
            //if (TrafficEntityrpt.WithFlat_bit==true)
            //{
            //txt.Text = TrafficEntityrpt.ExtraHourFee_dec.ToString();
            //}
            txt.Text                  = TrafficEntityrpt.ExtraHourFee_dec.ToString();
            ExtraHourFeetxt.Text      = txt.Text;
            UserNametxt.Text          = TrafficEntityrpt.UserName_nvc;
            TrafficNumberbarcode.Text = TrafficEntityrpt.TrafficNumber_bint.ToString();
            if (TrafficEntityrpt.TurnHour_int != null)
            {
                TurnNumberAllerttxt.Text = " شماره نوبت شما رزرو می باشد لطفاً تا " + TrafficEntityrpt.TurnHour_int.ToString() + " ساعت نسبت به تأیید آن اقدام نمایید";
            }
            if (TrafficEntityrpt.Printed_bit == true)
            {
                this.txtPrintedAgain.Visible = true;
            }
            else
            {
                this.txtPrintedAgain.Visible = false;
                HPS.BLL.TrafficBLL.BLLTraffic_TFactory TrafficFactory = new HPS.BLL.TrafficBLL.BLLTraffic_TFactory();
                try
                {
                    HPS.BLL.TrafficBLL.BLLTraffic_TKeys TrafficKey = new HPS.BLL.TrafficBLL.BLLTraffic_TKeys();
                    TrafficKey.TrafficID_bint    = TrafficEntityrpt.TrafficID_bint;
                    TrafficEntityrpt.Printed_bit = true;
                    TrafficFactory.BeginProc();
                    TrafficFactory.Update(TrafficEntityrpt, TrafficKey);
                    TrafficFactory.CommitProc();
                }
                catch (Exception ex)
                {
                    TrafficFactory.RollBackProc();
                    throw ex;
                }
            }
        }
Esempio n. 16
0
        private void FillGrid()
        {
            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");

            HPS.BLL.CompanyBLL.BLLCompany_TFactory CompanyID_intFactory = new HPS.BLL.CompanyBLL.BLLCompany_TFactory();
            string CompanyCondition = "[Company_T].[Active_bit]='true'";

            CompanyID_intFactory.GetAllByCondition(CompanyCondition, ref CompanyID_intDataTable);
            companyGrid.SetDataBinding(CompanyID_intDataTable, "CompanyID_intDataTable");

            HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_TFactory LadBillCreditFactory = new HPS.BLL.LadBillCreditBLL.BLLLadBillCredit_TFactory();
            DataTable LadbillOrder1Table = new DataTable();

            LadBillCreditFactory.SelectCompanyRemainedLadBillReportOrderColumns(LadbillOrder1Table);
            DataRow emptyRow1 = LadbillOrder1Table.NewRow();

            LadbillOrder1Table.Rows.InsertAt(emptyRow1, 0);
            this.Order1ComboBox.DisplayMember = "PropertyValue";
            this.Order1ComboBox.ValueMember   = "ColumnName";
            this.Order1ComboBox.DataSource    = LadbillOrder1Table;
            this.Order1ComboBox.SelectedIndex = 0;

            DataTable LadbillOrder2Table = new DataTable();

            LadBillCreditFactory.SelectCompanyRemainedLadBillReportOrderColumns(LadbillOrder2Table);
            DataRow emptyRow2 = LadbillOrder2Table.NewRow();

            LadbillOrder2Table.Rows.InsertAt(emptyRow2, 0);
            this.Order2ComboBox.DisplayMember = "PropertyValue";
            this.Order2ComboBox.ValueMember   = "ColumnName";
            this.Order2ComboBox.DataSource    = LadbillOrder2Table;
            this.Order2ComboBox.SelectedIndex = 0;

            DataTable LadbillOrder3Table = new DataTable();

            LadBillCreditFactory.SelectCompanyRemainedLadBillReportOrderColumns(LadbillOrder3Table);
            DataRow emptyRow3 = LadbillOrder3Table.NewRow();

            LadbillOrder3Table.Rows.InsertAt(emptyRow3, 0);
            this.Order3ComboBox.DisplayMember = "PropertyValue";
            this.Order3ComboBox.ValueMember   = "ColumnName";
            this.Order3ComboBox.DataSource    = LadbillOrder3Table;
            this.Order3ComboBox.SelectedIndex = 0;

            DataTable LadbillOrder4Table = new DataTable();

            LadBillCreditFactory.SelectCompanyRemainedLadBillReportOrderColumns(LadbillOrder4Table);
            DataRow emptyRow4 = LadbillOrder4Table.NewRow();

            LadbillOrder4Table.Rows.InsertAt(emptyRow4, 0);
            this.Order4ComboBox.DisplayMember = "PropertyValue";
            this.Order4ComboBox.ValueMember   = "ColumnName";
            this.Order4ComboBox.DataSource    = LadbillOrder4Table;
            this.Order4ComboBox.SelectedIndex = 0;

            DataTable LadbillOrder5Table = new DataTable();

            LadBillCreditFactory.SelectCompanyRemainedLadBillReportOrderColumns(LadbillOrder5Table);
            DataRow emptyRow5 = LadbillOrder5Table.NewRow();

            LadbillOrder5Table.Rows.InsertAt(emptyRow5, 0);
            this.Order5ComboBox.DisplayMember = "PropertyValue";
            this.Order5ComboBox.ValueMember   = "ColumnName";
            this.Order5ComboBox.DataSource    = LadbillOrder5Table;
            this.Order5ComboBox.SelectedIndex = 0;

            HPS.BLL.GoodBLL.BLLGood_TFactory GoodFactory = new HPS.BLL.GoodBLL.BLLGood_TFactory();
            DataTable GoodID_intDataTable = new DataTable();

            GoodFactory.GetAll(ref GoodID_intDataTable);
            goodGrid.SetDataBinding(GoodID_intDataTable, "GoodID_intDataTable");

            HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory PortPlaceFactory = new HPS.BLL.PortPlacesBLL.BLLPortPlaces_TFactory();
            DataTable PortPlaceID_intDataTable = new DataTable();
            string    PortPlacesCondition      = "[PortPlaces_T].[Active_bit]='true'";

            PortPlaceFactory.GetAllByCondition(PortPlacesCondition, ref PortPlaceID_intDataTable);
            portPlaceGrid.SetDataBinding(PortPlaceID_intDataTable, "PortPlaceID_intDataTable");

            HPS.BLL.CityBLL.BLLCity_TFactory CityFactory = new HPS.BLL.CityBLL.BLLCity_TFactory();
            DataTable DestinationCityID_intDataTable     = new DataTable();
            string    CityCondition = "[City_T].[Active_bit]='true'";

            CityFactory.GetAllByCondition(CityCondition, ref DestinationCityID_intDataTable);
            destinationCityGrid.SetDataBinding(DestinationCityID_intDataTable, "DestinationCityID_intDataTable");

            this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(CompanyID_intFactory.ServerJalaliDate);
            this.ToDatefaDatePicker.SelectedDateTime   = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(CompanyID_intFactory.ServerJalaliDate);
            //FromTimeTextBox.Text = "08:00:00";
            // ToTimeTextBox.Text = CompanyID_intFactory.ServerTime;
        }