Example #1
0
 public void GetBy(HPS.BLL.OnlineUsersWhenConnectionOrNotBLL.BLLOnlineUsersWhenConnectionOrNot_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);
     }
 }
Example #2
0
 public void Delete(HPS.BLL.OnlineUsersWhenConnectionOrNotBLL.BLLOnlineUsersWhenConnectionOrNot_TKeys keys)
 {
     try
     {
         _dataObject.Delete(keys);
     }
     catch (System.Exception ex)
     {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
Example #3
0
        public void SelectByPrimaryKey(HPS.BLL.OnlineUsersWhenConnectionOrNotBLL.BLLOnlineUsersWhenConnectionOrNot_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_OnlineUsersWhenConnectionOrNot_T_SelectByPrimaryKey]";
            this.Command.CommandType = CommandType.StoredProcedure;

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

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



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

                sqlDataAdapter.Fill(dataTable);

                if (ControlConnection)
                {
                    this.Commit();
                }
            }
            catch (System.Exception ex)
            {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }
Example #4
0
        public void Update(HPS.BLL.OnlineUsersWhenConnectionOrNotBLL.BLLOnlineUsersWhenConnectionOrNot_T businessObject, HPS.BLL.OnlineUsersWhenConnectionOrNotBLL.BLLOnlineUsersWhenConnectionOrNot_TKeys businessObjectKey)
        {
            bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);

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

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

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

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


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

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

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

                this.Command.ExecuteNonQuery();

                if (ControlConnection)
                {
                    this.Commit();
                }
            }
            catch (System.Exception ex)
            {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }
Example #5
0
        public HPS.BLL.OnlineUsersWhenConnectionOrNotBLL.BLLOnlineUsersWhenConnectionOrNot_T SelectByPrimaryKey(HPS.BLL.OnlineUsersWhenConnectionOrNotBLL.BLLOnlineUsersWhenConnectionOrNot_TKeys businessObjectKey)
        {
            bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);

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

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

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



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

                IDataReader dataReader = this.Command.ExecuteReader();
                HPS.BLL.OnlineUsersWhenConnectionOrNotBLL.BLLOnlineUsersWhenConnectionOrNot_T businessObject = new HPS.BLL.OnlineUsersWhenConnectionOrNotBLL.BLLOnlineUsersWhenConnectionOrNot_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;
            }
        }
Example #6
0
 public HPS.BLL.OnlineUsersWhenConnectionOrNotBLL.BLLOnlineUsersWhenConnectionOrNot_T GetBy(HPS.BLL.OnlineUsersWhenConnectionOrNotBLL.BLLOnlineUsersWhenConnectionOrNot_TKeys keys)
 {
     try
     {
         return(_dataObject.SelectByPrimaryKey(keys));
     }
     catch (System.Exception ex)
     {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
Example #7
0
        public void Update(HPS.BLL.OnlineUsersWhenConnectionOrNotBLL.BLLOnlineUsersWhenConnectionOrNot_T businessObject, HPS.BLL.OnlineUsersWhenConnectionOrNotBLL.BLLOnlineUsersWhenConnectionOrNot_TKeys businessObjectKey)
        {
            try
            {
                List <string> ExceptList = new List <string>();
                if (businessObject.OnlineUsersWhenConnectionOrNotID_bint == businessObjectKey.OnlineUsersWhenConnectionOrNotID_bint)
                {
                    ExceptList.Add("UniqueOnlineUsersWhenConnectionOrNotID_bint");
                }
                if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, ExceptList.ToArray()) == 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);
            }
        }