public void Update(HPS.BLL.PermissionBLL.BLLPermission_T businessObject, HPS.BLL.PermissionBLL.BLLPermission_TKeys businessObjectKey) { try { if (businessObject.PermissionID_bint == businessObjectKey.PermissionID_bint) { if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, "UniquePermissionID_bint") == 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.PermissionBLL.BLLPermission_T SelectByPrimaryKey(HPS.BLL.PermissionBLL.BLLPermission_TKeys businessObjectKey) { bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open); this.Command.CommandText = "[sp_Permission_T_SelectByPrimaryKey]"; this.Command.CommandType = CommandType.StoredProcedure; try { this.Command.Parameters.Clear(); SqlParameter PermissionID_bint = new SqlParameter(); PermissionID_bint.ParameterName = "@PermissionID_bint"; PermissionID_bint.SqlDbType = SqlDbType.BigInt; PermissionID_bint.Direction = ParameterDirection.Input; PermissionID_bint.IsNullable = false; PermissionID_bint.Value = businessObjectKey.PermissionID_bint; this.Command.Parameters.Add(PermissionID_bint); if (ControlConnection) { this.BeginTransaction(); } IDataReader dataReader = this.Command.ExecuteReader(); HPS.BLL.PermissionBLL.BLLPermission_T businessObject = new HPS.BLL.PermissionBLL.BLLPermission_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.PermissionBLL.BLLPermission_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.PermissionBLL.BLLPermission_T GetBy(HPS.BLL.PermissionBLL.BLLPermission_TKeys keys) { try { return(_dataObject.SelectByPrimaryKey(keys)); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
public void Delete(HPS.BLL.PermissionBLL.BLLPermission_TKeys keys) { try { _dataObject.Delete(keys); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
public void SelectByPrimaryKey(HPS.BLL.PermissionBLL.BLLPermission_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_Permission_T_SelectByPrimaryKey]"; this.Command.CommandType = CommandType.StoredProcedure; try { this.Command.Parameters.Clear(); SqlParameter PermissionID_bint = new SqlParameter(); PermissionID_bint.ParameterName = "@PermissionID_bint"; PermissionID_bint.SqlDbType = SqlDbType.BigInt; PermissionID_bint.Direction = ParameterDirection.Input; PermissionID_bint.IsNullable = false; PermissionID_bint.Value = businessObjectKey.PermissionID_bint; this.Command.Parameters.Add(PermissionID_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.PermissionBLL.BLLPermission_T businessObject, HPS.BLL.PermissionBLL.BLLPermission_TKeys businessObjectKey) { bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open); this.Command.CommandText = "[sp_Permission_T_Update]"; this.Command.CommandType = CommandType.StoredProcedure; try { this.Command.Parameters.Clear(); SqlParameter PermissionID_bint = new SqlParameter(); PermissionID_bint.ParameterName = "@PermissionID_bint"; PermissionID_bint.SqlDbType = SqlDbType.BigInt; PermissionID_bint.Direction = ParameterDirection.Input; PermissionID_bint.IsNullable = false; PermissionID_bint.Value = businessObject.PermissionID_bint; this.Command.Parameters.Add(PermissionID_bint); SqlParameter Permission_nvc = new SqlParameter(); Permission_nvc.ParameterName = "@Permission_nvc"; Permission_nvc.SqlDbType = SqlDbType.NVarChar; Permission_nvc.Direction = ParameterDirection.Input; Permission_nvc.IsNullable = false; Permission_nvc.Value = businessObject.Permission_nvc; this.Command.Parameters.Add(Permission_nvc); SqlParameter PermissionGroupID_int = new SqlParameter(); PermissionGroupID_int.ParameterName = "@PermissionGroupID_int"; PermissionGroupID_int.SqlDbType = SqlDbType.Int; PermissionGroupID_int.Direction = ParameterDirection.Input; PermissionGroupID_int.IsNullable = false; PermissionGroupID_int.Value = businessObject.PermissionGroupID_int; this.Command.Parameters.Add(PermissionGroupID_int); SqlParameter FormName_nvc = new SqlParameter(); FormName_nvc.ParameterName = "@FormName_nvc"; FormName_nvc.SqlDbType = SqlDbType.NVarChar; FormName_nvc.Direction = ParameterDirection.Input; FormName_nvc.IsNullable = true; if (String.IsNullOrEmpty(businessObject.FormName_nvc)) { FormName_nvc.Value = DBNull.Value; } else { FormName_nvc.Value = businessObject.FormName_nvc; } this.Command.Parameters.Add(FormName_nvc); SqlParameter ControlName_nvc = new SqlParameter(); ControlName_nvc.ParameterName = "@ControlName_nvc"; ControlName_nvc.SqlDbType = SqlDbType.NVarChar; ControlName_nvc.Direction = ParameterDirection.Input; ControlName_nvc.IsNullable = true; if (String.IsNullOrEmpty(businessObject.ControlName_nvc)) { ControlName_nvc.Value = DBNull.Value; } else { ControlName_nvc.Value = businessObject.ControlName_nvc; } this.Command.Parameters.Add(ControlName_nvc); SqlParameter PropertyName_nvc = new SqlParameter(); PropertyName_nvc.ParameterName = "@PropertyName_nvc"; PropertyName_nvc.SqlDbType = SqlDbType.NVarChar; PropertyName_nvc.Direction = ParameterDirection.Input; PropertyName_nvc.IsNullable = true; if (String.IsNullOrEmpty(businessObject.PropertyName_nvc)) { PropertyName_nvc.Value = DBNull.Value; } else { PropertyName_nvc.Value = businessObject.PropertyName_nvc; } this.Command.Parameters.Add(PropertyName_nvc); SqlParameter Value_nvc = new SqlParameter(); Value_nvc.ParameterName = "@Value_nvc"; Value_nvc.SqlDbType = SqlDbType.NVarChar; Value_nvc.Direction = ParameterDirection.Input; Value_nvc.IsNullable = true; if (String.IsNullOrEmpty(businessObject.Value_nvc)) { Value_nvc.Value = DBNull.Value; } else { Value_nvc.Value = businessObject.Value_nvc; } this.Command.Parameters.Add(Value_nvc); SqlParameter ColumnName_nvc = new SqlParameter(); ColumnName_nvc.ParameterName = "@ColumnName_nvc"; ColumnName_nvc.SqlDbType = SqlDbType.NVarChar; ColumnName_nvc.Direction = ParameterDirection.Input; ColumnName_nvc.IsNullable = true; if (String.IsNullOrEmpty(businessObject.ColumnName_nvc)) { ColumnName_nvc.Value = DBNull.Value; } else { ColumnName_nvc.Value = businessObject.ColumnName_nvc; } this.Command.Parameters.Add(ColumnName_nvc); SqlParameter pk_PermissionID_bint = new SqlParameter(); pk_PermissionID_bint.ParameterName = "@pk_PermissionID_bint"; pk_PermissionID_bint.SqlDbType = SqlDbType.BigInt; pk_PermissionID_bint.Direction = ParameterDirection.Input; pk_PermissionID_bint.IsNullable = false; pk_PermissionID_bint.Value = businessObjectKey.PermissionID_bint; this.Command.Parameters.Add(pk_PermissionID_bint); if (ControlConnection) { this.BeginTransaction(); } this.Command.ExecuteNonQuery(); if (ControlConnection) { this.Commit(); } } catch (System.Exception ex) { if (ControlConnection) { this.RollBack(); } throw ex; } }