Example #1
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;
            }
        }
Example #2
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;
            }
        }
Example #3
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;
            }
        }
Example #4
0
        private void FillCombo()
        {
            try
            {
                HPS.BLL.UserBLL.BLLUser_TFactory UserName_nvcFactory = new HPS.BLL.UserBLL.BLLUser_TFactory();
                DataTable UserName_nvcDataTable = new DataTable();
                UserName_nvcFactory.GetAll(ref UserName_nvcDataTable);
                this.UserName_nvcComboBox.DisplayMember = HPS.BLL.UserBLL.BLLUser_T.User_TField.UserName_nvc.ToString();
                this.UserName_nvcComboBox.ValueMember   = HPS.BLL.UserBLL.BLLUser_T.User_TField.UserName_nvc.ToString();
                this.UserName_nvcComboBox.DataSource    = UserName_nvcDataTable;
                this.UserName_nvcComboBox.SelectedIndex = -1;

                HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TFactory InfractionSurveyGroupID_intFactory = new HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TFactory();
                DataTable InfractionSurveyGroupID_intDataTable = new DataTable();
                InfractionSurveyGroupID_intFactory.GetAll(ref InfractionSurveyGroupID_intDataTable);
                this.InfractionSurveyGroupID_intComboBox.DisplayMember = HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_T.InfractionSurveyGroup_TField.InfractionSurveyGroup_nvc.ToString();
                this.InfractionSurveyGroupID_intComboBox.ValueMember   = HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_T.InfractionSurveyGroup_TField.InfractionSurveyGroupID_int.ToString();
                this.InfractionSurveyGroupID_intComboBox.DataSource    = InfractionSurveyGroupID_intDataTable;
                this.InfractionSurveyGroupID_intComboBox.SelectedIndex = -1;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #5
0
        private void FillCombo()
        {
            try
            {
                HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory InfractionGroupID_intFactory = new HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory();
                string    condition = "[InfractionGroup_T].[Active_bit]='true'";
                DataTable InfractionGroupID_intDataTable = new DataTable();
                InfractionGroupID_intFactory.GetAllByCondition(condition, ref InfractionGroupID_intDataTable);
                this.InfractionGroupID_intComboBox.DisplayMember = HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T.InfractionGroup_TField.InfractionGroup_nvc.ToString();
                this.InfractionGroupID_intComboBox.ValueMember   = HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T.InfractionGroup_TField.InfractionGroupID_int.ToString();
                this.InfractionGroupID_intComboBox.DataSource    = InfractionGroupID_intDataTable;
                this.InfractionGroupID_intComboBox.SelectedIndex = -1;

                HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TFactory InfractionSurveyGroupID_intFactory = new HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TFactory();
                DataTable InfractionSurveyGroupID_intDataTable = new DataTable();
                InfractionSurveyGroupID_intFactory.GetAll(ref InfractionSurveyGroupID_intDataTable);
                this.InfractionSurveyGroupID_intComboBox.DisplayMember = HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_T.InfractionSurveyGroup_TField.InfractionSurveyGroup_nvc.ToString();
                this.InfractionSurveyGroupID_intComboBox.ValueMember   = HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_T.InfractionSurveyGroup_TField.InfractionSurveyGroupID_int.ToString();
                this.InfractionSurveyGroupID_intComboBox.DataSource    = InfractionSurveyGroupID_intDataTable;
                this.InfractionSurveyGroupID_intComboBox.SelectedIndex = -1;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #6
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TFactory InfractionSurveyGroupFactory = new HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TFactory();

            try
            {
                if (Hepsa.Core.Common.MessageBox.ConfirmDeleteMessage() == false)
                {
                    return;
                }


                HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TFactory InfractionSurveyGroup_TFactory = new HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TFactory();
                HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TKeys    InfractionSurveyGroupKey       = new HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TKeys();

                InfractionSurveyGroupKey.InfractionSurveyGroupID_int = (Int32?)InfractionSurveyGroupGridView.CurrentRow.Cells["colInfractionSurveyGroupID_int"].Value;
                InfractionSurveyGroupFactory.Delete(InfractionSurveyGroupKey);

                DataRow[] dr = ((DataTable)this.InfractionSurveyGroupGridView.DataSource).Select(HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_T.InfractionSurveyGroup_TField.InfractionSurveyGroupID_int.ToString() + "='" + InfractionSurveyGroupKey.InfractionSurveyGroupID_int.ToString() + "'");
                if (dr.Length > 0)
                {
                    dr[0].Delete();
                }
                ((DataTable)this.InfractionSurveyGroupGridView.DataSource).AcceptChanges();
            }

            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
Example #7
0
 protected override void ShowForm()
 {
     this.FillCombo();
     HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TFactory InfractionSurveyGroupFactory = new HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TFactory();
     HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_T        InfractionSurveyGroupEntity  = InfractionSurveyGroupFactory.GetBy((HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TKeys)Key);
     if (InfractionSurveyGroupEntity == null)
     {
         throw new HPS.Exceptions.InfractionSurveyGroupNotFound();
     }
     InfractionSurveyGroup_nvcTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(InfractionSurveyGroupEntity.InfractionSurveyGroup_nvc, TypeCode.String).ToString();
 }
Example #8
0
 private void LoadInfractionSurveyGroup()
 {
     try
     {
         HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TFactory InfractionSurveyGroupFactory = new HPS.BLL.InfractionSurveyGroupBLL.BLLInfractionSurveyGroup_TFactory();
         DataTable InfractionSurveyGroupDataTable = new DataTable();
         InfractionSurveyGroupFactory.GetAll(ref InfractionSurveyGroupDataTable);
         this.InfractionSurveyGroupGridView.DataSource = InfractionSurveyGroupDataTable;
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }