Exemplo n.º 1
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            try
            {
                if (!clsUserRight.chkRight(sUserID, 5030))
                {
                    throw new Exception("没有权限");
                }

                string sCode = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gridColcCode).ToString().Trim();
                if (sCode == "")
                {
                    throw new Exception("请选择单据");
                }

                GiveBack_Edit frm = new GiveBack_Edit(Conn, sCode);
                frm.sUserName     = this.sUserName;
                frm.sUserID       = this.sUserID;
                frm.StartPosition = FormStartPosition.CenterParent;
                frm.ShowDialog();

                //if (frm.DialogResult == DialogResult.OK)
                //{
                GetGrid();
                //}
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
            }
        }
Exemplo n.º 2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                if (!clsUserRight.chkRight(sUserID, 5020))
                {
                    throw new Exception("没有权限");
                }

                GiveBack_Edit frm = new GiveBack_Edit(Conn, "");
                frm.StartPosition = FormStartPosition.CenterParent;
                frm.sUserName     = this.sUserName;
                frm.sUserID       = this.sUserID;
                frm.ShowDialog();

                if (frm.DialogResult == DialogResult.OK)
                {
                    GetGrid();
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
            }
        }