Esempio n. 1
0
        protected override void Insert()
        {
            HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TFactory InfractionSurveyGroupFactory = new HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TFactory();
            try
            {
                HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_T InfractionSurveyGroupEntity = new HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_T();
                InfractionSurveyGroupEntity.InfractionSurveyGroup_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(InfractionSurveyGroup_nvcTextBox.Text, TypeCode.String).ToString();

                InfractionSurveyGroupFactory.BeginProc();
                InfractionSurveyGroupFactory.Insert(InfractionSurveyGroupEntity);
                InfractionSurveyGroupFactory.CommitProc();
                if (DataTable != null)
                {
                    DataRow dr = this.DataTable.NewRow();
                    dr[HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_T.InfractionSurveyGroup_TField.InfractionSurveyGroupID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(InfractionSurveyGroupEntity.InfractionSurveyGroupID_int, TypeCode.Int32);
                    dr[HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_T.InfractionSurveyGroup_TField.InfractionSurveyGroup_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(InfractionSurveyGroupEntity.InfractionSurveyGroup_nvc, TypeCode.String);

                    DataTable.Rows.Add(dr);
                    DataTable.AcceptChanges();
                }
                this.ClearForm(this);
            }
            catch (Exception ex)
            {
                InfractionSurveyGroupFactory.RollBackProc();
                throw ex;
            }
        }
Esempio n. 2
0
        protected override void Edit()
        {
            HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TFactory InfractionSurveyGroupFactory = new HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TFactory();
            try
            {
                HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_T InfractionSurveyGroupEntity = new HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_T();
                InfractionSurveyGroupEntity.InfractionSurveyGroup_nvc = Hepsa.Core.Common.PersentationController.GetEntityValue(InfractionSurveyGroup_nvcTextBox.Text, TypeCode.String).ToString();

                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.EditMessage) == true)
                {
                    InfractionSurveyGroupFactory.BeginProc();
                    InfractionSurveyGroupFactory.Update(InfractionSurveyGroupEntity, (HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TKeys)Key);
                    InfractionSurveyGroupFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_T.InfractionSurveyGroup_TField.InfractionSurveyGroupID_int.ToString() + "='" + ((HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TKeys)Key).InfractionSurveyGroupID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0][HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_T.InfractionSurveyGroup_TField.InfractionSurveyGroup_nvc.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(InfractionSurveyGroupEntity.InfractionSurveyGroup_nvc, TypeCode.String);
                        }
                        DataTable.AcceptChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                InfractionSurveyGroupFactory.RollBackProc();
                throw ex;
            }
        }
Esempio n. 3
0
        protected override void Delete()
        {
            HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TFactory InfractionSurveyGroupFactory = new HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.DeleteMessage) == true)
                {
                    InfractionSurveyGroupFactory.BeginProc();
                    InfractionSurveyGroupFactory.Delete((HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TKeys)Key);
                    InfractionSurveyGroupFactory.CommitProc();
                    if (DataTable != null)
                    {
                        DataRow[] dr = DataTable.Select(HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_T.InfractionSurveyGroup_TField.InfractionSurveyGroupID_int.ToString() + "='" + ((HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TKeys)Key).InfractionSurveyGroupID_int.ToString() + "'");
                        if (dr.Length > 0)
                        {
                            dr[0].Delete();
                        }
                        DataTable.AcceptChanges();
                    }
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                InfractionSurveyGroupFactory.RollBackProc();
                throw ex;
            }
        }