Exemplo n.º 1
0
        /// <summary>
        /// 转向添加
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void UC_AddEvent(object sender, EventArgs e)
        {
            UCRoleAddOrEdit uc = new UCRoleAddOrEdit(null, this.Name);

            uc.wStatus           = WindowStatus.Add;
            uc.RefreshDataStart -= new UCRoleAddOrEdit.RefreshData(this.BindPageData);
            uc.RefreshDataStart += new UCRoleAddOrEdit.RefreshData(this.BindPageData);
            base.addUserControl(uc, "角色管理-新增", "RoleAdd", this.Tag.ToString(), this.Name);
        }
Exemplo n.º 2
0
 void UCRoleView_EditEvent(object sender, EventArgs e)
 {
     DataTable dt = DBHelper.GetTable("查询角色", "v_role", "*", "role_id='" + id + "'", "", "");
     if (dt.Rows.Count <= 0)
     {
         MessageBoxEx.Show("查询角色失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         return;
     }
     UCRoleAddOrEdit editFrm = new UCRoleAddOrEdit(dt.Rows[0], uc.Name);
     editFrm.windowStatus = WindowStatus.Edit;
     deleteMenuByTag(this.Tag.ToString(), uc.Name);
     base.addUserControl(editFrm, "角色档案-编辑", "UCSupplierEdit" + id, this.Tag.ToString(), this.Name);
 }
Exemplo n.º 3
0
        void UCRoleView_EditEvent(object sender, EventArgs e)
        {
            DataTable dt = DBHelper.GetTable("查询角色", "v_role", "*", "role_id='" + id + "'", "", "");

            if (dt.Rows.Count <= 0)
            {
                MessageBoxEx.Show("查询角色失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            UCRoleAddOrEdit editFrm = new UCRoleAddOrEdit(dt.Rows[0], uc.Name);

            editFrm.windowStatus = WindowStatus.Edit;
            deleteMenuByTag(this.Tag.ToString(), uc.Name);
            base.addUserControl(editFrm, "角色档案-编辑", "UCSupplierEdit" + id, this.Tag.ToString(), this.Name);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 转向复制
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void UC_CopyEvent(object sender, EventArgs e)
        {
            if (dgvRole.CurrentRow == null)
            {
                MessageBoxEx.Show("请选择复制记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            DataRow         dr = (this.dgvRole.CurrentRow.DataBoundItem as DataRowView).Row;
            string          id = dr["role_id"].ToString();
            UCRoleAddOrEdit uc = new UCRoleAddOrEdit(dr, this.Name);

            uc.wStatus = WindowStatus.Copy;
            uc.id      = id;
            base.addUserControl(uc, "角色管理-复制", "RoleCopy" + id, this.Tag.ToString(), this.Name);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 去编辑
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void UC_EditEvent(object sender, EventArgs e)
        {
            if (dgvRole.CurrentRow == null)
            {
                MessageBoxEx.Show("请选择编辑记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            DataRow         dr = (this.dgvRole.CurrentRow.DataBoundItem as DataRowView).Row;
            string          id = dr["role_id"].ToString();
            UCRoleAddOrEdit uc = new UCRoleAddOrEdit(dr, this.Name);

            uc.wStatus           = WindowStatus.Edit;
            uc.id                = id;
            uc.RefreshDataStart -= new UCRoleAddOrEdit.RefreshData(this.BindPageData);
            uc.RefreshDataStart += new UCRoleAddOrEdit.RefreshData(this.BindPageData);
            base.addUserControl(uc, "角色管理-编辑", "RoleEdit" + id, this.Tag.ToString(), this.Name);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 转向复制
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void UC_CopyEvent(object sender, EventArgs e)
        {
            if (dgvRole.CurrentRow == null)
            {
                MessageBoxEx.Show("请选择复制记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            List <string> listId = new List <string>();

            foreach (DataGridViewRow sdr in this.dgvRole.Rows)
            {
                object obj = sdr.Cells[this.columnCheck.Name].EditedFormattedValue;
                if (obj != null && (bool)obj)
                {
                    if (sdr.Cells[this.role_code.Name].Value.ToString() == this._system)
                    {
                        continue;
                    }
                    listId.Add(sdr.Cells[this.columnId.Name].Value.ToString());
                }
            }
            if (listId.Count > 1)
            {
                MessageBoxEx.Show("请选中一条信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            else
            {
                DataRow         dr = (this.dgvRole.CurrentRow.DataBoundItem as DataRowView).Row;
                string          id = dr["role_id"].ToString();
                UCRoleAddOrEdit uc = new UCRoleAddOrEdit(dr, this.Name);
                uc.wStatus           = WindowStatus.Copy;
                uc.id                = id;
                uc.RefreshDataStart -= new UCRoleAddOrEdit.RefreshData(this.BindPageData);
                uc.RefreshDataStart += new UCRoleAddOrEdit.RefreshData(this.BindPageData);
                base.addUserControl(uc, "角色管理-复制", "RoleCopy" + id, this.Tag.ToString(), this.Name);
            }
        }
Exemplo n.º 7
0
 /// <summary>
 /// 转向添加
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void UC_AddEvent(object sender, EventArgs e)
 {
     UCRoleAddOrEdit uc = new UCRoleAddOrEdit(null, this.Name);
     uc.wStatus = WindowStatus.Add;
     uc.RefreshDataStart -= new UCRoleAddOrEdit.RefreshData(this.BindPageData);
     uc.RefreshDataStart += new UCRoleAddOrEdit.RefreshData(this.BindPageData);
     base.addUserControl(uc, "角色管理-新增", "RoleAdd", this.Tag.ToString(), this.Name);
 }
Exemplo n.º 8
0
 /// <summary>
 /// 去编辑
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void UC_EditEvent(object sender, EventArgs e)
 {
     if (dgvRole.CurrentRow == null)
     {
         MessageBoxEx.Show("请选择编辑记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     DataRow dr = (this.dgvRole.CurrentRow.DataBoundItem as DataRowView).Row;
     string id = dr["role_id"].ToString();
     UCRoleAddOrEdit uc = new UCRoleAddOrEdit(dr, this.Name);
     uc.wStatus = WindowStatus.Edit;
     uc.id = id;
     uc.RefreshDataStart -= new UCRoleAddOrEdit.RefreshData(this.BindPageData);
     uc.RefreshDataStart += new UCRoleAddOrEdit.RefreshData(this.BindPageData);
     base.addUserControl(uc, "角色管理-编辑", "RoleEdit" + id, this.Tag.ToString(), this.Name);
 }
Exemplo n.º 9
0
 /// <summary>
 /// 转向复制
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void UC_CopyEvent(object sender, EventArgs e)
 {
     if (dgvRole.CurrentRow == null)
     {
         MessageBoxEx.Show("请选择复制记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     DataRow dr = (this.dgvRole.CurrentRow.DataBoundItem as DataRowView).Row;
     string id = dr["role_id"].ToString();
     UCRoleAddOrEdit uc = new UCRoleAddOrEdit(dr, this.Name);
     uc.wStatus = WindowStatus.Copy;
     uc.id = id;
     base.addUserControl(uc, "角色管理-复制", "RoleCopy" + id, this.Tag.ToString(), this.Name);
 }
Exemplo n.º 10
0
 /// <summary>
 /// 转向复制
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void UC_CopyEvent(object sender, EventArgs e)
 {
     if (dgvRole.CurrentRow == null)
     {
         MessageBoxEx.Show("请选择复制记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     List<string> listId = new List<string>();
     foreach (DataGridViewRow sdr in this.dgvRole.Rows)
     {
         object obj = sdr.Cells[this.columnCheck.Name].EditedFormattedValue;
         if (obj != null && (bool)obj)
         {
             if (sdr.Cells[this.role_code.Name].Value.ToString() == this._system)
             {
                 continue;
             }
             listId.Add(sdr.Cells[this.columnId.Name].Value.ToString());
         }
     }
     if (listId.Count > 1)
     {
         MessageBoxEx.Show("请选中一条信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     else
     {
         DataRow dr = (this.dgvRole.CurrentRow.DataBoundItem as DataRowView).Row;
         string id = dr["role_id"].ToString();
         UCRoleAddOrEdit uc = new UCRoleAddOrEdit(dr, this.Name);
         uc.wStatus = WindowStatus.Copy;
         uc.id = id;
         base.addUserControl(uc, "角色管理-复制", "RoleCopy" + id, this.Tag.ToString(), this.Name);
     }
 }