Esempio n. 1
0
        private void btnNext5_Click(object sender, EventArgs e)
        {
            if (txtUserPay.Text != "")
            {
                string lvChk = GsysSQL.fncFindEmpName(txtUserPay.Text);
                if (lvChk == "")
                {
                    MessageBox.Show("ไม่พบข้อมูลรหัสนี้  กรุณาตรวจสอบ", "แจ้งเตือน", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    txtUserPay.Text = "";
                    txtUserPay.Focus();
                    return;
                }

                if (txtID.Text == "00021" || txtID.Text == "00022" || txtID.Text == "00023")
                {
                    tabControl1.SelectedIndex = 7;
                }
                else
                {
                    tabControl1.SelectedIndex = 4;
                }

                //txtRemark.Text = "";
                txtRemark.Focus();
            }
            else
            {
                MessageBox.Show("กรุณาระบุผู้จ่าย", "แจ้งเตือน", MessageBoxButtons.OK, MessageBoxIcon.Information);
                txtUserPay.Text = "";
                txtUserPay.Focus();
                return;
            }
        }
Esempio n. 2
0
        private void btnNext4_Click(object sender, EventArgs e)
        {
            if (pvMode == "IN")
            {
                if (txtUserResive.Text != "")
                {
                    string lvChk = GsysSQL.fncFindEmpName(txtUserResive.Text);
                    if (lvChk == "")
                    {
                        MessageBox.Show("ไม่พบข้อมูลรหัสนี้  กรุณาตรวจสอบ", "แจ้งเตือน", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        txtUserResive.Text = "";
                        txtUserResive.Focus();
                        return;
                    }


                    tabControl1.SelectedIndex = 4;
                    //txtRemark.Text = "";
                    txtRemark.Focus();
                }
                else
                {
                    MessageBox.Show("กรุณาระบุผู้รับ", "แจ้งเตือน", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    txtUserResive.Text = "";
                    txtUserResive.Focus();
                    return;
                }
            }
            else
            {
                if (txtUserResive.Text != "")
                {
                    string lvChk = GsysSQL.fncFindEmpName(txtUserResive.Text);
                    if (lvChk == "")
                    {
                        MessageBox.Show("ไม่พบข้อมูลรหัสนี้  กรุณาตรวจสอบ", "แจ้งเตือน", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        txtUserResive.Text = "";
                        txtUserResive.Focus();
                        return;
                    }

                    tabControl1.SelectedIndex = 5;
                    txtUserPay.Text           = "";
                    txtUserPay.Focus();

                    btnSearchUser1.PerformClick();
                }
                else
                {
                    MessageBox.Show("กรุณาระบุผู้รับ", "แจ้งเตือน", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    txtUserResive.Text = "";
                    txtUserResive.Focus();
                    return;
                }
            }
        }
Esempio n. 3
0
        public void lvLoadItem(bool lvShow)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                btnreg.Enabled      = false;
                btnIn.Enabled       = false;
                btnOut.Enabled      = false;
                btnBorrow.Enabled   = false;
                btnNoteBook.Enabled = false;

                string lvSQL = "Select Top 50 * from Inv_Moving Where M_Type in ('R','P') Order by M_Pk Desc ";

                DataTable DT = new DataTable();
                DT = GsysSQL.fncGetQueryData(lvSQL, DT);

                int lvNumRow = DT.Rows.Count;
                sp1.ActiveSheet.RowCount = lvNumRow;

                progressBar1.Maximum = lvNumRow;
                progressBar1.Value   = 0;
                pnStatus.Visible     = true;

                for (int i = 0; i < lvNumRow; i++)
                {
                    sp1.ActiveSheet.Cells[i, 0].Text = Gstr.fncChangeSDate(DT.Rows[i]["M_Date"].ToString());
                    sp1.ActiveSheet.Cells[i, 1].Text = DT.Rows[i]["M_ItemID"].ToString();
                    sp1.ActiveSheet.Cells[i, 2].Text = GsysSQL.fncFindItemName(DT.Rows[i]["M_ItemID"].ToString());
                    sp1.ActiveSheet.Cells[i, 3].Text = DT.Rows[i]["M_AmountR"].ToString();
                    sp1.ActiveSheet.Cells[i, 4].Text = DT.Rows[i]["M_AmountP"].ToString();
                    sp1.ActiveSheet.Cells[i, 5].Text = DT.Rows[i]["M_AmountBal"].ToString();
                    sp1.ActiveSheet.Cells[i, 6].Text = GsysSQL.fncFindEmpName(DT.Rows[i]["M_UserResive"].ToString());
                    sp1.ActiveSheet.Cells[i, 7].Text = GsysSQL.fncFindEmpName(DT.Rows[i]["M_UserPay"].ToString());
                    sp1.ActiveSheet.Cells[i, 8].Text = GsysSQL.fncFindEmpName(DT.Rows[i]["M_Remark"].ToString());

                    progressBar1.Value += 1;
                    Application.DoEvents();
                }

                pnStatus.Visible = false;
                DT.Dispose();

                btnreg.Enabled      = true;
                btnIn.Enabled       = true;
                btnOut.Enabled      = true;
                btnBorrow.Enabled   = true;
                btnNoteBook.Enabled = true;

                if (lvShow)
                {
                    tabControl1.SelectedIndex = 0;
                }

                this.Cursor = Cursors.Default;
            }
            catch
            {
                Application.Restart();
            }
        }