public HPS.BLL.BLLSmsInfo_T SelectByPrimaryKey(HPS.BLL.BLLSmsInfo_TKeys businessObjectKey) { bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open); this.Command.CommandText = "[sp_SmsInfo_T_SelectByPrimaryKey]"; this.Command.CommandType = CommandType.StoredProcedure; try { this.Command.Parameters.Clear(); SqlParameter SmsInfoID_bint = new SqlParameter(); SmsInfoID_bint.ParameterName = "@SmsInfoID_bint"; SmsInfoID_bint.SqlDbType = SqlDbType.BigInt; SmsInfoID_bint.Direction = ParameterDirection.Input; SmsInfoID_bint.IsNullable = false; SmsInfoID_bint.Value = businessObjectKey.SmsInfoID_bint; this.Command.Parameters.Add(SmsInfoID_bint); if (ControlConnection) { this.BeginTransaction(); } IDataReader dataReader = this.Command.ExecuteReader(); HPS.BLL.BLLSmsInfo_T businessObject = new HPS.BLL.BLLSmsInfo_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.BLLSmsInfo_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.BLLSmsInfo_T GetBy(HPS.BLL.BLLSmsInfo_TKeys keys) { try { return(_dataObject.SelectByPrimaryKey(keys)); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
public void Delete(HPS.BLL.BLLSmsInfo_TKeys keys) { try { _dataObject.Delete(keys); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
public void Update(HPS.BLL.BLLSmsInfo_T businessObject, HPS.BLL.BLLSmsInfo_TKeys businessObjectKey) { bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open); this.Command.CommandText = "[sp_SmsInfo_T_Update]"; this.Command.CommandType = CommandType.StoredProcedure; try { this.Command.Parameters.Clear(); SqlParameter RecivedSmsID_bint = new SqlParameter(); RecivedSmsID_bint.ParameterName = "@RecivedSmsID_bint"; RecivedSmsID_bint.SqlDbType = SqlDbType.BigInt; RecivedSmsID_bint.Direction = ParameterDirection.Input; RecivedSmsID_bint.IsNullable = false; RecivedSmsID_bint.Value = businessObject.RecivedSmsID_bint; this.Command.Parameters.Add(RecivedSmsID_bint); SqlParameter pk_SmsInfoID_bint = new SqlParameter(); pk_SmsInfoID_bint.ParameterName = "@pk_SmsInfoID_bint"; pk_SmsInfoID_bint.SqlDbType = SqlDbType.BigInt; pk_SmsInfoID_bint.Direction = ParameterDirection.Input; pk_SmsInfoID_bint.IsNullable = false; pk_SmsInfoID_bint.Value = businessObjectKey.SmsInfoID_bint; this.Command.Parameters.Add(pk_SmsInfoID_bint); if (ControlConnection) { this.BeginTransaction(); } this.Command.ExecuteNonQuery(); if (ControlConnection) { this.Commit(); } } catch (System.Exception ex) { if (ControlConnection) { this.RollBack(); } throw ex; } }
public void SelectByPrimaryKey(HPS.BLL.BLLSmsInfo_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_SmsInfo_T_SelectByPrimaryKey]"; this.Command.CommandType = CommandType.StoredProcedure; try { this.Command.Parameters.Clear(); SqlParameter SmsInfoID_bint = new SqlParameter(); SmsInfoID_bint.ParameterName = "@SmsInfoID_bint"; SmsInfoID_bint.SqlDbType = SqlDbType.BigInt; SmsInfoID_bint.Direction = ParameterDirection.Input; SmsInfoID_bint.IsNullable = false; SmsInfoID_bint.Value = businessObjectKey.SmsInfoID_bint; this.Command.Parameters.Add(SmsInfoID_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.BLLSmsInfo_T businessObject, HPS.BLL.BLLSmsInfo_TKeys businessObjectKey) { try { List <string> ExceptList = new List <string>(); if (businessObject.SmsInfoID_bint == businessObjectKey.SmsInfoID_bint) { ExceptList.Add("UniqueSmsInfoID_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); } }