Exemple #1
0
        private void btnOk_Click_1(object sender, EventArgs e)
        {
            foreach (DictionaryEntry de in addgroupItems)
            {
                Smugroup data = new Smugroup();
                data.Groupno = ((Smmgroup)de.Value).Groupno;
                data.Userid = userNo;
                SmmprogService.Create<Smugroup>(data);
            }
            foreach (DictionaryEntry de in deletegroupItems)
            {
                SmmprogService.Delete<Smugroup>((Smugroup)de.Value);
            }

            this.DialogResult = DialogResult.OK;
        }
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            try
            {
                string strErr = "";
                if (!SmmuserRule.Check(DataObject, ref strErr, isNew))
                {
                    MsgBox.Show(strErr);
                    return;
                }

                if (tbDisableflg.Checked)
                    DataObject.Disableflg = "Y";
                else
                    DataObject.Disableflg = "N";
                DataObject.Lastlogon = imageComboBoxEdit1.SelectedIndex.ToString();
                foreach (DictionaryEntry de in addgroupItems)
                {
                    Smugroup data = new Smugroup();
                    data.Groupno = ((Smmgroup)de.Value).Groupno;
                    data.Userid = tbUserid.Text;
                    SmmprogService.Create<Smugroup>(data);
                }
                if (!isNew)
                {
                    foreach (DictionaryEntry de in deletegroupItems)
                    {
                        SmmprogService.Delete<Smugroup>((Smugroup)de.Value);
                    }
                }

                this.DialogResult = DialogResult.OK;

            }
            catch { MessageBox.Show("���ݸ�ʽ����"); return; }
            DialogResult = DialogResult.OK;
        }