Ejemplo n.º 1
0
        public HPS.BLL.BLLPlateNumber_T SelectByPrimaryKey(HPS.BLL.BLLPlateNumber_TKeys businessObjectKey)
        {
            bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);

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

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

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



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

                IDataReader dataReader = this.Command.ExecuteReader();
                HPS.BLL.BLLPlateNumber_T businessObject = new HPS.BLL.BLLPlateNumber_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;
            }
        }
Ejemplo n.º 2
0
 public void GetBy(HPS.BLL.BLLPlateNumber_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);
     }
 }
Ejemplo n.º 3
0
 public HPS.BLL.BLLPlateNumber_T GetBy(HPS.BLL.BLLPlateNumber_TKeys keys)
 {
     try
     {
         return(_dataObject.SelectByPrimaryKey(keys));
     }
     catch (System.Exception ex)
     {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
Ejemplo n.º 4
0
 public void Delete(HPS.BLL.BLLPlateNumber_TKeys keys)
 {
     try
     {
         _dataObject.Delete(keys);
     }
     catch (System.Exception ex)
     {
         throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this);
     }
 }
Ejemplo n.º 5
0
        public void SelectByPrimaryKey(HPS.BLL.BLLPlateNumber_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_PlateNumber_T_SelectByPrimaryKey]";
            this.Command.CommandType = CommandType.StoredProcedure;

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

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



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

                sqlDataAdapter.Fill(dataTable);

                if (ControlConnection)
                {
                    this.Commit();
                }
            }
            catch (System.Exception ex)
            {
                if (ControlConnection)
                {
                    this.RollBack();
                }
                throw ex;
            }
        }
Ejemplo n.º 6
0
        public void Update(HPS.BLL.BLLPlateNumber_T businessObject, HPS.BLL.BLLPlateNumber_TKeys businessObjectKey)
        {
            try
            {
                List <string> ExceptList = new List <string>();
                if (businessObject.cameraPicturesID_bint == businessObjectKey.cameraPicturesID_bint)
                {
                    ExceptList.Add("UniquecameraPicturesID_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);
            }
        }
Ejemplo n.º 7
0
        public void Update(HPS.BLL.BLLPlateNumber_T businessObject, HPS.BLL.BLLPlateNumber_TKeys businessObjectKey)
        {
            bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open);

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

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

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

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

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

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

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

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



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

                this.Command.ExecuteNonQuery();

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