Beispiel #1
0
 public void GetBy(HPS.BLL.OfflineSecondPartSoftwareBLL.BLLOfflineSecondPartSoftware_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 #2
0
 public void Delete(HPS.BLL.OfflineSecondPartSoftwareBLL.BLLOfflineSecondPartSoftware_TKeys keys)
 {
     try
     {
         _dataObject.Delete(keys);
     }
     catch (System.Exception ex)
     {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
Beispiel #3
0
        public void SelectByPrimaryKey(HPS.BLL.OfflineSecondPartSoftwareBLL.BLLOfflineSecondPartSoftware_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_OfflineSecondPartSoftware_T_SelectByPrimaryKey]";
            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         = businessObjectKey.OfflineSecondPartSoftwareID_int;
                this.Command.Parameters.Add(OfflineSecondPartSoftwareID_int);



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

                sqlDataAdapter.Fill(dataTable);

                if (ControlConnection)
                {
                    this.Commit();
                }
            }
            catch (System.Exception ex)
            {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }
Beispiel #4
0
        public HPS.BLL.OfflineSecondPartSoftwareBLL.BLLOfflineSecondPartSoftware_T SelectByPrimaryKey(HPS.BLL.OfflineSecondPartSoftwareBLL.BLLOfflineSecondPartSoftware_TKeys businessObjectKey)
        {
            bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);

            this.Command.CommandText = "[sp_OfflineSecondPartSoftware_T_SelectByPrimaryKey]";
            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         = businessObjectKey.OfflineSecondPartSoftwareID_int;
                this.Command.Parameters.Add(OfflineSecondPartSoftwareID_int);



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

                IDataReader dataReader = this.Command.ExecuteReader();
                HPS.BLL.OfflineSecondPartSoftwareBLL.BLLOfflineSecondPartSoftware_T businessObject = new  HPS.BLL.OfflineSecondPartSoftwareBLL.BLLOfflineSecondPartSoftware_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 #5
0
        public void Update(HPS.BLL.OfflineSecondPartSoftwareBLL.BLLOfflineSecondPartSoftware_T businessObject, HPS.BLL.OfflineSecondPartSoftwareBLL.BLLOfflineSecondPartSoftware_TKeys businessObjectKey)
        {
            bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);

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

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

                SqlParameter DisconnectDate_vc = new SqlParameter();
                DisconnectDate_vc.ParameterName = "@DisconnectDate_vc";
                DisconnectDate_vc.SqlDbType     = SqlDbType.VarChar;
                DisconnectDate_vc.Direction     = ParameterDirection.Input;
                DisconnectDate_vc.IsNullable    = false;
                if (String.IsNullOrEmpty(businessObject.DisconnectDate_vc))
                {
                    DisconnectDate_vc.Value = DBNull.Value;
                }
                else
                {
                    DisconnectDate_vc.Value = businessObject.DisconnectDate_vc;
                }
                this.Command.Parameters.Add(DisconnectDate_vc);

                SqlParameter DisconnectTime_vc = new SqlParameter();
                DisconnectTime_vc.ParameterName = "@DisconnectTime_vc";
                DisconnectTime_vc.SqlDbType     = SqlDbType.VarChar;
                DisconnectTime_vc.Direction     = ParameterDirection.Input;
                DisconnectTime_vc.IsNullable    = true;
                if (String.IsNullOrEmpty(businessObject.DisconnectTime_vc))
                {
                    DisconnectTime_vc.Value = DBNull.Value;
                }
                else
                {
                    DisconnectTime_vc.Value = businessObject.DisconnectTime_vc;
                }
                this.Command.Parameters.Add(DisconnectTime_vc);

                SqlParameter ConnectDate_vc = new SqlParameter();
                ConnectDate_vc.ParameterName = "@ConnectDate_vc";
                ConnectDate_vc.SqlDbType     = SqlDbType.VarChar;
                ConnectDate_vc.Direction     = ParameterDirection.Input;
                ConnectDate_vc.IsNullable    = true;
                if (String.IsNullOrEmpty(businessObject.ConnectDate_vc))
                {
                    ConnectDate_vc.Value = DBNull.Value;
                }
                else
                {
                    ConnectDate_vc.Value = businessObject.ConnectDate_vc;
                }
                this.Command.Parameters.Add(ConnectDate_vc);

                SqlParameter ConnectTime_vc = new SqlParameter();
                ConnectTime_vc.ParameterName = "@ConnectTime_vc";
                ConnectTime_vc.SqlDbType     = SqlDbType.VarChar;
                ConnectTime_vc.Direction     = ParameterDirection.Input;
                ConnectTime_vc.IsNullable    = true;
                if (String.IsNullOrEmpty(businessObject.ConnectTime_vc))
                {
                    ConnectTime_vc.Value = DBNull.Value;
                }
                else
                {
                    ConnectTime_vc.Value = businessObject.ConnectTime_vc;
                }
                this.Command.Parameters.Add(ConnectTime_vc);

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


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

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

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

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

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

                this.Command.ExecuteNonQuery();

                if (ControlConnection)
                {
                    this.Commit();
                }
            }
            catch (System.Exception ex)
            {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }
Beispiel #6
0
 public HPS.BLL.OfflineSecondPartSoftwareBLL.BLLOfflineSecondPartSoftware_T GetBy(HPS.BLL.OfflineSecondPartSoftwareBLL.BLLOfflineSecondPartSoftware_TKeys keys)
 {
     try
     {
         return(_dataObject.SelectByPrimaryKey(keys));
     }
     catch (System.Exception ex)
     {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
Beispiel #7
0
        public void Update(HPS.BLL.OfflineSecondPartSoftwareBLL.BLLOfflineSecondPartSoftware_T businessObject, HPS.BLL.OfflineSecondPartSoftwareBLL.BLLOfflineSecondPartSoftware_TKeys businessObjectKey)
        {
            try
            {
                List <string> ExceptList = new List <string>();
                if (businessObject.OfflineSecondPartSoftwareID_int == businessObjectKey.OfflineSecondPartSoftwareID_int)
                {
                    ExceptList.Add("UniqueOfflineSecondPartSoftwareID_int");
                }
                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);
            }
        }