Esempio n. 1
0
        /// <summary>
        /// 添加权限
        /// </summary>
        private void m_mthAddPurview()
        {
            ArrayList PurviewArr = new ArrayList();

            if (this.lvTop.SelectedItems.Count == 0)
            {
                return;
            }
            else
            {
                for (int i = 0; i < this.lvTop.SelectedItems.Count; i++)
                {
                    string       text = this.lvTop.SelectedItems[i].Text.ToString();
                    ListViewItem item = this.lvBottom.FindItemWithText(text);
                    if (item == null)
                    {
                        PurviewArr.Add(this.lvTop.SelectedItems[i].Tag.ToString());
                    }
                }
            }

            if (PurviewArr.Count == 0)
            {
                return;
            }

            ArrayList objArr = new ArrayList();

            for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
            {
                if (this.dataGridView1.Rows[i].Cells[0].Value.ToString().ToUpper() == "T")
                {
                    DataRow dr = this.dataGridView1.Rows[i].Tag as DataRow;

                    com.digitalwave.iCare.ValueObject.clsOutRecipePurview_VO RecipePurview_VO = new com.digitalwave.iCare.ValueObject.clsOutRecipePurview_VO();
                    RecipePurview_VO.EmpID      = dr["empid_chr"].ToString();
                    RecipePurview_VO.PurviewArr = PurviewArr;

                    objArr.Add(RecipePurview_VO);
                }
            }

            if (objArr.Count == 0)
            {
                return;
            }

            long l = this.objDoct.m_lngSaveDoctorRecipePurview(objArr, 1);

            if (l > 0)
            {
                this.m_mthAddItem(PurviewArr);
                //MessageBox.Show("添加门诊医生处方权限成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                MessageBox.Show("添加门诊医生处方权限失败。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 删除权限
        /// </summary>
        private void m_mthDelPurview()
        {
            ArrayList PurviewArr = new ArrayList();

            if (this.lvBottom.SelectedItems.Count == 0)
            {
                return;
            }
            else
            {
                for (int i = 0; i < this.lvBottom.SelectedItems.Count; i++)
                {
                    PurviewArr.Add(this.lvBottom.SelectedItems[i].Tag.ToString());
                }
            }

            if (CurrentRow == -1)
            {
                return;
            }

            ArrayList objArr = new ArrayList();

            if (this.dataGridView1.Rows[CurrentRow].Cells[0].Value.ToString().ToUpper() == "T")
            {
                DataRow dr = this.dataGridView1.Rows[CurrentRow].Tag as DataRow;

                if (MessageBox.Show("确认删除【" + dr["lastname_vchr"].ToString() + "】医生的处方权限吗?", "系统提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
                {
                    return;
                }

                com.digitalwave.iCare.ValueObject.clsOutRecipePurview_VO RecipePurview_VO = new com.digitalwave.iCare.ValueObject.clsOutRecipePurview_VO();
                RecipePurview_VO.EmpID      = dr["empid_chr"].ToString();
                RecipePurview_VO.PurviewArr = PurviewArr;

                objArr.Add(RecipePurview_VO);
            }
            else
            {
                return;
            }

            long l = this.objDoct.m_lngSaveDoctorRecipePurview(objArr, 2);

            if (l > 0)
            {
                this.m_mthDelItem(PurviewArr);
                //MessageBox.Show("删除门诊医生处方权限成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                MessageBox.Show("删除门诊医生处方权限失败。", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }