Пример #1
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);
            }
        }
Пример #2
0
        private void EditButton_Click(object sender, EventArgs e)
        {
            HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TKeys LaderPivotGroupKey = new HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TKeys();
            LaderPivotGroupKey.LaderPivotGroupID_int = (Int32?)this.LaderPivotGroupGridView.CurrentRow.Cells["colLaderPivotGroupID_int"].Value;
            LaderPivotGroupEntityForm LaderPivotGroup = new LaderPivotGroupEntityForm(BaseEntityForm1.enmState.Edit, (DataTable)this.LaderPivotGroupGridView.DataSource, LaderPivotGroupKey);

            LaderPivotGroup.ShowDialog();
        }
Пример #3
0
 public void GetBy(HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TKeys keys, ref System.Data.DataTable dataTable)
 {
     try{
         _dataObject.SelectByPrimaryKey(keys, ref dataTable);
     }catch (System.Exception ex) {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
Пример #4
0
 public HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T GetBy(HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TKeys keys)
 {
     try{
         return(_dataObject.SelectByPrimaryKey(keys));
     }catch (System.Exception ex) {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
Пример #5
0
 public void Delete(HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TKeys keys)
 {
     try{
         _dataObject.Delete(keys);
     }catch (System.Exception ex) {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
Пример #6
0
        public HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T SelectByPrimaryKey(HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TKeys businessObjectKey)
        {
            bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);

            this.Command.CommandText = "[sp_LaderPivotGroup_T_SelectByPrimaryKey]";
            this.Command.CommandType = CommandType.StoredProcedure;

            try{
                this.Command.Parameters.Clear();

                SqlParameter LaderPivotGroupID_int = new SqlParameter();
                LaderPivotGroupID_int.ParameterName = "@LaderPivotGroupID_int";
                LaderPivotGroupID_int.SqlDbType     = SqlDbType.Int;
                LaderPivotGroupID_int.Direction     = ParameterDirection.Input;
                LaderPivotGroupID_int.IsNullable    = false;
                LaderPivotGroupID_int.Value         = businessObjectKey.LaderPivotGroupID_int;
                this.Command.Parameters.Add(LaderPivotGroupID_int);



                if (ControlConnection)
                {
                    this.BeginTransaction();
                }

                IDataReader dataReader = this.Command.ExecuteReader();
                HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T businessObject = new HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T();
                if (dataReader.Read())
                {
                    PopulateBusinessObjectFromReader(businessObject, dataReader);
                }
                else
                {
                    businessObject = null;
                }

                if (dataReader.IsClosed == false)
                {
                    dataReader.Close();
                }


                if (ControlConnection)
                {
                    this.Commit();
                }
                return(businessObject);
            }
            catch (System.Exception ex) {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }
Пример #7
0
        public void SelectByPrimaryKey(HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TKeys businessObjectKey, ref System.Data.DataTable dataTable)
        {
            bool           ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);
            SqlDataAdapter sqlDataAdapter    = new System.Data.SqlClient.SqlDataAdapter(this.Command);

            this.Command.CommandText = "[sp_LaderPivotGroup_T_SelectByPrimaryKey]";
            this.Command.CommandType = CommandType.StoredProcedure;

            try{
                this.Command.Parameters.Clear();

                SqlParameter LaderPivotGroupID_int = new SqlParameter();
                LaderPivotGroupID_int.ParameterName = "@LaderPivotGroupID_int";
                LaderPivotGroupID_int.SqlDbType     = SqlDbType.Int;
                LaderPivotGroupID_int.Direction     = ParameterDirection.Input;
                LaderPivotGroupID_int.IsNullable    = false;
                LaderPivotGroupID_int.Value         = businessObjectKey.LaderPivotGroupID_int;
                this.Command.Parameters.Add(LaderPivotGroupID_int);



                if (ControlConnection)
                {
                    this.BeginTransaction();
                }

                sqlDataAdapter.Fill(dataTable);

                if (ControlConnection)
                {
                    this.Commit();
                }
            }
            catch (System.Exception ex) {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }
Пример #8
0
        public void Update(HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T businessObject, HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TKeys businessObjectKey)
        {
            bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);

            this.Command.CommandText = "[sp_LaderPivotGroup_T_Update]";
            this.Command.CommandType = CommandType.StoredProcedure;

            try{
                this.Command.Parameters.Clear();

                SqlParameter LaderPivotGroup_nvc = new SqlParameter();
                LaderPivotGroup_nvc.ParameterName = "@LaderPivotGroup_nvc";
                LaderPivotGroup_nvc.SqlDbType     = SqlDbType.NVarChar;
                LaderPivotGroup_nvc.Direction     = ParameterDirection.Input;
                LaderPivotGroup_nvc.IsNullable    = false;
                LaderPivotGroup_nvc.Value         = businessObject.LaderPivotGroup_nvc;
                this.Command.Parameters.Add(LaderPivotGroup_nvc);


                SqlParameter pk_LaderPivotGroupID_int = new SqlParameter();
                pk_LaderPivotGroupID_int.ParameterName = "@pk_LaderPivotGroupID_int";
                pk_LaderPivotGroupID_int.SqlDbType     = SqlDbType.Int;
                pk_LaderPivotGroupID_int.Direction     = ParameterDirection.Input;
                pk_LaderPivotGroupID_int.IsNullable    = false;
                pk_LaderPivotGroupID_int.Value         = businessObjectKey.LaderPivotGroupID_int;
                this.Command.Parameters.Add(pk_LaderPivotGroupID_int);



                if (ControlConnection)
                {
                    this.BeginTransaction();
                }

                this.Command.ExecuteNonQuery();

                if (ControlConnection)
                {
                    this.Commit();
                }
            }
            catch (System.Exception ex) {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }
Пример #9
0
 public LaderPivotGroupEntityForm(Hepsa.Core.PL.BaseEntityParentForm.enmState State, DataTable DataTable, HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TKeys Key)
     : base(State, DataTable, Key)
 {
     InitializeComponent();
 }
Пример #10
0
        public void Update(HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_T businessObject, HPS.BLL.LaderPivotGroupBLL.BLLLaderPivotGroup_TKeys businessObjectKey)
        {
            try{
                if (businessObject.LaderPivotGroupID_int == businessObjectKey.LaderPivotGroupID_int)
                {
                    if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, "UniqueLaderPivotGroupID_int") == false)
                    {
                        throw new Hepsa.Core.Validation.InvalidBusinessObjectException(businessObject.BrokenRulesList().ToString());
                    }
                }
                else
                {
                    if (businessObject.IsValid() == false)
                    {
                        throw new Hepsa.Core.Validation.InvalidBusinessObjectException(businessObject.BrokenRulesList().ToString());
                    }
                }

                _dataObject.Update(businessObject, businessObjectKey);
            }catch (System.Exception ex) {
                throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
            }
        }