예제 #1
0
        protected override void Insert()
        {
            HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory();
            try
            {
                Properties.Settings Setting = new HPS.Properties.Settings();
                if (SaloonID_intComboBox.SelectedIndex != -1)
                {
                    Setting.SaloonID_int          = (Int32)Hepsa.Core.Common.PersentationController.GetEntityValue(SaloonID_intComboBox.SelectedValue, TypeCode.Int32);
                    Setting.SaloonIDComboBoxIndex = (Int32)Hepsa.Core.Common.PersentationController.GetEntityValue(SaloonID_intComboBox.SelectedIndex, TypeCode.Int32);
                    Setting.Save();
                }
                else
                {
                    Setting.SaloonID_int          = 0;
                    Setting.SaloonIDComboBoxIndex = 0;
                    Setting.Save();
                }


                this.ClearForm(this);
            }
            catch (Exception ex)
            {
                LaderTypeFactory.RollBackProc();
                throw ex;
            }
        }
예제 #2
0
        private void PrinterSelectionButton_Click(object sender, EventArgs e)
        {
            PrintDialog dlg = new PrintDialog();

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                Properties.Settings s = new HPS.Properties.Settings();
                s.PrinterName = dlg.PrinterSettings.PrinterName;
                s.Save();
            }
        }
예제 #3
0
 private void AllLatoolStripButton_Click(object sender, EventArgs e)
 {
     try
     {
         HPS.BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory LadeAssignmentFactory = new HPS.BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory();
         DataTable           LadeAssignmentDataTable = new DataTable();
         Properties.Settings Setting = new HPS.Properties.Settings();
         LadeAssignmentFactory.GetAll(ref LadeAssignmentDataTable, null, Setting.SaloonID_int);
         this.LadeAssignmentGridView.DataSource = LadeAssignmentDataTable;
     }
     catch (Exception ex)
     {
         Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
     }
 }
예제 #4
0
 private void LoadLadeAssignment()
 {
     try
     {
         HPS.BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory LadeAssignmentFactory = new HPS.BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory();
         Properties.Settings Setting       = new HPS.Properties.Settings();
         string    Condition               = string.Format("[LadeAssignment_T].[Accepted_bit]='false' AND (SaloonID_int IS NULL OR LT.SaloonID_int={0}) ", Setting.SaloonID_int != 0 ? Setting.SaloonID_int : 0);
         DataTable LadeAssignmentDataTable = new DataTable();
         LadeAssignmentFactory.GetForAccept(Condition, ref LadeAssignmentDataTable);
         this.LadeAssignmentGridView.SetDataBinding(LadeAssignmentDataTable, "LadeAssignmentDataTable");
     }
     catch (System.Exception ex)
     {
         Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
     }
 }
