Esempio n. 1
0
 /// <summary>
 /// 增加组
 /// </summary>
 private void AddGroup()
 {
     using (FrmSmmgroupEdit dlg = new FrmSmmgroupEdit())
     {
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             GroupService.Create <Smmgroup>(dlg.DataObject);
             CreateView();
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 修改组
        /// </summary>
        private void EditGroup()
        {
            string currentuser = MIS.UserNumber;

            if (currentuser != "admin")
            {
                MessageBox.Show("您无权进行此操作!");
                return;
            }
            string   id   = treeView1.SelectedNode.Name;
            Smmgroup data = GroupService.GetOneByKey <Smmgroup>(id);

            using (FrmSmmgroupEdit dlg = new FrmSmmgroupEdit())
            {
                dlg.DataObject = data;
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    GroupService.Update <Smmgroup>(data);

                    CreateView();
                }
            }
        }
Esempio n. 3
0
        /// <summary>
        /// ������
        /// </summary>
        private void AddGroup()
        {
            using (FrmSmmgroupEdit dlg = new FrmSmmgroupEdit())
            {

                if (dlg.ShowDialog() == DialogResult.OK)
                {

                    GroupService.Create<Smmgroup>(dlg.DataObject);
                    CreateView();
                }
            }
        }
Esempio n. 4
0
        /// <summary>
        /// �޸���
        /// </summary>
        private void EditGroup()
        {
            string currentuser = MIS.UserNumber;
            if (currentuser != "admin")
            {
                MessageBox.Show("����Ȩ���д˲�����");
                return;
            }
                string id = treeView1.SelectedNode.Name;
                Smmgroup data = GroupService.GetOneByKey<Smmgroup>(id);
                using (FrmSmmgroupEdit dlg = new FrmSmmgroupEdit())
                {
                    dlg.DataObject = data;
                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        GroupService.Update<Smmgroup>(data);

                        CreateView();
                    }
                }
        }
Esempio n. 5
0
        private void EditGroup()
        {
            if (listView1.SelectedItems.Count > 0) {
                ListViewItem item = listView1.SelectedItems[0];
                string id = item.SubItems[0].Text;
                Smmgroup data = GroupService.GetOneByKey<Smmgroup>(id);
                using (FrmSmmgroupEdit dlg = new FrmSmmgroupEdit()) {
                    dlg.DataObject = data;
                    if (dlg.ShowDialog() == DialogResult.OK) {
                        GroupService.Update<Smmgroup>(data);

                        Retrieve();
                    }
                }
            }
        }