public void GetBy(HPS.BLL.OutCameraPicturesBLL.BLLOutCameraPictures_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); } }
public HPS.BLL.OutCameraPicturesBLL.BLLOutCameraPictures_T GetBy(HPS.BLL.OutCameraPicturesBLL.BLLOutCameraPictures_TKeys keys) { try { return(_dataObject.SelectByPrimaryKey(keys)); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
public void Delete(HPS.BLL.OutCameraPicturesBLL.BLLOutCameraPictures_TKeys keys) { try { _dataObject.Delete(keys); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
public void SelectByPrimaryKey(HPS.BLL.OutCameraPicturesBLL.BLLOutCameraPictures_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_OutCameraPictures_T_SelectByPrimaryKey]"; this.Command.CommandType = CommandType.StoredProcedure; try { this.Command.Parameters.Clear(); SqlParameter OutCameraPicturesID_bint = new SqlParameter(); OutCameraPicturesID_bint.ParameterName = "@OutCameraPicturesID_bint"; OutCameraPicturesID_bint.SqlDbType = SqlDbType.BigInt; OutCameraPicturesID_bint.Direction = ParameterDirection.Input; OutCameraPicturesID_bint.IsNullable = false; OutCameraPicturesID_bint.Value = businessObjectKey.OutCameraPicturesID_bint; this.Command.Parameters.Add(OutCameraPicturesID_bint); if (ControlConnection) { this.BeginTransaction(); } sqlDataAdapter.Fill(dataTable); if (ControlConnection) { this.Commit(); } } catch (System.Exception ex) { if (ControlConnection) { this.RollBack(); } throw ex; } }
public HPS.BLL.OutCameraPicturesBLL.BLLOutCameraPictures_T SelectByPrimaryKey(HPS.BLL.OutCameraPicturesBLL.BLLOutCameraPictures_TKeys businessObjectKey) { bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open); this.Command.CommandText = "[sp_OutCameraPictures_T_SelectByPrimaryKey]"; this.Command.CommandType = CommandType.StoredProcedure; try { this.Command.Parameters.Clear(); SqlParameter OutCameraPicturesID_bint = new SqlParameter(); OutCameraPicturesID_bint.ParameterName = "@OutCameraPicturesID_bint"; OutCameraPicturesID_bint.SqlDbType = SqlDbType.BigInt; OutCameraPicturesID_bint.Direction = ParameterDirection.Input; OutCameraPicturesID_bint.IsNullable = false; OutCameraPicturesID_bint.Value = businessObjectKey.OutCameraPicturesID_bint; this.Command.Parameters.Add(OutCameraPicturesID_bint); if (ControlConnection) { this.BeginTransaction(); } IDataReader dataReader = this.Command.ExecuteReader(); HPS.BLL.OutCameraPicturesBLL.BLLOutCameraPictures_T businessObject = new HPS.BLL.OutCameraPicturesBLL.BLLOutCameraPictures_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; } }
public void Update(HPS.BLL.OutCameraPicturesBLL.BLLOutCameraPictures_T businessObject, HPS.BLL.OutCameraPicturesBLL.BLLOutCameraPictures_TKeys businessObjectKey) { bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open); this.Command.CommandText = "[sp_OutCameraPictures_T_Update]"; this.Command.CommandType = CommandType.StoredProcedure; try { this.Command.Parameters.Clear(); SqlParameter OutCameraPicturesID_bint = new SqlParameter(); OutCameraPicturesID_bint.ParameterName = "@OutCameraPicturesID_bint"; OutCameraPicturesID_bint.SqlDbType = SqlDbType.BigInt; OutCameraPicturesID_bint.Direction = ParameterDirection.Input; OutCameraPicturesID_bint.IsNullable = false; OutCameraPicturesID_bint.Value = businessObject.OutCameraPicturesID_bint; this.Command.Parameters.Add(OutCameraPicturesID_bint); 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 Picture_img = new SqlParameter(); Picture_img.ParameterName = "@Picture_img"; Picture_img.SqlDbType = SqlDbType.Image; Picture_img.Direction = ParameterDirection.Input; Picture_img.IsNullable = false; Picture_img.Value = businessObject.Picture_img; this.Command.Parameters.Add(Picture_img); 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 TrafficID_bint = new SqlParameter(); TrafficID_bint.ParameterName = "@TrafficID_bint"; TrafficID_bint.SqlDbType = SqlDbType.BigInt; TrafficID_bint.Direction = ParameterDirection.Input; TrafficID_bint.IsNullable = true; if (businessObject.TrafficID_bint.HasValue == false) { TrafficID_bint.Value = DBNull.Value; } else { TrafficID_bint.Value = businessObject.TrafficID_bint; } this.Command.Parameters.Add(TrafficID_bint); SqlParameter pk_OutCameraPicturesID_bint = new SqlParameter(); pk_OutCameraPicturesID_bint.ParameterName = "@pk_OutCameraPicturesID_bint"; pk_OutCameraPicturesID_bint.SqlDbType = SqlDbType.BigInt; pk_OutCameraPicturesID_bint.Direction = ParameterDirection.Input; pk_OutCameraPicturesID_bint.IsNullable = false; pk_OutCameraPicturesID_bint.Value = businessObjectKey.OutCameraPicturesID_bint; this.Command.Parameters.Add(pk_OutCameraPicturesID_bint); if (ControlConnection) { this.BeginTransaction(); } this.Command.ExecuteNonQuery(); if (ControlConnection) { this.Commit(); } } catch (System.Exception ex) { if (ControlConnection) { this.RollBack(); } throw ex; } }
public void Update(HPS.BLL.OutCameraPicturesBLL.BLLOutCameraPictures_T businessObject, HPS.BLL.OutCameraPicturesBLL.BLLOutCameraPictures_TKeys businessObjectKey) { try { List <string> ExceptList = new List <string>(); if (businessObject.OutCameraPicturesID_bint == businessObjectKey.OutCameraPicturesID_bint) { ExceptList.Add("UniqueOutCameraPicturesID_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); } }