예제 #5
0
 private void LoadLadeAssignment()
 {
     try
     {
         HPS.BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory LadeAssignmentFactory = new HPS.BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory();
         DataTable           LadeAssignmentDataTable = new DataTable();
         Properties.Settings Setting = new HPS.Properties.Settings();
         LadeAssignmentFactory.GetAll(ref LadeAssignmentDataTable, LadeAssignmentFactory.ServerJalaliDate, Setting.SaloonID_int);
         this.LadeAssignmentGridView.DataSource     = LadeAssignmentDataTable;
         this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(LadeAssignmentFactory.ServerJalaliDate);
         this.ToDatefaDatePicker.SelectedDateTime   = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(LadeAssignmentFactory.ServerJalaliDate);
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }
예제 #6
0
        private void LoadLadeAssignment()
        {
            try
            {
                HPS.BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory LadeAssignmentFactory = new HPS.BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory();
                DataTable           LadeAssignmentDataTable = new DataTable();
                Properties.Settings Setting = new HPS.Properties.Settings();
                LadeAssignmentFactory.GetAll(ref LadeAssignmentDataTable, LadeAssignmentFactory.ServerJalaliDate, Setting.SaloonID_int);
                if (HPS.Common.CurrentUser.user.CompanyID_int == null)
                {
                    throw new ApplicationException("شما کاربر شرکت نیستید");
                }
                DataRow[] drSource = null;
                drSource = LadeAssignmentDataTable.Select(String.Format("[CompanyID_int]={0}", HPS.Common.CurrentUser.user.CompanyID_int));
                if (drSource != null && drSource.Length > 0)
                {
                    this.LadeAssignmentGridView.DataSource     = drSource.CopyToDataTable();
                    this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(LadeAssignmentFactory.ServerJalaliDate);
                    this.ToDatefaDatePicker.SelectedDateTime   = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(LadeAssignmentFactory.ServerJalaliDate);
                }
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
            //try
            //{
            //    HPS.BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory LadeAssignmentFactory = new HPS.BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory();
            //    Properties.Settings Setting = new HPS.Properties.Settings();
            //    DataTable LadeAssignmentDataTable = new DataTable();

            //    //LadeAssignmentFactory.GetAll(ref Ladeassgnm [LadeAssignment_T].[CompanyID_int], LadeAssignmentFactory.ServerJalaliDate, Setting.SaloonID_int);

            //    var pep = LadeAssignmentFactory.GetAllByCondition(String.Format("[LadeAssignment_T].[CompanyID_int]={0}", HPS.Common.CurrentUser.user.CompanyID_int));
            //    this.LadeAssignmentGridView.DataSource = pep;
            //    this.FromDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(LadeAssignmentFactory.ServerJalaliDate);
            //    this.ToDatefaDatePicker.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(LadeAssignmentFactory.ServerJalaliDate);

            //}
            //catch (System.Exception ex)
            //{
            //    throw ex;
            //}
        }
예제 #7
0
 private void ChooseSaloonForm_Load(object sender, EventArgs e)
 {
     try
     {
         if (this.State == enmFormState.Add)
         {
             this.FillCombo();
         }
         Properties.Settings Setting = new HPS.Properties.Settings();
         if (Setting.SaloonID_int != 0)
         {
             SaloonID_intComboBox.SelectedIndex = Setting.SaloonIDComboBoxIndex;
         }
     }
     catch (Exception ex)
     {
         Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
         this.Close();
     }
 }
예제 #8
0
 private void LoadLadeAssignmentWithDate()
 {
     try
     {
         HPS.BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory LadeAssignmentFactory = new HPS.BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory();
         Properties.Settings Setting = new HPS.Properties.Settings();
         string Condition            = string.Empty;
         if (Setting.SaloonID_int != 0)
         {
             Condition = string.Format("[LadeAssignment_T].[Accepted_bit]='false' AND LadeAssignment_T.LadingDate_nvc='{0}' AND (LT.SaloonID_int ={1}) ", LadeAssignmentFactory.ServerJalaliDate, Setting.SaloonID_int);
         }
         else
         {
             Condition = string.Format("[LadeAssignment_T].[Accepted_bit]='false' AND LadeAssignment_T.LadingDate_nvc='{0}' ", LadeAssignmentFactory.ServerJalaliDate);
         }
         LadeAssignmentDataTable.Clear();
         LadeAssignmentFactory.GetForAccept(Condition, ref LadeAssignmentDataTable);
         LadeAssignmentGridView.DataSource = null;
         this.LadeAssignmentGridView.SetDataBinding(LadeAssignmentDataTable, "LadeAssignmentDataTable");
         Janus.Windows.GridEX.GridEXFormatStyle Focus = new Janus.Windows.GridEX.GridEXFormatStyle();
         Focus.FontSize = 20;
         Janus.Windows.GridEX.GridEXFormatStyle yellow = new Janus.Windows.GridEX.GridEXFormatStyle();
         yellow.BackColor = System.Drawing.Color.FromArgb(253, 217, 142);
         for (int i = 0; i < ((DataTable)LadeAssignmentGridView.DataSource).Rows.Count; i++)
         {
             if (LadeAssignmentGridView.GetRow(i).Cells["EditUserName_nvc"].Value != DBNull.Value && LadeAssignmentGridView.GetRow(i).Cells["AcceptUserName_nvc"].Value != DBNull.Value)
             {
                 LadeAssignmentGridView.GetRow(i).RowStyle = yellow;
                 LadeAssignmentGridView.GetRow(i).Cells["EditUserName_nvc"].FormatStyle = yellow;
             }
         }
         ChooseLadeAssignmentAcceptedButton.Select();
     }
     catch (System.Exception ex)
     {
         Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
     }
 }
예제 #9
0
        private void ShowButton_Click(object sender, EventArgs e)
        {
            try
            {
                string Condition            = string.Empty;
                Properties.Settings Setting = new HPS.Properties.Settings();
                Int32?SaloonID_int          = null;
                if (Setting.SaloonID_int != 0)
                {
                    SaloonID_int = Setting.SaloonID_int;
                }

                HPS.BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory LadeAssignmentFactory = new HPS.BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory();
                DataTable LadeAssignmentDataTable = new DataTable();

                if (string.IsNullOrEmpty(LadeAssingmentID_binttextBox.Text))
                {
                    if (!FromDatefaDatePicker.IsNull)
                    {
                        Hepsa.Core.Validation.DateRule <string> FromDateValidator = new Hepsa.Core.Validation.DateRule <string>("FromDate", "از تاریخ", null, null);
                        if (FromDateValidator.Validate(FromDatefaDatePicker.Text) == false)
                        {
                            throw new ApplicationException(FromDateValidator.Description);
                        }
                        else
                        {
                            DateTime MiladiCurrentDate = LadeAssignmentFactory.ServerDate.AddDays(-30);
                            Hepsa.Core.Common.MyDateTime OneMonthBeforeCurrentDate = new Hepsa.Core.Common.MyDateTime(MiladiCurrentDate);
                            if (FromDatefaDatePicker.Text.CompareTo(OneMonthBeforeCurrentDate.ConvertToPersianShortDate()) < 0)
                            {
                                throw new ApplicationException("تاریخ شروع نمی تواند کمتر از یک ماه اخیر باشد");
                            }
                            Condition = string.Format("Date_nvc >= '{0}'", FromDatefaDatePicker.Text);
                        }
                    }

                    if (!ToDatefaDatePicker.IsNull)
                    {
                        Hepsa.Core.Validation.DateRule <string> ToDateValidator = new Hepsa.Core.Validation.DateRule <string>("ToDate", "تا تاریخ", null, null);
                        if (ToDateValidator.Validate(ToDatefaDatePicker.Text) == false)
                        {
                            throw new ApplicationException(ToDateValidator.Description);
                        }
                        else
                        {
                            Condition = string.Format(" {0} And  Date_nvc <='{1}'", Condition, ToDatefaDatePicker.Text);
                        }
                    }


                    if (HPS.Common.CurrentUser.user.CompanyID_int != null)
                    {
                        Condition = string.Format("{0} And CompanyID_int = {1}", Condition, HPS.Common.CurrentUser.user.CompanyID_int);
                    }
                    if (this.LaderTypeID_intComboBox.SelectedIndex != -1)
                    {
                        Condition = string.Format("{0} And LaderTypeID = {1}", Condition, LaderTypeID_intComboBox.SelectedValue.ToString());
                    }

                    if (GoodID_intcomboBox.SelectedIndex != -1)
                    {
                        Condition = string.Format("{0} And GoodID_int = {1}", Condition, GoodID_intcomboBox.SelectedValue.ToString());
                    }
                    if (PortPlaceID_intcomboBox.SelectedIndex != -1)
                    {
                        Condition = string.Format("{0} And PortPlaceID_int = {1}", Condition, PortPlaceID_intcomboBox.SelectedValue.ToString());
                    }
                    if (DestinationCityID_intcomboBox.SelectedIndex != -1)
                    {
                        Condition = string.Format("{0} And CityID_int = {1} ", Condition, DestinationCityID_intcomboBox.SelectedValue.ToString());
                    }

                    if (Condition.Length > 0)
                    {
                        if (Condition.Substring(0, 4) == " And")
                        {
                            Condition = Condition.Substring(4, Condition.Length - 4);
                        }
                    }
                }
                else
                {
                    DestinationCityID_intcomboBox.SelectedIndex = -1;
                    PortPlaceID_intcomboBox.SelectedIndex       = -1;
                    GoodID_intcomboBox.SelectedIndex            = -1;
                    LaderTypeID_intComboBox.SelectedIndex       = -1;
                    this.FromDatefaDatePicker.IsNull            = true;
                    this.ToDatefaDatePicker.IsNull = true;
                    if (HPS.Common.CurrentUser.user.CompanyID_int != null)
                    {
                        Condition = string.Format("CompanyID_int = {0} and ", HPS.Common.CurrentUser.user.CompanyID_int);
                    }
                    Condition += string.Format(" LadeAssignmentID_bint = {0} ", LadeAssingmentID_binttextBox.Text);
                }

                LadeAssignmentFactory.GetAllByCondition(Condition, SaloonID_int, ref LadeAssignmentDataTable);
                this.LadeAssignmentGridView.AutoGenerateColumns = false;
                this.LadeAssignmentGridView.DataSource          = LadeAssignmentDataTable;
            }
            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
예제 #10
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();
        }
예제 #11
0
        private void ShowButton_Click(object sender, EventArgs e)
        {
            try
            {
                string Condition            = string.Empty;
                Properties.Settings Setting = new HPS.Properties.Settings();
                Int32?SaloonID_int          = null;
                if (Setting.SaloonID_int != 0)
                {
                    SaloonID_int = Setting.SaloonID_int;
                }

                HPS.BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory LadeAssignmentFactory = new HPS.BLL.LadeAssignmentBLL.BLLLadeAssignment_TFactory();
                DataTable LadeAssignmentDataTable = new DataTable();

                if (string.IsNullOrEmpty(LadeAssingmentID_binttextBox.Text))
                {
                    if (!FromDatefaDatePicker.IsNull)
                    {
                        Hepsa.Core.Validation.DateRule <string> FromDateValidator = new Hepsa.Core.Validation.DateRule <string>("FromDate", "از تاریخ", null, null);
                        if (FromDateValidator.Validate(FromDatefaDatePicker.Text) == false)
                        {
                            throw new ApplicationException(FromDateValidator.Description);
                        }
                        else
                        {
                            Condition = string.Format("Date_nvc >= '{0}'", FromDatefaDatePicker.Text);
                        }
                    }

                    if (!ToDatefaDatePicker.IsNull)
                    {
                        Hepsa.Core.Validation.DateRule <string> ToDateValidator = new Hepsa.Core.Validation.DateRule <string>("ToDate", "تا تاریخ", null, null);
                        if (ToDateValidator.Validate(ToDatefaDatePicker.Text) == false)
                        {
                            throw new ApplicationException(ToDateValidator.Description);
                        }
                        else
                        {
                            Condition = string.Format(" {0} And  Date_nvc <='{1}'", Condition, ToDatefaDatePicker.Text);
                        }
                    }


                    if (this.CompanyID_intComboBox.SelectedIndex != -1)
                    {
                        Condition = string.Format("{0} And CompanyID_int = {1}", Condition, CompanyID_intComboBox.SelectedValue.ToString());
                    }
                    if (this.LaderTypeID_intComboBox.SelectedIndex != -1)
                    {
                        Condition = string.Format("{0} And LaderTypeID = {1}", Condition, LaderTypeID_intComboBox.SelectedValue.ToString());
                    }

                    if (GoodID_intcomboBox.SelectedIndex != -1)
                    {
                        Condition = string.Format("{0} And GoodID_int = {1}", Condition, GoodID_intcomboBox.SelectedValue.ToString());
                    }
                    if (PortPlaceID_intcomboBox.SelectedIndex != -1)
                    {
                        Condition = string.Format("{0} And PortPlaceID_int = {1}", Condition, PortPlaceID_intcomboBox.SelectedValue.ToString());
                    }
                    if (DestinationCityID_intcomboBox.SelectedIndex != -1)
                    {
                        Condition = string.Format("{0} And CityID_int = {1} ", Condition, DestinationCityID_intcomboBox.SelectedValue.ToString());
                    }

                    if (Condition.Length > 0)
                    {
                        if (Condition.Substring(0, 4) == " And")
                        {
                            Condition = Condition.Substring(4, Condition.Length - 4);
                        }
                    }
                }
                else
                {
                    DestinationCityID_intcomboBox.SelectedIndex = -1;
                    PortPlaceID_intcomboBox.SelectedIndex       = -1;
                    GoodID_intcomboBox.SelectedIndex            = -1;
                    LaderTypeID_intComboBox.SelectedIndex       = -1;
                    CompanyID_intComboBox.SelectedIndex         = -1;
                    this.FromDatefaDatePicker.IsNull            = true;
                    //.SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(LadeAssignmentFactory.ServerJalaliDate);
                    this.ToDatefaDatePicker.IsNull = true;
                    //SelectedDateTime = FarsiLibrary.Utils.PersianDateConverter.ToGregorianDateTime(LadeAssignmentFactory.ServerJalaliDate);
                    Condition = string.Format(" LadeAssignmentID_bint = {0} ", LadeAssingmentID_binttextBox.Text);
                }

                LadeAssignmentFactory.GetAllByCondition(Condition, SaloonID_int, ref LadeAssignmentDataTable);
                this.LadeAssignmentGridView.AutoGenerateColumns = false;
                this.LadeAssignmentGridView.DataSource          = LadeAssignmentDataTable;
            }
            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }