public void GetBy(HPS.BLL.LadeCancelAssignmentBLL.BLLLadeCancelAssignment_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.LadeCancelAssignmentBLL.BLLLadeCancelAssignment_T GetBy(HPS.BLL.LadeCancelAssignmentBLL.BLLLadeCancelAssignment_TKeys keys) { try { return(_dataObject.SelectByPrimaryKey(keys)); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
public void Delete(HPS.BLL.LadeCancelAssignmentBLL.BLLLadeCancelAssignment_TKeys keys) { try { _dataObject.Delete(keys); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
public void SelectByPrimaryKey(HPS.BLL.LadeCancelAssignmentBLL.BLLLadeCancelAssignment_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_LadeCancelAssignment_T_SelectByPrimaryKey]"; this.Command.CommandType = CommandType.StoredProcedure; try { this.Command.Parameters.Clear(); SqlParameter LadeCancelAssignmentID_int = new SqlParameter(); LadeCancelAssignmentID_int.ParameterName = "@LadeCancelAssignmentID_int"; LadeCancelAssignmentID_int.SqlDbType = SqlDbType.Int; LadeCancelAssignmentID_int.Direction = ParameterDirection.Input; LadeCancelAssignmentID_int.IsNullable = false; LadeCancelAssignmentID_int.Value = businessObjectKey.LadeCancelAssignmentID_int; this.Command.Parameters.Add(LadeCancelAssignmentID_int); if (ControlConnection) { this.BeginTransaction(); } sqlDataAdapter.Fill(dataTable); if (ControlConnection) { this.Commit(); } } catch (System.Exception ex) { if (ControlConnection) { this.RollBack(); } throw ex; } }
public HPS.BLL.LadeCancelAssignmentBLL.BLLLadeCancelAssignment_T SelectByPrimaryKey(HPS.BLL.LadeCancelAssignmentBLL.BLLLadeCancelAssignment_TKeys businessObjectKey) { bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open); this.Command.CommandText = "[sp_LadeCancelAssignment_T_SelectByPrimaryKey]"; this.Command.CommandType = CommandType.StoredProcedure; try { this.Command.Parameters.Clear(); SqlParameter LadeCancelAssignmentID_int = new SqlParameter(); LadeCancelAssignmentID_int.ParameterName = "@LadeCancelAssignmentID_int"; LadeCancelAssignmentID_int.SqlDbType = SqlDbType.Int; LadeCancelAssignmentID_int.Direction = ParameterDirection.Input; LadeCancelAssignmentID_int.IsNullable = false; LadeCancelAssignmentID_int.Value = businessObjectKey.LadeCancelAssignmentID_int; this.Command.Parameters.Add(LadeCancelAssignmentID_int); if (ControlConnection) { this.BeginTransaction(); } IDataReader dataReader = this.Command.ExecuteReader(); HPS.BLL.LadeCancelAssignmentBLL.BLLLadeCancelAssignment_T businessObject = new HPS.BLL.LadeCancelAssignmentBLL.BLLLadeCancelAssignment_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.LadeCancelAssignmentBLL.BLLLadeCancelAssignment_T businessObject, HPS.BLL.LadeCancelAssignmentBLL.BLLLadeCancelAssignment_TKeys businessObjectKey) { bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open); this.Command.CommandText = "[sp_LadeCancelAssignment_T_Update]"; this.Command.CommandType = CommandType.StoredProcedure; try { this.Command.Parameters.Clear(); SqlParameter LadeCancelCommentID_int = new SqlParameter(); LadeCancelCommentID_int.ParameterName = "@LadeCancelCommentID_int"; LadeCancelCommentID_int.SqlDbType = SqlDbType.Int; LadeCancelCommentID_int.Direction = ParameterDirection.Input; LadeCancelCommentID_int.IsNullable = false; LadeCancelCommentID_int.Value = businessObject.LadeCancelCommentID_int; this.Command.Parameters.Add(LadeCancelCommentID_int); SqlParameter LadeCancelComment_nvc = new SqlParameter(); LadeCancelComment_nvc.ParameterName = "@LadeCancelComment_nvc"; LadeCancelComment_nvc.SqlDbType = SqlDbType.NVarChar; LadeCancelComment_nvc.Direction = ParameterDirection.Input; LadeCancelComment_nvc.IsNullable = false; LadeCancelComment_nvc.Value = businessObject.LadeCancelComment_nvc; this.Command.Parameters.Add(LadeCancelComment_nvc); SqlParameter LadeAssignmentID_bint = new SqlParameter(); LadeAssignmentID_bint.ParameterName = "@LadeAssignmentID_bint"; LadeAssignmentID_bint.SqlDbType = SqlDbType.BigInt; LadeAssignmentID_bint.Direction = ParameterDirection.Input; LadeAssignmentID_bint.IsNullable = false; LadeAssignmentID_bint.Value = businessObject.LadeAssignmentID_bint; this.Command.Parameters.Add(LadeAssignmentID_bint); SqlParameter Count_int = new SqlParameter(); Count_int.ParameterName = "@Count_int"; Count_int.SqlDbType = SqlDbType.Int; Count_int.Direction = ParameterDirection.Input; Count_int.IsNullable = false; if (businessObject.Count_int.HasValue == false) { Count_int.Value = DBNull.Value; } else { Count_int.Value = businessObject.Count_int; } this.Command.Parameters.Add(Count_int); SqlParameter Date_nvc = new SqlParameter(); Date_nvc.ParameterName = "@Date_nvc"; Date_nvc.SqlDbType = SqlDbType.NVarChar; Date_nvc.Direction = ParameterDirection.Input; Date_nvc.IsNullable = true; 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 pk_LadeCancelAssignmentID_int = new SqlParameter(); pk_LadeCancelAssignmentID_int.ParameterName = "@pk_LadeCancelAssignmentID_int"; pk_LadeCancelAssignmentID_int.SqlDbType = SqlDbType.Int; pk_LadeCancelAssignmentID_int.Direction = ParameterDirection.Input; pk_LadeCancelAssignmentID_int.IsNullable = false; pk_LadeCancelAssignmentID_int.Value = businessObjectKey.LadeCancelAssignmentID_int; this.Command.Parameters.Add(pk_LadeCancelAssignmentID_int); 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.LadeCancelAssignmentBLL.BLLLadeCancelAssignment_T businessObject, HPS.BLL.LadeCancelAssignmentBLL.BLLLadeCancelAssignment_TKeys businessObjectKey) { try { if (businessObject.LadeCancelAssignmentID_int == businessObjectKey.LadeCancelAssignmentID_int) { if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, "UniqueLadeCancelAssignmentID_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); } }