public HPS.BLL.InOutPicturesBLL.BLLInOutPictures_T SelectByPrimaryKey(HPS.BLL.InOutPicturesBLL.BLLInOutPictures_TKeys businessObjectKey) { bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open); this.Command.CommandText = "[sp_InOutPictures_T_SelectByPrimaryKey]"; this.Command.CommandType = CommandType.StoredProcedure; try { this.Command.Parameters.Clear(); SqlParameter inOutPicturesID_bint = new SqlParameter(); inOutPicturesID_bint.ParameterName = "@inOutPicturesID_bint"; inOutPicturesID_bint.SqlDbType = SqlDbType.BigInt; inOutPicturesID_bint.Direction = ParameterDirection.Input; inOutPicturesID_bint.IsNullable = false; inOutPicturesID_bint.Value = businessObjectKey.inOutPicturesID_bint; this.Command.Parameters.Add(inOutPicturesID_bint); if (ControlConnection) { this.BeginTransaction(); } IDataReader dataReader = this.Command.ExecuteReader(); HPS.BLL.InOutPicturesBLL.BLLInOutPictures_T businessObject = new HPS.BLL.InOutPicturesBLL.BLLInOutPictures_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 GetBy(HPS.BLL.InOutPicturesBLL.BLLInOutPictures_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.InOutPicturesBLL.BLLInOutPictures_T GetBy(HPS.BLL.InOutPicturesBLL.BLLInOutPictures_TKeys keys) { try { return(_dataObject.SelectByPrimaryKey(keys)); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
public void Delete(HPS.BLL.InOutPicturesBLL.BLLInOutPictures_TKeys keys) { try { _dataObject.Delete(keys); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
public void SelectByPrimaryKey(HPS.BLL.InOutPicturesBLL.BLLInOutPictures_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_InOutPictures_T_SelectByPrimaryKey]"; this.Command.CommandType = CommandType.StoredProcedure; try { this.Command.Parameters.Clear(); SqlParameter inOutPicturesID_bint = new SqlParameter(); inOutPicturesID_bint.ParameterName = "@inOutPicturesID_bint"; inOutPicturesID_bint.SqlDbType = SqlDbType.BigInt; inOutPicturesID_bint.Direction = ParameterDirection.Input; inOutPicturesID_bint.IsNullable = false; inOutPicturesID_bint.Value = businessObjectKey.inOutPicturesID_bint; this.Command.Parameters.Add(inOutPicturesID_bint); if (ControlConnection) { this.BeginTransaction(); } sqlDataAdapter.Fill(dataTable); if (ControlConnection) { this.Commit(); } } catch (System.Exception ex) { if (ControlConnection) { this.RollBack(); } throw ex; } }
public void Update(HPS.BLL.InOutPicturesBLL.BLLInOutPictures_T businessObject, HPS.BLL.InOutPicturesBLL.BLLInOutPictures_TKeys businessObjectKey) { try { List <string> ExceptList = new List <string>(); if (businessObject.inOutPicturesID_bint == businessObjectKey.inOutPicturesID_bint) { ExceptList.Add("UniqueinOutPicturesID_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); } }
public void Update(HPS.BLL.InOutPicturesBLL.BLLInOutPictures_T businessObject, HPS.BLL.InOutPicturesBLL.BLLInOutPictures_TKeys businessObjectKey) { bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open); this.Command.CommandText = "[sp_InOutPictures_T_Update]"; this.Command.CommandType = CommandType.StoredProcedure; try { this.Command.Parameters.Clear(); SqlParameter inOutID_bint = new SqlParameter(); inOutID_bint.ParameterName = "@inOutID_bint"; inOutID_bint.SqlDbType = SqlDbType.BigInt; inOutID_bint.Direction = ParameterDirection.Input; inOutID_bint.IsNullable = false; inOutID_bint.Value = businessObject.inOutID_bint; this.Command.Parameters.Add(inOutID_bint); SqlParameter picture_vbnry = new SqlParameter(); picture_vbnry.ParameterName = "@picture_vbnry"; picture_vbnry.SqlDbType = SqlDbType.VarBinary; picture_vbnry.Direction = ParameterDirection.Input; picture_vbnry.IsNullable = false; picture_vbnry.Value = businessObject.picture_vbnry; this.Command.Parameters.Add(picture_vbnry); SqlParameter pk_inOutPicturesID_bint = new SqlParameter(); pk_inOutPicturesID_bint.ParameterName = "@pk_inOutPicturesID_bint"; pk_inOutPicturesID_bint.SqlDbType = SqlDbType.BigInt; pk_inOutPicturesID_bint.Direction = ParameterDirection.Input; pk_inOutPicturesID_bint.IsNullable = false; pk_inOutPicturesID_bint.Value = businessObjectKey.inOutPicturesID_bint; this.Command.Parameters.Add(pk_inOutPicturesID_bint); if (ControlConnection) { this.BeginTransaction(); } this.Command.ExecuteNonQuery(); if (ControlConnection) { this.Commit(); } } catch (System.Exception ex) { if (ControlConnection) { this.RollBack(); } throw ex; } }