Ejemplo n.º 1
0
        private void sbAdd_Click(object sender, EventArgs e)
        {
            DataLib.sysClass myClass = new DataLib.sysClass();
            if (myClass.TestRight("frmEditUser") == false)
            {
                return;
            }
            frmEditUser myEditUser = new frmEditUser();

            myEditUser.DataBind("");
            if (myEditUser.ShowDialog() == DialogResult.OK)
            {
                DataBind();
            }
            myEditUser.Dispose();
        }
Ejemplo n.º 2
0
 private void sbDel_Click(object sender, EventArgs e)
 {
     DataLib.sysClass myClass = new DataLib.sysClass();
     if (myClass.TestRight("frmEditUser") == false)
     {
         return;
     }
     if (gvMain.FocusedRowHandle < 0)
     {
         return;
     }
     if (MessageBox.Show(this, "真的要删除选定用户吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
     {
         return;
     }
     DataLib.DataHelper myHelper = new DataLib.DataHelper();
     if (myHelper.ExecuteSQL("delete from t_User where F_ID = '" + gvMain.GetRowCellValue(gvMain.FocusedRowHandle, "F_ID").ToString() + "'") == 0)
     {
         gvMain.DeleteRow(gvMain.FocusedRowHandle);
     }
 }
Ejemplo n.º 3
0
        private void sbEdit_Click(object sender, EventArgs e)
        {
            DataLib.sysClass myClass = new DataLib.sysClass();
            if (myClass.TestRight("frmEditUser") == false)
            {
                return;
            }
            if (gvMain.FocusedRowHandle < 0)
            {
                return;
            }
            DataRow     dr         = gvMain.GetDataRow(gvMain.FocusedRowHandle);
            frmEditUser myEditUser = new frmEditUser();

            myEditUser.DataBind(dr["F_ID"].ToString());
            if (myEditUser.ShowDialog() == DialogResult.OK)
            {
                DataBind();
            }
            myEditUser.Dispose();
        }