示例#1
0
        protected override void Insert()
        {
            HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory InfractionGroupFactory = new HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory();
            try
            {
                HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T InfractionGroupEntity = new HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T();
                InfractionGroupEntity.InfractionGroup_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(InfractionGroup_nvcTextBox.Text, TypeCode.String).ToString();
                InfractionGroupEntity.Active_bit          = Active_bitCheckBox.Checked;

                InfractionGroupFactory.BeginProc();
                InfractionGroupFactory.Insert(InfractionGroupEntity);
                InfractionGroupFactory.CommitProc();
                if (DataTable != null)
                {
                    DataRow dr = this.DataTable.NewRow();
                    dr[HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T.InfractionGroup_TField.InfractionGroupID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(InfractionGroupEntity.InfractionGroupID_int, TypeCode.Int32);
                    dr[HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T.InfractionGroup_TField.InfractionGroup_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(InfractionGroupEntity.InfractionGroup_nvc, TypeCode.String);
                    dr[HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T.InfractionGroup_TField.Active_bit.ToString()]            = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(InfractionGroupEntity.Active_bit, TypeCode.Boolean);

                    DataTable.Rows.Add(dr);
                    DataTable.AcceptChanges();
                }
                this.ClearForm(this);
            }
            catch (Exception ex)
            {
                InfractionGroupFactory.RollBackProc();
                throw ex;
            }
        }