/// <summary>
        /// 删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menuItem2_Click(object sender, System.EventArgs e)
        {
            Neusoft.HISFC.Models.Base.UserText obj = this.GetSelectedObject(this.treeView1.SelectedNode);
            if (obj == null)
            {
                return;
            }
            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            Neusoft.HISFC.BizLogic.Manager.UserText m = new Neusoft.HISFC.BizLogic.Manager.UserText();
            //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(m.Connection);
            //t.BeginTransaction();
            //m.SetTrans(t.Trans);
            int i = 0;

            i = m.Delete(obj.ID);
            if (i == -1)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show(m.Err);
            }
            else
            {
                Neusoft.FrameWork.Management.PublicTrans.Commit();
                MessageBox.Show("删除成功!");
                this.RefreshList();
            }
        }
Exemple #2
0
        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            string code = string.Empty;
            string type = string.Empty;

            curUser = Neusoft.FrameWork.Management.Connection.Operator as Neusoft.HISFC.Models.Base.Employee;
            Neusoft.HISFC.BizLogic.Manager.UserText m = new Neusoft.HISFC.BizLogic.Manager.UserText();
            if (this.radioButton1.Checked)
            {
                type = "1";
                code = curUser.Dept.ID;
            }
            else
            {
                type = "0";
                code = curUser.ID;
            }
            ArrayList al = m.GetGroupList(code, type);

            if (txtMemo.Items.Count > 0)
            {
                this.txtMemo.Items.Clear();
                txtMemo.Text = "";
            }
            this.txtMemo.AddItems(al);
        }
Exemple #3
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <returns></returns>
        public int Save()
        {
            if (this.SetValue() == -1)
            {
                return(-1);
            }
            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();
            Neusoft.HISFC.BizLogic.Manager.UserText m = new Neusoft.HISFC.BizLogic.Manager.UserText();
            //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(m.Connection);
            //t.BeginTransaction();
            //m.SetTrans(t.Trans);
            int i = 0;

            this.myUserText.Memo = this.txtMemo.Text.Trim();
            if (this.myUserText.ID == "")
            {
                i = m.Insert(this.myUserText);
            }
            else
            {
                i = m.Update(this.myUserText);
            }
            if (i == -1)
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show(m.Err);
            }
            else
            {
                Neusoft.FrameWork.Management.PublicTrans.Commit();
                MessageBox.Show("保存成功!");
                this.FindForm().Close();
            }
            return(i);
        }
Exemple #4
0
        protected int GetValue()
        {
            if (myUserText == null)
            {
                return(-1);
            }
            if (myUserText.Name == "")
            {
                if (myUserText.Text.Trim().Length > 5)
                {
                    myUserText.Name = myUserText.Text.Trim().Substring(0, 5);
                }
                else
                {
                    myUserText.Name = myUserText.Text;
                }
            }
            this.txtMemo.Text  = myUserText.Memo;
            this.textBox1.Text = myUserText.Name;

            if (this.richTextBox1.Text == "")
            {
                this.richTextBox1.Text = myUserText.Text;
            }

            if (myUserText.Type == "1")
            {
                this.radioButton1.Checked = true;
            }
            else
            {
                this.radioButton2.Checked = true;
            }
            try
            {
                string code = string.Empty;
                string type = string.Empty;
                curUser = Neusoft.FrameWork.Management.Connection.Operator as Neusoft.HISFC.Models.Base.Employee;
                Neusoft.HISFC.BizLogic.Manager.UserText m = new Neusoft.HISFC.BizLogic.Manager.UserText();
                if (this.radioButton1.Checked)
                {
                    type = "1";
                    code = curUser.Dept.ID;
                }
                else
                {
                    type = "0";
                    code = curUser.ID;
                }
                ArrayList al = m.GetGroupList(code, type);
                if (txtMemo.Items.Count > 0)
                {
                    txtMemo.Items.Clear();
                    txtMemo.Text = "";
                }
                this.txtMemo.AddItems(al);
            }
            catch
            {
                return(-1);
            }
            return(0);
        }
Exemple #5
0
 public System.Collections.ArrayList UserTextGetList(string type, int usertype)
 {
     Neusoft.HISFC.BizLogic.Manager.UserText manager = new Neusoft.HISFC.BizLogic.Manager.UserText();
     this.SetDB(manager);
     return(manager.GetList(type, usertype));
 }