Example #1
0
        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;
            }
        }