示例#1
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            SysUserMasterSearch win = new SysUserMasterSearch();
            win.ShowDialog();

            List<Sys_UserMaster_usm_Info> items = win._RtvInfo;
            if (items != null)
            {
                try
                {

                    List<Sys_UserMaster_usm_Info> cumList = new List<Sys_UserMaster_usm_Info>();

                    foreach (Sys_UserMaster_usm_Info usm in items)
                    {
                        ListViewItem list = new ListViewItem();
                        list.Text = usm.usm_cUserLoginID.ToString();
                        if (!IsExistsItem(list.Text))
                        {
                            //cumList.Add(cum);

                            ListViewItem it = new ListViewItem(usm.usm_cUserLoginID.ToString());
                            it.SubItems.Add(usm.usm_cChaName.ToString());
                            lvwMaster.Items.Add(it);
                        }
                    }

                    //lvwMaster.SetDataSource<CourseMaster_cum_Info>(cumList,false);

                }
                catch (Exception Ex)
                { ShowErrorMessage(Ex); }
            }

            win.Dispose();
            win = null;
        }
示例#2
0
        private void ToolBar_BtnSearchClick(object sender, EventArgs e)
        {
            SysUserMasterSearch win = new SysUserMasterSearch();
            win.ShowDialog();

            if (win.DialogResult == DialogResult.OK)
            {
                //iRecordID = win.displayRecordID;
                iRecordID = win._RtvInfo[0].usm_iRecordID.ToString();
                Sys_UserMaster_usm_Info info = new Sys_UserMaster_usm_Info();
                try
                {
                    info.usm_iRecordID = Convert.ToInt32(iRecordID);
                    Model.IModel.IModelObject result = _sysUserMasterBL.DisplayRecord(info);
                    info = result as Sys_UserMaster_usm_Info;
                }
                catch (Exception Ex)
                {
                    ShowErrorMessage(Ex);
                }
                this.EditState = DefineConstantValue.EditStateEnum.OE_ReaOnly;
                SetTxtBox(DefineConstantValue.EditStateEnum.OE_ReaOnly);
                SetOpenToolBar();
                ShowInfo(info);
            }
            win.Dispose();//釋放窗口
            win = null;
        }
示例#3
0
        private void btnNUser_Click(object sender, EventArgs e)
        {
            SysUserMasterSearch win = new SysUserMasterSearch();
            win.ShowDialog();

            List<Sys_UserMaster_usm_Info> items = win._RtvInfo;
            if (items != null)
            {
                try
                {

                    List<Sys_UserMaster_usm_Info> cumList = new List<Sys_UserMaster_usm_Info>();

                    foreach (Sys_UserMaster_usm_Info user in items)
                    {
                        ListViewItem list = new ListViewItem();
                        list.Text = user.usm_cUserLoginID.ToString();
                        if (!IsExistsItem(list.Text))
                        {
                            ListViewItem it = new ListViewItem(user.usm_cUserLoginID.ToString());
                            it.SubItems.Add(user.usm_cChaName.ToString());
                            it.SubItems.Add(UserType.User.ToString());
                            lvwUser.Items.Add(it);
                            uspInfoTemp.userMasterList.Add(user);
                        }
                    }

                }
                catch (Exception Ex)
                { ShowErrorMessage(Ex); }
            }

            win.Dispose();
            win = null;
        }
示例#4
0
 private void btnAddRoleUser_Click(object sender, EventArgs e)
 {
     SysUserMasterSearch dlgUserSearch = new SysUserMasterSearch();
     dlgUserSearch.ShowDialog();
     List<Sys_UserMaster_usm_Info> listUserAdd = dlgUserSearch._RtvInfo;
     foreach (ListViewItem item in lvRoleUserList.Items)
     {
         int iRecord = Convert.ToInt32(item.SubItems[0].Text);
         Sys_UserMaster_usm_Info user = listUserAdd.Find(x => x.usm_iRecordID == iRecord);
         if (user != null)
         {
             listUserAdd.Remove(user);
         }
     }
     lvRoleUserList.SetDataSource<Sys_UserMaster_usm_Info>(listUserAdd, false);
 }