Example #1
0
        private void txtModuleName_ButtonCustomClick(object sender, EventArgs e)
        {
            frmSelectModule frmModule = new frmSelectModule(false);
            DialogResult    rst       = frmModule.ShowDialog();

            if (rst == DialogResult.OK)
            {
                List <Sys_ModuleResult> slcModule = frmModule.GetSelectList <Sys_ModuleResult>();
                this.txtModuleID.Text   = slcModule[0].ModuleID.ToStringHasNull();
                this.txtModuleName.Text = slcModule[0].ModuleName;
            }
        }
Example #2
0
        private void tlbAddModule_Click(object sender, EventArgs e)
        {
            List <int?> list = new List <int?> ();

            if (dgvModule.Rows.Count > 0)
            {
                foreach (DataGridViewRow row in dgvModule.Rows)
                {
                    list.Add(row.Cells["colModuleID"].Value.ToInt32());
                }
            }


            var frmModule = new frmSelectModule(true);

            frmModule.moduleID = list.ToArray();
            DialogResult rst = frmModule.ShowDialog();

            if (rst == DialogResult.OK)
            {
                List <Sys_ModuleResult>    moduleResultList    = frmModule.GetSelectList <Sys_ModuleResult>();
                List <Sys_RoleRightResult> roleRightResultList = new List <Sys_RoleRightResult>();
                foreach (Sys_ModuleResult moduleResult in moduleResultList)
                {
                    Sys_RoleRightResult result = new Sys_RoleRightResult
                    {
                        ModuleID   = moduleResult.ModuleID,
                        RoleID     = _roleID,
                        ActionCode = "Search",
                        IsDeleted  = false
                    };
                    roleRightResultList.Add(result);
                }

                WCFAddUpdateResult ret = this.AsyncExecute <WCFAddUpdateResult, List <Sys_RoleRightResult> >(roleRightResultList, roleRightLogic.UpdateOrInsertList, a => BindDataGridView(1));
            }
        }