コード例 #1
0
        protected override void Delete()
        {
            HPS.BLL.UserGroupBLL.BLLUserGroup_TFactory UserGroupFactory = new HPS.BLL.UserGroupBLL.BLLUserGroup_TFactory();

            try
            {
                UserGroupFactory.BeginProc();
                UserGroupFactory.Delete((HPS.BLL.UserGroupBLL.BLLUserGroup_TKeys)Key);
                UserGroupFactory.CommitProc();
                if (DataTable != null)
                {
                    DataRow[] dr = DataTable.Select(HPS.BLL.UserGroupBLL.BLLUserGroup_T.UserGroup_TField.UserGroupID_int.ToString() + "='" + ((HPS.BLL.UserGroupBLL.BLLUserGroup_TKeys)Key).UserGroupID_int.ToString() + "'");
                    if (dr.Length > 0)
                    {
                        dr[0].Delete();
                    }
                    DataTable.AcceptChanges();
                }
                this.Close();
            }
            catch (Exception ex)
            {
                UserGroupFactory.RollBackProc();
                throw ex;
            }
        }
コード例 #2
0
        private void FillCombo()
        {
            try
            {
                HPS.BLL.MessageBLL.BLLMessage_TFactory MessageID_bintFactory = new HPS.BLL.MessageBLL.BLLMessage_TFactory();
                DataTable MessageID_bintDataTable = new DataTable();
                MessageID_bintFactory.GetAll(ref MessageID_bintDataTable);
                this.MessageID_bintComboBox.DisplayMember = HPS.BLL.MessageBLL.BLLMessage_T.Message_TField.MessageTitle_nvc.ToString();
                this.MessageID_bintComboBox.ValueMember   = HPS.BLL.MessageBLL.BLLMessage_T.Message_TField.MessageID_bint.ToString();
                this.MessageID_bintComboBox.DataSource    = MessageID_bintDataTable;
                this.MessageID_bintComboBox.SelectedIndex = -1;

                HPS.BLL.UserGroupBLL.BLLUserGroup_TFactory UserGroupID_intFactory = new HPS.BLL.UserGroupBLL.BLLUserGroup_TFactory();
                DataTable UserGroupID_intDataTable = new DataTable();
                UserGroupID_intFactory.GetAll(ref UserGroupID_intDataTable);
                this.UserGroupID_intComboBox.DisplayMember = HPS.BLL.UserGroupBLL.BLLUserGroup_T.UserGroup_TField.UserGroup_nvc.ToString();
                this.UserGroupID_intComboBox.ValueMember   = HPS.BLL.UserGroupBLL.BLLUserGroup_T.UserGroup_TField.UserGroupID_int.ToString();
                this.UserGroupID_intComboBox.DataSource    = UserGroupID_intDataTable;
                this.UserGroupID_intComboBox.SelectedIndex = -1;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #3
0
 protected override void Insert()
 {
     HPS.BLL.UserGroupBLL.BLLUserGroup_TFactory UserGroupFactory = new HPS.BLL.UserGroupBLL.BLLUserGroup_TFactory();
     HPS.BLL.UserGroupBLL.BLLUserGroup_T        UserGroupEntity  = new HPS.BLL.UserGroupBLL.BLLUserGroup_T();
     HPS.BLL.UserGroupBLL.BLLUserGroup_TKeys    UserGroupKey     = new HPS.BLL.UserGroupBLL.BLLUserGroup_TKeys();
     try
     {
         UserGroupEntity.Active_bit = this.Active_bitCheckBox.Checked;
         string refer = null;
         this.GetPermission(ref refer, this.PermisionTabControl);
         UserGroupEntity.Permission_nvc = refer;
         UserGroupEntity.UserGroup_nvc  = this.UserGroup_nvcTextBox.Text;
         UserGroupFactory.BeginProc();
         UserGroupFactory.Insert(UserGroupEntity);
         UserGroupFactory.CommitProc();
         if (DataTable != null)
         {
             DataRow dr = this.DataTable.NewRow();
             dr[HPS.BLL.UserGroupBLL.BLLUserGroup_T.UserGroup_TField.UserGroupID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(UserGroupEntity.UserGroupID_int, TypeCode.Int32);
             dr[HPS.BLL.UserGroupBLL.BLLUserGroup_T.UserGroup_TField.UserGroup_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(UserGroupEntity.UserGroup_nvc, TypeCode.String);
             dr[HPS.BLL.UserGroupBLL.BLLUserGroup_T.UserGroup_TField.Permission_nvc.ToString()]  = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(UserGroupEntity.Permission_nvc, TypeCode.String);
             dr[HPS.BLL.UserGroupBLL.BLLUserGroup_T.UserGroup_TField.Active_bit.ToString()]      = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(UserGroupEntity.Active_bit, TypeCode.Boolean);
             DataTable.Rows.Add(dr);
             DataTable.AcceptChanges();
         }
         this.ClearForm(this);
     }
     catch (Exception ex)
     {
         UserGroupFactory.RollBackProc();
         throw ex;
     }
 }
コード例 #4
0
        private void FillCombo()
        {
            try
            {
                HPS.BLL.UserGroupBLL.BLLUserGroup_TFactory UserGroupID_intFactory = new HPS.BLL.UserGroupBLL.BLLUserGroup_TFactory();
                DataTable UserGroupID_intDataTable = new DataTable();
                UserGroupID_intFactory.GetAll(ref UserGroupID_intDataTable);
                this.UserGroupID_intComboBox.DisplayMember = HPS.BLL.UserGroupBLL.BLLUserGroup_T.UserGroup_TField.UserGroup_nvc.ToString();
                this.UserGroupID_intComboBox.ValueMember   = HPS.BLL.UserGroupBLL.BLLUserGroup_T.UserGroup_TField.UserGroupID_int.ToString();
                this.UserGroupID_intComboBox.DataSource    = UserGroupID_intDataTable;
                this.UserGroupID_intComboBox.SelectedIndex = -1;

                HPS.BLL.UserBLL.BLLUser_TFactory UserFactory = new HPS.BLL.UserBLL.BLLUser_TFactory();
                DataTable UserDataTable = new DataTable();
                UserFactory.GetAll(ref UserDataTable);
                //UserDataTable.Columns.Add("select_bit").DefaultValue=false;

                UserNameGridView.DataSource = UserDataTable;
                //this.Computer_nvcComboBox.DisplayMember = HPS.BLL.UserBLL.BLLUser_T.User_TField.UserName_nvc.ToString();
                //this.Computer_nvcComboBox.ValueMember = HPS.BLL.UserBLL.BLLUser_T.User_TField.UserName_nvc.ToString();
                //this.Computer_nvcComboBox.DataSource = UserDataTable;
                //this.Computer_nvcComboBox.SelectedIndex = -1;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #5
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            HPS.BLL.UserGroupBLL.BLLUserGroup_TFactory UserGroupFactory = new HPS.BLL.UserGroupBLL.BLLUserGroup_TFactory();

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


                HPS.BLL.UserGroupBLL.BLLUserGroup_TFactory UserGroup_TFactory = new HPS.BLL.UserGroupBLL.BLLUserGroup_TFactory();
                HPS.BLL.UserGroupBLL.BLLUserGroup_TKeys    UserGroupKey       = new HPS.BLL.UserGroupBLL.BLLUserGroup_TKeys();

                UserGroupKey.UserGroupID_int = (Int32?)UserGroupGridView.CurrentRow.Cells["colUserGroupID_int"].Value;
                UserGroupFactory.Delete(UserGroupKey);

                DataRow[] dr = ((DataTable)this.UserGroupGridView.DataSource).Select(HPS.BLL.UserGroupBLL.BLLUserGroup_T.UserGroup_TField.UserGroupID_int.ToString() + "='" + UserGroupKey.UserGroupID_int.ToString() + "'");
                if (dr.Length > 0)
                {
                    dr[0].Delete();
                }
                ((DataTable)this.UserGroupGridView.DataSource).AcceptChanges();
            }

            catch (Exception ex)
            {
                Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
            }
        }
コード例 #6
0
        private void FillCombo()
        {
            try
            {
                HPS.BLL.UserGroupBLL.BLLUserGroup_TFactory UserGroupID_intFactory = new HPS.BLL.UserGroupBLL.BLLUserGroup_TFactory();
                string    Condition = "[UserGroup_T].[Active_bit]='true'";
                DataTable UserGroupID_intDataTable = new DataTable();
                UserGroupID_intFactory.GetAllByCondition(Condition, ref UserGroupID_intDataTable);
                this.UserGroupID_intComboBox.DisplayMember = HPS.BLL.UserGroupBLL.BLLUserGroup_T.UserGroup_TField.UserGroup_nvc.ToString();
                this.UserGroupID_intComboBox.ValueMember   = HPS.BLL.UserGroupBLL.BLLUserGroup_T.UserGroup_TField.UserGroupID_int.ToString();
                this.UserGroupID_intComboBox.DataSource    = UserGroupID_intDataTable;
                this.UserGroupID_intComboBox.SelectedIndex = -1;

                HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory InfractionGroupID_intFactory = new HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_TFactory();
                string    InfractionGroupCondition       = "[InfractionGroup_T].[Active_bit]='true'";
                DataTable InfractionGroupID_intDataTable = new DataTable();
                InfractionGroupID_intFactory.GetAllByCondition(InfractionGroupCondition, ref InfractionGroupID_intDataTable);
                this.InfractionGroupID_intComboBox.DisplayMember = HPS.BLL.InfractionGroupBLL.BLLInfractionGroup_T.InfractionGroup_TField.InfractionGroupID_int.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;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #7
0
 private void LoadUserGroup()
 {
     try
     {
         HPS.BLL.UserGroupBLL.BLLUserGroup_TFactory UserGroupFactory = new HPS.BLL.UserGroupBLL.BLLUserGroup_TFactory();
         DataTable UserGroupDataTable = new DataTable();
         UserGroupFactory.GetAll(ref UserGroupDataTable);
         this.UserGroupGridView.DataSource = UserGroupDataTable;
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }
コード例 #8
0
 protected override void ShowForm()
 {
     HPS.BLL.UserGroupBLL.BLLUserGroup_TFactory UserGroupFactory = new HPS.BLL.UserGroupBLL.BLLUserGroup_TFactory();
     HPS.BLL.UserGroupBLL.BLLUserGroup_T        UserGroupEntity  = UserGroupFactory.GetBy((HPS.BLL.UserGroupBLL.BLLUserGroup_TKeys)Key);
     if (UserGroupEntity == null)
     {
         throw new HPS.Exceptions.UserGroupNotFound();
     }
     else
     {
         this.MakePermission();
         if (UserGroupEntity.Permission_nvc != null)
         {
             this.ShowPermision(UserGroupEntity.Permission_nvc, this.PermisionTabControl);
         }
         this.UserGroup_nvcTextBox.Text = UserGroupEntity.UserGroup_nvc;
         Active_bitCheckBox.Checked     = (bool)Hepsa.Core.Common.PersentationController.GetEntityValue(UserGroupEntity.Active_bit, TypeCode.Boolean);
     }
 }
コード例 #9
0
 protected override void Edit()
 {
     HPS.BLL.UserGroupBLL.BLLUserGroup_TFactory UserGroupFactory = new HPS.BLL.UserGroupBLL.BLLUserGroup_TFactory();
     try
     {
         HPS.BLL.UserGroupBLL.BLLUserGroup_T UserGroupEntity = new HPS.BLL.UserGroupBLL.BLLUserGroup_T();
         UserGroupEntity.UserGroupID_int = ((HPS.BLL.UserGroupBLL.BLLUserGroup_TKeys)Key).UserGroupID_int;
         UserGroupEntity.Active_bit      = Active_bitCheckBox.Checked;
         UserGroupEntity.UserGroup_nvc   = UserGroup_nvcTextBox.Text;
         string refer = null;
         this.GetPermission(ref refer, this.PermisionTabControl);
         UserGroupEntity.Permission_nvc = refer;
         if (Hepsa.Core.Common.MessageBox.ConfirmMessage(HPS.Exceptions.ExceptionCs.EditMessage) == true)
         {
             UserGroupFactory.BeginProc();
             UserGroupFactory.Update(UserGroupEntity, (HPS.BLL.UserGroupBLL.BLLUserGroup_TKeys)Key);
             UserGroupFactory.CommitProc();
             if (DataTable != null)
             {
                 DataRow[] dr = DataTable.Select(HPS.BLL.UserGroupBLL.BLLUserGroup_T.UserGroup_TField.UserGroupID_int.ToString() + "='" + ((HPS.BLL.UserGroupBLL.BLLUserGroup_TKeys)Key).UserGroupID_int.ToString() + "'");
                 if (dr.Length > 0)
                 {
                     dr[0][HPS.BLL.UserGroupBLL.BLLUserGroup_T.UserGroup_TField.UserGroupID_int.ToString()] = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(UserGroupEntity.UserGroupID_int, TypeCode.Int32);
                     dr[0][HPS.BLL.UserGroupBLL.BLLUserGroup_T.UserGroup_TField.UserGroup_nvc.ToString()]   = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(UserGroupEntity.UserGroup_nvc, TypeCode.String);
                     dr[0][HPS.BLL.UserGroupBLL.BLLUserGroup_T.UserGroup_TField.Permission_nvc.ToString()]  = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(UserGroupEntity.Permission_nvc, TypeCode.String);
                     dr[0][HPS.BLL.UserGroupBLL.BLLUserGroup_T.UserGroup_TField.Active_bit.ToString()]      = Hepsa.Core.Common.PersentationController.GetEntityValueInDatabaseFormat(UserGroupEntity.Active_bit, TypeCode.Boolean);
                 }
                 DataTable.AcceptChanges();
             }
         }
     }
     catch (Exception ex)
     {
         UserGroupFactory.RollBackProc();
         throw ex;
     }
 }