Esempio n. 1
0
        protected override void ShowForm()
        {
            this.FillCombo();
            HPS.BLL.StopFeeBLL.BLLStopFee_TFactory StopFeeFactory = new HPS.BLL.StopFeeBLL.BLLStopFee_TFactory();
            HPS.BLL.StopFeeBLL.BLLStopFee_T        StopFeeEntity  = StopFeeFactory.GetBy((HPS.BLL.StopFeeBLL.BLLStopFee_TKeys)Key);
            if (StopFeeEntity == null)
            {
                throw new HPS.Exceptions.StopFeeNotFound();
            }

            List <HPS.BLL.StopFeeBLL.BLLStopFee_T> StopFeeDateList = StopFeeFactory.GetAllBy(HPS.BLL.StopFeeBLL.BLLStopFee_T.StopFee_TField.StopFeeID_int, ((HPS.BLL.StopFeeBLL.BLLStopFee_TKeys)Key).StopFeeID_int);

            if (StopFeeDateList != null && StopFeeDateList.Count > 0)
            {
                DateTime startDate    = DateTime.Parse((new Hepsa.Core.Common.MyDateTime(StopFeeDateList[0].StartDate_nvc)).MyDate.ToString("yyyy/MM/dd"));
                DateTime startDateNow = DateTime.Parse((new Hepsa.Core.Common.MyDateTime(StartDate_nvcTextBox.Text)).MyDate.ToString("yyyy/MM/dd"));
                DateTime endDate      = DateTime.Parse((new Hepsa.Core.Common.MyDateTime(StopFeeDateList[0].EndDate_nvc)).MyDate.ToString("yyyy/MM/dd"));
                DateTime endDateNow   = DateTime.Parse((new Hepsa.Core.Common.MyDateTime(EndDate_nvcTextBox.Text)).MyDate.ToString("yyyy/MM/dd"));
                DateTime DateServer   = DateTime.Parse((new Hepsa.Core.Common.MyDateTime(StopFeeFactory.ServerJalaliDate)).MyDate.ToString("yyyy/MM/dd"));
                if ((DateServer >= startDate) || DateServer >= endDate)
                {
                    StartDate_nvcTextBox.Enabled                   = false;
                    Fee_decNumericTextBox.Enabled                  = false;
                    AllowedHoure_intNumericTextBox.Enabled         = false;
                    ExtraHour_intNumericTextBox.Enabled            = false;
                    ExtraHourFee_decNumericTextBox.Enabled         = false;
                    TrafficTypeID_intComboBox.Enabled              = false;
                    TrafficTypeID_intNewButton.Enabled             = false;
                    LaderPivotGroupID_intComboBox.Enabled          = false;
                    LaderPivotGroupID_intNewButton.Enabled         = false;
                    WithLadeExtraHourFee_decNumericTextBox.Enabled = false;
                    ServicesID_intComboBox.Enabled                 = false;
                }
                if (DateServer >= endDate)
                {
                    EndDate_nvcTextBox.Enabled = false;
                }
            }

            AllowedHoure_intNumericTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(StopFeeEntity.AllowedHoure_int, TypeCode.Int32).ToString();
            Fee_decNumericTextBox.Text          = Hepsa.Core.Common.PersentationController.GetEntityValue(StopFeeEntity.Fee_dec, TypeCode.Decimal).ToString();
            ExtraHour_intNumericTextBox.Text    = Hepsa.Core.Common.PersentationController.GetEntityValue(StopFeeEntity.ExtraHour_int, TypeCode.Int32).ToString();
            ExtraHourFee_decNumericTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(StopFeeEntity.ExtraHourFee_dec, TypeCode.Decimal));
            Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref TrafficTypeID_intComboBox, StopFeeEntity.TrafficTypeID_int, TypeCode.Int32);
            Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref LaderPivotGroupID_intComboBox, StopFeeEntity.LaderPivotGroupID_int, TypeCode.Int32);
            Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref ServicesID_intComboBox, StopFeeEntity.ServicesID_int, TypeCode.Int32);
            StartDate_nvcTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(StopFeeEntity.StartDate_nvc, TypeCode.String).ToString();
            EndDate_nvcTextBox.Text   = Hepsa.Core.Common.PersentationController.GetEntityValue(StopFeeEntity.EndDate_nvc, TypeCode.String).ToString();
            WithLadeExtraHourFee_decNumericTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(StopFeeEntity.WithLadeExtraHourFee_dec, TypeCode.Decimal));
            start = StopFeeEntity.StartDate_nvc;
            end   = StopFeeEntity.EndDate_nvc;
            Tax_bitcheckBox.Checked = StopFeeEntity.Tax_bit;
            TurnNotLadBillExtraHour_intTextBox.Text    = Hepsa.Core.Common.PersentationController.GetEntityValue(StopFeeEntity.TurnNotLadBillExtraHour_int, TypeCode.Int32).ToString();
            TurnNotLadBillExtraHourFee_decTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(StopFeeEntity.TurnNotLadBillExtraHourFee_dec, TypeCode.Decimal).ToString();
        }