Example #1
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_add_Click(object sender, EventArgs e)
        {
            isAddOrEdit = false;
            frmMaterialManager frm    = new frmMaterialManager(isAddOrEdit);
            DialogResult       result = frm.ShowDialog();

            if (result == DialogResult.OK)
            {
                Query();
                new PubUtils().ShowNoteOKMsg("新增成功!");
            }
        }
Example #2
0
        /// <summary>
        /// 编辑
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_edit_Click(object sender, EventArgs e)
        {
            if (dgv_Material.CurrentRow == null || dgv_Material.CurrentRow.Index == -1)
            {
                new PubUtils().ShowNoteNGMsg("请选中行", 2, grade.OrdinaryError);
                return;
            }

            isAddOrEdit = true;
            frmMaterialManager frm = new frmMaterialManager(isAddOrEdit);

            frm.obj = Common.Helper.PublicSetModel <MdcdatMaterial> .GetTByDataGridViewRow(dgv_Material.CurrentRow);

            DialogResult result = frm.ShowDialog();

            if (result == DialogResult.OK)
            {
                Query();
                new PubUtils().ShowNoteOKMsg("修改成功!");
            }
        }