Beispiel #1
0
        public HPS.BLL.MultiLaderTypeBLL.BLLMultiLaderType_T SelectByPrimaryKey(HPS.BLL.MultiLaderTypeBLL.BLLMultiLaderType_TKeys businessObjectKey)
        {
            bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);

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

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

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



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

                IDataReader dataReader = this.Command.ExecuteReader();
                HPS.BLL.MultiLaderTypeBLL.BLLMultiLaderType_T businessObject = new HPS.BLL.MultiLaderTypeBLL.BLLMultiLaderType_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;
            }
        }
Beispiel #2
0
 public void GetBy(HPS.BLL.MultiLaderTypeBLL.BLLMultiLaderType_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);
     }
 }
Beispiel #3
0
 public HPS.BLL.MultiLaderTypeBLL.BLLMultiLaderType_T GetBy(HPS.BLL.MultiLaderTypeBLL.BLLMultiLaderType_TKeys keys)
 {
     try
     {
         return(_dataObject.SelectByPrimaryKey(keys));
     }
     catch (System.Exception ex)
     {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
Beispiel #4
0
 public void Delete(HPS.BLL.MultiLaderTypeBLL.BLLMultiLaderType_TKeys keys)
 {
     try
     {
         _dataObject.Delete(keys);
     }
     catch (System.Exception ex)
     {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
Beispiel #5
0
        public void SelectByPrimaryKey(HPS.BLL.MultiLaderTypeBLL.BLLMultiLaderType_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_MultiLaderType_T_SelectByPrimaryKey]";
            this.Command.CommandType = CommandType.StoredProcedure;

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

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



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

                sqlDataAdapter.Fill(dataTable);

                if (ControlConnection)
                {
                    this.Commit();
                }
            }
            catch (System.Exception ex)
            {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }
Beispiel #6
0
        public void Update(HPS.BLL.MultiLaderTypeBLL.BLLMultiLaderType_T businessObject, HPS.BLL.MultiLaderTypeBLL.BLLMultiLaderType_TKeys businessObjectKey)
        {
            try
            {
                if (businessObject.MultiLaderTypeID_int == businessObjectKey.MultiLaderTypeID_int)
                {
                    if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, "UniqueMultiLaderTypeID_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);
            }
        }
Beispiel #7
0
        public void Update(HPS.BLL.MultiLaderTypeBLL.BLLMultiLaderType_T businessObject, HPS.BLL.MultiLaderTypeBLL.BLLMultiLaderType_TKeys businessObjectKey)
        {
            bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);

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

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

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

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


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



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

                this.Command.ExecuteNonQuery();

                if (ControlConnection)
                {
                    this.Commit();
                }
            }
            catch (System.Exception ex)
            {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }