/// <summary> /// 转到添加页 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void UCPersonnelManager_AddEvent(object sender, EventArgs e) { UCPersonnelAddOrEdit uc = new UCPersonnelAddOrEdit(null, this.Name); uc.RefreshDataStart -= new UCPersonnelAddOrEdit.RefreshData(this.BindPageData); uc.RefreshDataStart += new UCPersonnelAddOrEdit.RefreshData(this.BindPageData); if (tvCompany.SelectedNode != null) { DataRowView drv = tvCompany.SelectedNode.Tag as DataRowView; DataRow[] dr; if (tvCompany.SelectedNode != null && drv != null && drv["ftype"].ToString() != "0")//选中的是组织 { uc.org_id = drv["id"].ToString(); uc.org_name = drv["name"].ToString(); if (dscom != null && dscom.Tables[0] != null) { dr = dscom.Tables[0].Select("id='" + drv["parent_id"].ToString() + "'"); if (dr != null & dr.Length > 0) { uc.com_name = dr[0]["name"].ToString(); } } } } uc.windowStatus = WindowStatus.Add; base.addUserControl(uc, "人员管理-新增", "UCPersonnelAdd", this.Tag.ToString(), this.Name); //订阅新增窗口保存事件 uc.SaveEvent += new ClickHandler(uc_SaveEvent); }
/// <summary> /// 编辑 /// </summary> private void Edit() { UCPersonnelAddOrEdit editFrm = new UCPersonnelAddOrEdit(userinfo, uc.Name); deleteMenuByTag(this.Tag.ToString(), uc.Name); base.addUserControl(editFrm, "人员档案-编辑", "UCSupplierEdit" + userinfo["user_id"].ToString(), this.Tag.ToString(), this.Name); }
/// <summary> /// 转到添加页 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void UCPersonnelManager_AddEvent(object sender, EventArgs e) { UCPersonnelAddOrEdit uc = new UCPersonnelAddOrEdit(null, this.Name); uc.RefreshDataStart -= new UCPersonnelAddOrEdit.RefreshData(this.BindPageData); uc.RefreshDataStart += new UCPersonnelAddOrEdit.RefreshData(this.BindPageData); uc.wStatus = WindowStatus.Add; base.addUserControl(uc, "人员管理-新增", "UCPersonnelAdd", this.Tag.ToString(), this.Name); //订阅新增窗口保存事件 uc.SaveEvent += new ClickHandler(uc_SaveEvent); }
/// <summary> /// 编辑 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void UCPersonnelManager_EditEvent(object sender, EventArgs e) { if (dgvUser.CurrentRow == null) { MessageBoxEx.Show("请选择编辑记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } DataRow dr = (this.dgvUser.CurrentRow.DataBoundItem as DataRowView).Row; UCPersonnelAddOrEdit uc = new UCPersonnelAddOrEdit(dr, this.Name); uc.RefreshDataStart -= new UCPersonnelAddOrEdit.RefreshData(this.BindPageData); uc.RefreshDataStart += new UCPersonnelAddOrEdit.RefreshData(this.BindPageData); uc.wStatus = WindowStatus.Edit; uc.id = dr["user_id"].ToString(); base.addUserControl(uc, "人员管理-编辑", "RoleEdit" + uc.id, this.Tag.ToString(), this.Name); }
/// <summary> /// 编辑 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void UCPersonnelManager_EditEvent(object sender, EventArgs e) { if (dgvUser.CurrentRow == null) { MessageBoxEx.Show("请选择编辑记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } DataRow dr = (this.dgvUser.CurrentRow.DataBoundItem as DataRowView).Row; UCPersonnelAddOrEdit uc = new UCPersonnelAddOrEdit(dr, this.Name); uc.RefreshDataStart -= new UCPersonnelAddOrEdit.RefreshData(this.BindPageData); uc.RefreshDataStart += new UCPersonnelAddOrEdit.RefreshData(this.BindPageData); uc.windowStatus = WindowStatus.Edit; uc.id = dr["user_id"].ToString(); base.addUserControl(uc, "人员管理-编辑", "RoleEdit" + uc.id, this.Tag.ToString(), this.Name); }
/// <summary> /// 转到添加页 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void UCPersonnelManager_AddEvent(object sender, EventArgs e) { UCPersonnelAddOrEdit uc = new UCPersonnelAddOrEdit(null, this.Name); uc.RefreshDataStart -= new UCPersonnelAddOrEdit.RefreshData(this.BindPageData); uc.RefreshDataStart += new UCPersonnelAddOrEdit.RefreshData(this.BindPageData); DataRowView drv = tvCompany.SelectedNode.Tag as DataRowView; DataRow[] dr; if (tvCompany.SelectedNode != null && drv != null && drv["ftype"].ToString() != "0")//选中的是组织 { uc.org_id = drv["id"].ToString(); uc.org_name = drv["name"].ToString(); if (dscom != null && dscom.Tables[0] != null) { dr = dscom.Tables[0].Select("id='" + drv["parent_id"].ToString() + "'"); if (dr != null & dr.Length > 0) { uc.com_name = dr[0]["name"].ToString(); } } } uc.windowStatus = WindowStatus.Add; base.addUserControl(uc, "人员管理-新增", "UCPersonnelAdd", this.Tag.ToString(), this.Name); //订阅新增窗口保存事件 uc.SaveEvent += new ClickHandler(uc_SaveEvent); }
/// <summary> /// 编辑 /// </summary> private void Edit() { UCPersonnelAddOrEdit editFrm = new UCPersonnelAddOrEdit(userinfo, uc.Name); deleteMenuByTag(this.Tag.ToString(), uc.Name); editFrm.windowStatus = WindowStatus.Edit; base.addUserControl(editFrm, "人员档案-编辑", "UCSupplierEdit" + userinfo["user_id"].ToString(), this.Tag.ToString(), this.Name); }