Exemple #1
0
        protected override void Edit()
        {
            HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory LaderPivotGroupFactory = new HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory();
            try
            {
                HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T LaderPivotGroupEntity = new HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T();
                LaderPivotGroupEntity.LaderPivotGroup_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderPivotGroup_nvcTextBox.Text, TypeCode.String).ToString();

                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.EditMessage) == true)
                {
                    LaderPivotGroupFactory.BeginProc();
                    LaderPivotGroupFactory.Update(LaderPivotGroupEntity, (HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TKeys)Key);
                    LaderPivotGroupFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T.LaderPivotGroup_TField.LaderPivotGroupID_int.ToString() + "='" + ((HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TKeys)Key).LaderPivotGroupID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0][HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T.LaderPivotGroup_TField.LaderPivotGroup_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderPivotGroupEntity.LaderPivotGroup_nvc, TypeCode.String);
                        }
                        DataTable.AcceptChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                LaderPivotGroupFactory.RollBackProc();
                throw ex;
            }
        }
Exemple #2
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory LaderPivotGroupFactory = new HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmDeleteMessage() == false)
                {
                    return;
                }


                HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory LaderPivotGroup_TFactory = new HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory();
                HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TKeys    LaderPivotGroupKey       = new HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TKeys();

                LaderPivotGroupKey.LaderPivotGroupID_int = (Int32?)LaderPivotGroupGridView.CurrentRow.Cells["colLaderPivotGroupID_int"].Value;
                LaderPivotGroupFactory.Delete(LaderPivotGroupKey);

                DataRow[] dr = ((DataTable)this.LaderPivotGroupGridView.DataSource).Select(HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T.LaderPivotGroup_TField.LaderPivotGroupID_int.ToString() + "='" + LaderPivotGroupKey.LaderPivotGroupID_int.ToString() + "'");
                if (dr.Length > 0)
                {
                    dr[0].Delete();
                }
                ((DataTable)this.LaderPivotGroupGridView.DataSource).AcceptChanges();
            }

            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
Exemple #3
0
        private void FillCombo()
        {
            try
            {
                HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory TrafficTypeID_intFactory = new HPS.BLL.TrafficTypeBLL.BLLTrafficType_TFactory();
                DataTable TrafficTypeID_intDataTable = new DataTable();
                TrafficTypeID_intFactory.GetAll(ref TrafficTypeID_intDataTable);
                this.TrafficTypeID_intComboBox.DisplayMember = HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficType_nvc.ToString();
                this.TrafficTypeID_intComboBox.ValueMember   = HPS.BLL.TrafficTypeBLL.BLLTrafficType_T.TrafficType_TField.TrafficTypeID_int.ToString();
                this.TrafficTypeID_intComboBox.DataSource    = TrafficTypeID_intDataTable;
                this.TrafficTypeID_intComboBox.SelectedIndex = -1;


                HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory LaderPivotGroupID_intFactory = new HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory();
                DataTable LaderPivotGroupID_intDataTable = new 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.ServicesBLL.BLLServices_TFactory ServicesID_intFactory = new HPS.BLL.ServicesBLL.BLLServices_TFactory();
                DataTable ServicesID_intDataTable = new DataTable();
                ServicesID_intFactory.GetAll(ref ServicesID_intDataTable);
                this.ServicesID_intComboBox.DisplayMember = HPS.BLL.ServicesBLL.BLLServices_T.Services_TField.ServicesType_nvc.ToString();
                this.ServicesID_intComboBox.ValueMember   = HPS.BLL.ServicesBLL.BLLServices_T.Services_TField.ServicesID_int.ToString();
                this.ServicesID_intComboBox.DataSource    = ServicesID_intDataTable;
                this.ServicesID_intComboBox.SelectedIndex = -1;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #4
0
        protected override void Insert()
        {
            HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory LaderPivotGroupFactory = new HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory();
            try
            {
                HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T LaderPivotGroupEntity = new HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T();
                LaderPivotGroupEntity.LaderPivotGroup_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderPivotGroup_nvcTextBox.Text, TypeCode.String).ToString();

                LaderPivotGroupFactory.BeginProc();
                LaderPivotGroupFactory.Insert(LaderPivotGroupEntity);
                LaderPivotGroupFactory.CommitProc();
                if (DataTable != null)
                {
                    DataRow dr = this.DataTable.NewRow();
                    dr[HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T.LaderPivotGroup_TField.LaderPivotGroupID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderPivotGroupEntity.LaderPivotGroupID_int, TypeCode.Int32);
                    dr[HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T.LaderPivotGroup_TField.LaderPivotGroup_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderPivotGroupEntity.LaderPivotGroup_nvc, TypeCode.String);

                    DataTable.Rows.Add(dr);
                    DataTable.AcceptChanges();
                }
                this.ClearForm(this);
            }
            catch (Exception ex)
            {
                LaderPivotGroupFactory.RollBackProc();
                throw ex;
            }
        }
Exemple #5
0
        protected override void Delete()
        {
            HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory LaderPivotGroupFactory = new HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.DeleteMessage) == true)
                {
                    LaderPivotGroupFactory.BeginProc();
                    LaderPivotGroupFactory.Delete((HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TKeys)Key);
                    LaderPivotGroupFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T.LaderPivotGroup_TField.LaderPivotGroupID_int.ToString() + "='" + ((HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TKeys)Key).LaderPivotGroupID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0].Delete();
                        }
                        DataTable.AcceptChanges();
                    }
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                LaderPivotGroupFactory.RollBackProc();
                throw ex;
            }
        }
Exemple #6
0
 protected override void ShowForm()
 {
     this.FillCombo();
     HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory LaderPivotGroupFactory = new HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory();
     HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T        LaderPivotGroupEntity  = LaderPivotGroupFactory.GetBy((HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TKeys)Key);
     if (LaderPivotGroupEntity == null)
     {
         throw new HPS.Exceptions.LaderPivotGroupNotFound();
     }
     LaderPivotGroup_nvcTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderPivotGroupEntity.LaderPivotGroup_nvc, TypeCode.String).ToString();
 }
Exemple #7
0
 private void LoadLaderPivotGroup()
 {
     try
     {
         HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory LaderPivotGroupFactory = new HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory();
         DataTable LaderPivotGroupDataTable = new DataTable();
         LaderPivotGroupFactory.GetAll(ref LaderPivotGroupDataTable);
         this.LaderPivotGroupGridView.DataSource = LaderPivotGroupDataTable;
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }
Exemple #8
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;
            }
        }
Exemple #9
0
 private void FillCombo()
 {
     try
     {
         HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory LaderPivotGroupID_intFactory = new HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TFactory();
         DataTable LaderPivotGroupID_intDataTable = new 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;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }