public HPS.BLL.LadBillCreditCancelBLL.BLLLadBillCreditCancel_T GetBy(HPS.BLL.LadBillCreditCancelBLL.BLLLadBillCreditCancel_TKeys keys) { try{ return(_dataObject.SelectByPrimaryKey(keys)); }catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
public void GetBy(HPS.BLL.LadBillCreditCancelBLL.BLLLadBillCreditCancel_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 void Delete(HPS.BLL.LadBillCreditCancelBLL.BLLLadBillCreditCancel_TKeys keys) { try{ _dataObject.Delete(keys); }catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
public void SelectByPrimaryKey(HPS.BLL.LadBillCreditCancelBLL.BLLLadBillCreditCancel_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_LadBillCreditCancel_T_SelectByPrimaryKey]"; this.Command.CommandType = CommandType.StoredProcedure; try { this.Command.Parameters.Clear(); SqlParameter LadBillCreditCancelID_int = new SqlParameter(); LadBillCreditCancelID_int.ParameterName = "@LadBillCreditCancelID_int"; LadBillCreditCancelID_int.SqlDbType = SqlDbType.Int; LadBillCreditCancelID_int.Direction = ParameterDirection.Input; LadBillCreditCancelID_int.IsNullable = false; LadBillCreditCancelID_int.Value = businessObjectKey.LadBillCreditCancelID_int; this.Command.Parameters.Add(LadBillCreditCancelID_int); 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.LadBillCreditCancelBLL.BLLLadBillCreditCancel_T businessObject, HPS.BLL.LadBillCreditCancelBLL.BLLLadBillCreditCancel_TKeys businessObjectKey) { try{ if (businessObject.LadBillCreditCancelID_int == businessObjectKey.LadBillCreditCancelID_int) { if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, "UniqueLadBillCreditCancelID_int") == false) { throw new Hepsa.Core.Validation.InvalidBusinessObjectException(businessObject.BrokenRulesList().ToString()); } } else { if (businessObject.IsValid() == 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 HPS.BLL.LadBillCreditCancelBLL.BLLLadBillCreditCancel_T SelectByPrimaryKey(HPS.BLL.LadBillCreditCancelBLL.BLLLadBillCreditCancel_TKeys businessObjectKey) { bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open); this.Command.CommandText = "[sp_LadBillCreditCancel_T_SelectByPrimaryKey]"; this.Command.CommandType = CommandType.StoredProcedure; try { this.Command.Parameters.Clear(); SqlParameter LadBillCreditCancelID_int = new SqlParameter(); LadBillCreditCancelID_int.ParameterName = "@LadBillCreditCancelID_int"; LadBillCreditCancelID_int.SqlDbType = SqlDbType.Int; LadBillCreditCancelID_int.Direction = ParameterDirection.Input; LadBillCreditCancelID_int.IsNullable = false; LadBillCreditCancelID_int.Value = businessObjectKey.LadBillCreditCancelID_int; this.Command.Parameters.Add(LadBillCreditCancelID_int); if (ControlConnection) { this.BeginTransaction(); } IDataReader dataReader = this.Command.ExecuteReader(); HPS.BLL.LadBillCreditCancelBLL.BLLLadBillCreditCancel_T businessObject = new HPS.BLL.LadBillCreditCancelBLL.BLLLadBillCreditCancel_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.LadBillCreditCancelBLL.BLLLadBillCreditCancel_T businessObject, HPS.BLL.LadBillCreditCancelBLL.BLLLadBillCreditCancel_TKeys businessObjectKey) { bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open); this.Command.CommandText = "[sp_LadBillCreditCancel_T_Update]"; this.Command.CommandType = CommandType.StoredProcedure; try { this.Command.Parameters.Clear(); SqlParameter Date_nvc = new SqlParameter(); Date_nvc.ParameterName = "@Date_nvc"; Date_nvc.SqlDbType = SqlDbType.NVarChar; Date_nvc.Direction = ParameterDirection.Input; Date_nvc.IsNullable = false; Date_nvc.Value = businessObject.Date_nvc; this.Command.Parameters.Add(Date_nvc); SqlParameter Time_nvc = new SqlParameter(); Time_nvc.ParameterName = "@Time_nvc"; Time_nvc.SqlDbType = SqlDbType.NVarChar; Time_nvc.Direction = ParameterDirection.Input; Time_nvc.IsNullable = false; Time_nvc.Value = businessObject.Time_nvc; this.Command.Parameters.Add(Time_nvc); SqlParameter UserName_nvc = new SqlParameter(); UserName_nvc.ParameterName = "@UserName_nvc"; UserName_nvc.SqlDbType = SqlDbType.NVarChar; UserName_nvc.Direction = ParameterDirection.Input; UserName_nvc.IsNullable = false; UserName_nvc.Value = businessObject.UserName_nvc; this.Command.Parameters.Add(UserName_nvc); SqlParameter LadBillCreditID_int = new SqlParameter(); LadBillCreditID_int.ParameterName = "@LadBillCreditID_int"; LadBillCreditID_int.SqlDbType = SqlDbType.Int; LadBillCreditID_int.Direction = ParameterDirection.Input; LadBillCreditID_int.IsNullable = false; LadBillCreditID_int.Value = businessObject.LadBillCreditID_int; this.Command.Parameters.Add(LadBillCreditID_int); SqlParameter Comment_nvc = new SqlParameter(); Comment_nvc.ParameterName = "@Comment_nvc"; Comment_nvc.SqlDbType = SqlDbType.NVarChar; Comment_nvc.Direction = ParameterDirection.Input; Comment_nvc.IsNullable = false; Comment_nvc.Value = businessObject.Comment_nvc; this.Command.Parameters.Add(Comment_nvc); SqlParameter pk_LadBillCreditCancelID_int = new SqlParameter(); pk_LadBillCreditCancelID_int.ParameterName = "@pk_LadBillCreditCancelID_int"; pk_LadBillCreditCancelID_int.SqlDbType = SqlDbType.Int; pk_LadBillCreditCancelID_int.Direction = ParameterDirection.Input; pk_LadBillCreditCancelID_int.IsNullable = false; pk_LadBillCreditCancelID_int.Value = businessObjectKey.LadBillCreditCancelID_int; this.Command.Parameters.Add(pk_LadBillCreditCancelID_int); if (ControlConnection) { this.BeginTransaction(); } this.Command.ExecuteNonQuery(); if (ControlConnection) { this.Commit(); } } catch (System.Exception ex) { if (ControlConnection) { this.RollBack(); } throw ex; } }