public void Update(HPS.BLL.LaderTypeBLL.BLLLaderType_T businessObject, HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys businessObjectKey) { try { if (businessObject.LaderTypeID_int == businessObjectKey.LaderTypeID_int) { if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, "UniqueLaderTypeID_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.LaderTypeBLL.BLLLaderType_T SelectByPrimaryKey(HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys businessObjectKey) { bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open); this.Command.CommandText = "[sp_LaderType_T_SelectByPrimaryKey]"; this.Command.CommandType = CommandType.StoredProcedure; try { this.Command.Parameters.Clear(); SqlParameter LaderTypeID_int = new SqlParameter(); LaderTypeID_int.ParameterName = "@LaderTypeID_int"; LaderTypeID_int.SqlDbType = SqlDbType.Int; LaderTypeID_int.Direction = ParameterDirection.Input; LaderTypeID_int.IsNullable = false; LaderTypeID_int.Value = businessObjectKey.LaderTypeID_int; this.Command.Parameters.Add(LaderTypeID_int); if (ControlConnection) { this.BeginTransaction(); } IDataReader dataReader = this.Command.ExecuteReader(); HPS.BLL.LaderTypeBLL.BLLLaderType_T businessObject = new HPS.BLL.LaderTypeBLL.BLLLaderType_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; } }
private void LaderTypeID_intNewButton_Click(object sender, EventArgs e) { HPS.Present.SearchForm.LaderTypeSearch frm = new HPS.Present.SearchForm.LaderTypeSearch(); frm.ShowDialog(); if (frm != null) { LaderTypeEntity = frm.SelectedLaderTypeEntity; LaderTypeID_intComboBox.Text = LaderTypeEntity.LaderType_nvc; } }
public List <HPS.BLL.LaderTypeBLL.BLLLaderType_T> PopulateObjectsFromReader(IDataReader dataReader) { List <HPS.BLL.LaderTypeBLL.BLLLaderType_T> list = new List <HPS.BLL.LaderTypeBLL.BLLLaderType_T>(); while (dataReader.Read()) { HPS.BLL.LaderTypeBLL.BLLLaderType_T businessObject = new HPS.BLL.LaderTypeBLL.BLLLaderType_T(); PopulateBusinessObjectFromReader(businessObject, dataReader); list.Add(businessObject); } return(list); }
private void LaderTypeSearch_Load(object sender, EventArgs e) { try { this.LoadLaderType(); this.LaderTypeGridView.Focus(); this.LaderTypeEntity = null; } catch (Exception ex) { Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message); this.Close(); } }
private void SearchButton_Click(object sender, EventArgs e) { if (LaderTypeGridView.CurrentRow != null) { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys LaderTypeKey = new HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys(); LaderTypeKey.LaderTypeID_int = (Int32)LaderTypeGridView.CurrentRow.Cells[colLaderTypeID_int.Name].Value; LaderTypeEntity = LaderTypeFactory.GetBy(LaderTypeKey); if (string.IsNullOrEmpty(Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeGridView.CurrentRow.Cells[colLaderTypeID_int.Name].Value, TypeCode.String).ToString()) == false) { LaderTypeEntity.LaderType_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeGridView.CurrentRow.Cells[colLaderType_nvc.Name].Value, TypeCode.String).ToString(); } } this.Close(); }
public void Insert(HPS.BLL.LaderTypeBLL.BLLLaderType_T businessObject) { try { if (businessObject.IsValid(Hepsa.Core.Validation.ValidationExceptionType.Except, "LaderTypeID_int") == false) { throw new Hepsa.Core.Validation.InvalidBusinessObjectException(businessObject.BrokenRulesList().ToString()); } _dataObject.Insert(businessObject); } catch (System.Exception ex) { throw Hepsa.Core.Exception.HandleException.ChangeExceptionLanguage(ex, this); } }
protected override void ShowForm() { this.FillCombo(); HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); HPS.BLL.LaderTypeBLL.BLLLaderType_T LaderTypeEntity = LaderTypeFactory.GetBy((HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys)Key); if (LaderTypeEntity == null) { throw new HPS.Exceptions.LaderTypeNotFound(); } LaderTypeCode_nvcTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeEntity.LaderTypeCode_nvc, TypeCode.String).ToString(); LaderType_nvcTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeEntity.LaderType_nvc, TypeCode.String).ToString(); MinTruckWeight_decNumericTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeEntity.MinTruckWeight_dec, TypeCode.Decimal)); MaxTruckWeight_decNumericTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeEntity.MaxTruckWeight_dec, TypeCode.Decimal)); Active_bitCheckBox.Checked = (Boolean)Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeEntity.Active_bit, TypeCode.Boolean); Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref LaderPivotGroupID_intComboBox, LaderTypeEntity.LaderPivotGroupID_int, TypeCode.Int32); TurnCancelCheckBox.Checked = (Boolean)Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeEntity.TurnCancel_bit, TypeCode.Boolean); }
private void LaderTypeID_intComboBox_SelectionChangeCommitted(object sender, EventArgs e) { try { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys LaderTypeKey = new HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys(); LaderTypeKey.LaderTypeID_int = (Int32?)LaderTypeID_intComboBox.SelectedValue; HPS.BLL.LaderTypeBLL.BLLLaderType_T LaderTypeEntity = LaderTypeFactory.GetBy(LaderTypeKey); if (LaderTypeEntity.LaderTypeID_int != 0) { LaderTypeCode_nvcTextBox.Text = LaderTypeEntity.LaderTypeCode_nvc; } } catch (Exception ex) { Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message); } }
public void PopulateBusinessObjectFromReader(HPS.BLL.LaderTypeBLL.BLLLaderType_T businessObject, IDataReader dataReader) { businessObject.LaderTypeID_int = dataReader.GetInt32(dataReader.GetOrdinal(HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeID_int.ToString())); businessObject.LaderTypeCode_nvc = dataReader.GetString(dataReader.GetOrdinal(HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeCode_nvc.ToString())); businessObject.LaderType_nvc = dataReader.GetString(dataReader.GetOrdinal(HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderType_nvc.ToString())); if (dataReader.IsDBNull(dataReader.GetOrdinal(HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.MinTruckWeight_dec.ToString())) == false) { businessObject.MinTruckWeight_dec = dataReader.GetDecimal(dataReader.GetOrdinal(HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.MinTruckWeight_dec.ToString())); } else { businessObject.MinTruckWeight_dec = null; } if (dataReader.IsDBNull(dataReader.GetOrdinal(HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.MaxTruckWeight_dec.ToString())) == false) { businessObject.MaxTruckWeight_dec = dataReader.GetDecimal(dataReader.GetOrdinal(HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.MaxTruckWeight_dec.ToString())); } else { businessObject.MaxTruckWeight_dec = null; } businessObject.Active_bit = dataReader.GetBoolean(dataReader.GetOrdinal(HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.Active_bit.ToString())); if (dataReader.IsDBNull(dataReader.GetOrdinal(HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.SaloonID_int.ToString())) == false) { businessObject.SaloonID_int = dataReader.GetInt32(dataReader.GetOrdinal(HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.SaloonID_int.ToString())); } else { businessObject.SaloonID_int = null; } if (dataReader.IsDBNull(dataReader.GetOrdinal(HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderPivotGroupID_int.ToString())) == false) { businessObject.LaderPivotGroupID_int = dataReader.GetInt32(dataReader.GetOrdinal(HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderPivotGroupID_int.ToString())); } else { businessObject.LaderPivotGroupID_int = null; } businessObject.TurnCancel_bit = dataReader.GetBoolean(dataReader.GetOrdinal(HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.TurnCancel_bit.ToString())); }
protected override void ShowForm() { this.FillCombo(); HPS.BLL.CarBLL.BLLCar_TFactory CarFactory = new HPS.BLL.CarBLL.BLLCar_TFactory(); HPS.BLL.CarBLL.BLLCar_T CarEntity = CarFactory.GetBy((HPS.BLL.CarBLL.BLLCar_TKeys)Key); if (CarEntity == null) { throw new HPS.Exceptions.CarNotFound(); } CarCardDate_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.CarCardDate_nvc, TypeCode.String)); CarCardNumber_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.CarCardNumber_nvc, TypeCode.String)); PlateType_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.PlateType_nvc, TypeCode.String)); NumberPlate_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.NumberPlate_nvc, TypeCode.String)); SerialPlate_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.SerialPlate_nvc, TypeCode.String)); Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref PlateCityID_intComboBox, CarEntity.PlateCityID_int, TypeCode.Int32); Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref PlateColorID_intComboBox, CarEntity.PlateColorID_int, TypeCode.Int32); Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref CountryID_intComboBox, CarEntity.CountryID_int, TypeCode.Int32); CountryCode_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.CountryCode_nvc, TypeCode.String)); YearType_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.YearType_nvc, TypeCode.String)); ProductionYear_intNumericTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.ProductionYear_int, TypeCode.Int32).ToString(); Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref LaderTypeID_intComboBox, CarEntity.LaderTypeID_int, TypeCode.Int32); Active_bit.Checked = Convert.ToBoolean(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.Active_bit, TypeCode.Boolean)); if (LaderTypeID_intComboBox.SelectedValue != null) { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys LaderTypeKey = new HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys(); LaderTypeKey.LaderTypeID_int = (Int32?)LaderTypeID_intComboBox.SelectedValue; HPS.BLL.LaderTypeBLL.BLLLaderType_T LaderTypeEntity = LaderTypeFactory.GetBy(LaderTypeKey); if (LaderTypeEntity.LaderTypeID_int != 0) { LaderTypeCode_nvcTextBox.Text = LaderTypeEntity.LaderTypeCode_nvc; } } SystemCode_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.SystemCode_nvc, TypeCode.String)); System_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.System_nvc, TypeCode.String)); Capacity_fltNumericTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.Capacity_flt, TypeCode.Double).ToString(); Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref InfractionGroupID_intComboBox, CarEntity.InfractionGroupID_int, TypeCode.Int32); InsertDate_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.InsertDate_nvc, TypeCode.String)); UpdateDate_nvcTextBox.Text = Convert.ToString(Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.UpdateDate_nvc, TypeCode.String)); Active_bitCheckBox.Checked = (Boolean)Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.Active_bit, TypeCode.Boolean); Deleted_bitCheckBox.Checked = (Boolean)Hepsa.Core.Common.PersentationController.GetEntityValue(CarEntity.Deleted_bit, TypeCode.Boolean); }
protected override void Insert() { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); try { HPS.BLL.LaderTypeBLL.BLLLaderType_T LaderTypeEntity = new HPS.BLL.LaderTypeBLL.BLLLaderType_T(); LaderTypeEntity.LaderTypeCode_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeCode_nvcTextBox.Text, TypeCode.String).ToString(); LaderTypeEntity.LaderType_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderType_nvcTextBox.Text, TypeCode.String).ToString(); LaderTypeEntity.MinTruckWeight_dec = (Nullable <Decimal>)Hepsa.Core.Common.PersentationController.GetEntityValue(MinTruckWeight_decNumericTextBox.NumericText, TypeCode.Decimal); LaderTypeEntity.MaxTruckWeight_dec = (Nullable <Decimal>)Hepsa.Core.Common.PersentationController.GetEntityValue(MaxTruckWeight_decNumericTextBox.NumericText, TypeCode.Decimal); LaderTypeEntity.Active_bit = Active_bitCheckBox.Checked; LaderTypeEntity.LaderPivotGroupID_int = (Nullable <Int32>)Hepsa.Core.Common.PersentationController.GetEntityValue(LaderPivotGroupID_intComboBox.SelectedValue, TypeCode.Int32); LaderTypeEntity.TurnCancel_bit = TurnCancelCheckBox.Checked; LaderTypeFactory.BeginProc(); LaderTypeFactory.Insert(LaderTypeEntity); LaderTypeFactory.CommitProc(); if (DataTable != null) { DataRow dr = this.DataTable.NewRow(); dr[HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.LaderTypeID_int, TypeCode.Int32); dr[HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeCode_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.LaderTypeCode_nvc, TypeCode.String); dr[HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderType_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.LaderType_nvc, TypeCode.String); dr[HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.MinTruckWeight_dec.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.MinTruckWeight_dec, TypeCode.Decimal); dr[HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.MaxTruckWeight_dec.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.MaxTruckWeight_dec, TypeCode.Decimal); dr[HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.Active_bit.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.Active_bit, TypeCode.Boolean); dr[HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.SaloonID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.SaloonID_int, TypeCode.Int32); dr[HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderPivotGroupID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.LaderPivotGroupID_int, TypeCode.Int32); dr["LaderPivotGroupID_intLaderPivotGroup_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(LaderPivotGroupID_intComboBox); dr[HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.TurnCancel_bit.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.TurnCancel_bit, TypeCode.Boolean); DataTable.Rows.Add(dr); DataTable.AcceptChanges(); } this.ClearForm(this); } catch (Exception ex) { LaderTypeFactory.RollBackProc(); throw ex; } }
protected override void Edit() { HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory LaderTypeFactory = new HPS.BLL.LaderTypeBLL.BLLLaderType_TFactory(); try { HPS.BLL.LaderTypeBLL.BLLLaderType_T LaderTypeEntity = new HPS.BLL.LaderTypeBLL.BLLLaderType_T(); LaderTypeEntity.LaderTypeCode_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderTypeCode_nvcTextBox.Text, TypeCode.String).ToString(); LaderTypeEntity.LaderType_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(LaderType_nvcTextBox.Text, TypeCode.String).ToString(); LaderTypeEntity.MinTruckWeight_dec = (Nullable <Decimal>)Hepsa.Core.Common.PersentationController.GetEntityValue(MinTruckWeight_decNumericTextBox.NumericText, TypeCode.Decimal); LaderTypeEntity.MaxTruckWeight_dec = (Nullable <Decimal>)Hepsa.Core.Common.PersentationController.GetEntityValue(MaxTruckWeight_decNumericTextBox.NumericText, TypeCode.Decimal); LaderTypeEntity.Active_bit = Active_bitCheckBox.Checked; LaderTypeEntity.LaderPivotGroupID_int = (Nullable <Int32>)Hepsa.Core.Common.PersentationController.GetEntityValue(LaderPivotGroupID_intComboBox.SelectedValue, TypeCode.Int32); LaderTypeEntity.TurnCancel_bit = TurnCancelCheckBox.Checked; if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.EditMessage) == true) { LaderTypeFactory.BeginProc(); LaderTypeFactory.Update(LaderTypeEntity, (HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys)Key); LaderTypeFactory.CommitProc(); if (DataTable != null) { DataRow[] dr = DataTable.Select(HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeID_int.ToString() + "='" + ((HPS.BLL.LaderTypeBLL.BLLLaderType_TKeys)Key).LaderTypeID_int.ToString() + "'"); if (dr.Length > 0) { dr[0][HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderTypeCode_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.LaderTypeCode_nvc, TypeCode.String); dr[0][HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.LaderType_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.LaderType_nvc, TypeCode.String); dr[0][HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.MinTruckWeight_dec.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.MinTruckWeight_dec, TypeCode.Decimal); dr[0][HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.MaxTruckWeight_dec.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.MaxTruckWeight_dec, TypeCode.Decimal); dr[0][HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.Active_bit.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.Active_bit, TypeCode.Boolean); dr[0]["LaderPivotGroupID_intLaderPivotGroup_nvc"] = Hepsa.Core.Common.PersentationController.GetComboBoxDisplayMember(LaderPivotGroupID_intComboBox); dr[0][HPS.BLL.LaderTypeBLL.BLLLaderType_T.LaderType_TField.TurnCancel_bit.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(LaderTypeEntity.TurnCancel_bit, TypeCode.Boolean); } DataTable.AcceptChanges(); } } } catch (Exception ex) { LaderTypeFactory.RollBackProc(); throw ex; } }
private void SearchButton_Click(object sender, EventArgs e) { LaderTypeList.Clear(); //foreach (Janus.Windows.GridEX.GridEXRow item in LaderTypeGridView.GetCheckedRows()) //{ // HPS.BLL.LaderTypeBLL.BLLLaderType_T LadertypeEntity = new HPS.BLL.LaderTypeBLL.BLLLaderType_T(); // LadertypeEntity.LaderTypeID_int = Convert.ToInt32(item.Cells["LaderTypeID_int"].Value); // LadertypeEntity.LaderType_nvc = Convert.ToString(item.Cells["LaderType_nvc"].Value); // LadertypeEntity.LaderTypeCode_nvc = Convert.ToString(item.Cells["LaderTypeCode_nvc"].Value); // LaderTypeList.Add(LadertypeEntity); //} HPS.BLL.LaderTypeBLL.BLLLaderType_T LadertypeEntity = new HPS.BLL.LaderTypeBLL.BLLLaderType_T(); LadertypeEntity.LaderTypeID_int = Convert.ToInt32(LaderTypeGridView.CurrentRow.Cells["LaderTypeID_int"].Value); LadertypeEntity.LaderType_nvc = Convert.ToString(LaderTypeGridView.CurrentRow.Cells["LaderType_nvc"].Value); LadertypeEntity.LaderTypeCode_nvc = Convert.ToString(LaderTypeGridView.CurrentRow.Cells["LaderTypeCode_nvc"].Value); LaderTypeList.Add(LadertypeEntity); this.Close(); }
public void Insert(HPS.BLL.LaderTypeBLL.BLLLaderType_T businessObject) { bool ControlConnection = !(this.ConnectionState == System.Data.ConnectionState.Open); this.Command.CommandText = "[sp_LaderType_T_Add]"; this.Command.CommandType = CommandType.StoredProcedure; try { this.Command.Parameters.Clear(); SqlParameter LaderTypeID_int = new SqlParameter(); LaderTypeID_int.ParameterName = "@LaderTypeID_int"; LaderTypeID_int.SqlDbType = SqlDbType.Int; LaderTypeID_int.Direction = ParameterDirection.Output; LaderTypeID_int.IsNullable = true; LaderTypeID_int.Value = businessObject.LaderTypeID_int; this.Command.Parameters.Add(LaderTypeID_int); SqlParameter LaderTypeCode_nvc = new SqlParameter(); LaderTypeCode_nvc.ParameterName = "@LaderTypeCode_nvc"; LaderTypeCode_nvc.SqlDbType = SqlDbType.NVarChar; LaderTypeCode_nvc.Direction = ParameterDirection.Input; LaderTypeCode_nvc.IsNullable = true; LaderTypeCode_nvc.Value = businessObject.LaderTypeCode_nvc; this.Command.Parameters.Add(LaderTypeCode_nvc); SqlParameter LaderType_nvc = new SqlParameter(); LaderType_nvc.ParameterName = "@LaderType_nvc"; LaderType_nvc.SqlDbType = SqlDbType.NVarChar; LaderType_nvc.Direction = ParameterDirection.Input; LaderType_nvc.IsNullable = true; LaderType_nvc.Value = businessObject.LaderType_nvc; this.Command.Parameters.Add(LaderType_nvc); SqlParameter MinTruckWeight_dec = new SqlParameter(); MinTruckWeight_dec.ParameterName = "@MinTruckWeight_dec"; MinTruckWeight_dec.SqlDbType = SqlDbType.Decimal; MinTruckWeight_dec.Direction = ParameterDirection.Input; MinTruckWeight_dec.IsNullable = true; if (businessObject.MinTruckWeight_dec.HasValue == false) { MinTruckWeight_dec.Value = DBNull.Value; } else { MinTruckWeight_dec.Value = businessObject.MinTruckWeight_dec; } this.Command.Parameters.Add(MinTruckWeight_dec); SqlParameter MaxTruckWeight_dec = new SqlParameter(); MaxTruckWeight_dec.ParameterName = "@MaxTruckWeight_dec"; MaxTruckWeight_dec.SqlDbType = SqlDbType.Decimal; MaxTruckWeight_dec.Direction = ParameterDirection.Input; MaxTruckWeight_dec.IsNullable = true; if (businessObject.MaxTruckWeight_dec.HasValue == false) { MaxTruckWeight_dec.Value = DBNull.Value; } else { MaxTruckWeight_dec.Value = businessObject.MaxTruckWeight_dec; } this.Command.Parameters.Add(MaxTruckWeight_dec); SqlParameter Active_bit = new SqlParameter(); Active_bit.ParameterName = "@Active_bit"; Active_bit.SqlDbType = SqlDbType.Bit; Active_bit.Direction = ParameterDirection.Input; Active_bit.IsNullable = false; Active_bit.Value = businessObject.Active_bit; this.Command.Parameters.Add(Active_bit); SqlParameter SaloonID_int = new SqlParameter(); SaloonID_int.ParameterName = "@SaloonID_int"; SaloonID_int.SqlDbType = SqlDbType.Int; SaloonID_int.Direction = ParameterDirection.Input; SaloonID_int.IsNullable = true; if (businessObject.SaloonID_int.HasValue == false) { SaloonID_int.Value = DBNull.Value; } else { SaloonID_int.Value = businessObject.SaloonID_int; } this.Command.Parameters.Add(SaloonID_int); SqlParameter LaderPivotGroupID_int = new SqlParameter(); LaderPivotGroupID_int.ParameterName = "@LaderPivotGroupID_int"; LaderPivotGroupID_int.SqlDbType = SqlDbType.Int; LaderPivotGroupID_int.Direction = ParameterDirection.Input; LaderPivotGroupID_int.IsNullable = true; if (businessObject.LaderPivotGroupID_int.HasValue == false) { LaderPivotGroupID_int.Value = DBNull.Value; } else { LaderPivotGroupID_int.Value = businessObject.LaderPivotGroupID_int; } this.Command.Parameters.Add(LaderPivotGroupID_int); SqlParameter TurnCancel_bit = new SqlParameter(); TurnCancel_bit.ParameterName = "@TurnCancel_bit"; TurnCancel_bit.SqlDbType = SqlDbType.Bit; TurnCancel_bit.Direction = ParameterDirection.Input; TurnCancel_bit.IsNullable = false; TurnCancel_bit.Value = businessObject.TurnCancel_bit; this.Command.Parameters.Add(TurnCancel_bit); if (ControlConnection) { this.BeginTransaction(); } this.Command.ExecuteNonQuery(); businessObject.LaderTypeID_int = (Int32)(this.Command.Parameters["@LaderTypeID_int"].Value); if (ControlConnection) { this.Commit(); } } catch (System.Exception ex) { if (ControlConnection) { this.RollBack(); } throw ex; } }