setcurrentinvnoform.cs

来自「.net 开发的基础框架」· CS 代码 · 共 74 行

CS
74
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using  SPRFrame;
using Sybase.DataWindow;

namespace HPIResource.ShouFei
{
    public partial class SetCurrentInvNoForm : Form
    {
        public CasherInvoice cInv = new CasherInvoice();
        public int casherID ;
        public string invType  = "M";

        public SetCurrentInvNoForm()
        {
            InitializeComponent();
        }

        private void RetrieveData()
        {
            cInv.SetDataByCurrent(casherID,invType);
            cInv.Retrieve();
            tb_CurrentNo.Text = cInv.CurrentN0.ToString();
        }

        private void btn_Cancel_Click(object sender, EventArgs e)
        {
            SPRF.PARM = "-1";
            this.Close();
        }

        private void SetCurrentInvNoForm_Load(object sender, EventArgs e)
        {
            this.RetrieveData();
        }

        private void btn_Setup_Click(object sender, EventArgs e)
        {
            if (cInv.RowCount == 0)
            {
                cInv.InsertRow(0);
                cInv.SetRow(1);

                cInv.CasherID = casherID;
                cInv.XH = 0;
                cInv.InvType = invType;
                cInv.CurrentN0 = Convert.ToInt32(tb_NewNo.Text);
            }
            else
            {
                cInv.SetRow(1);
                cInv.CurrentN0 = Convert.ToInt32(tb_NewNo.Text);
            }

            try
            {
                cInv.UpdateData();
                SPRF.SQLCA.Commit();
                this.Close();
            }
            catch (DbErrorException ex)
            {
                SPRF.ErrText = ex.SqlErrorText;
                SPRF.SQLCA.Rollback();
            }
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?