예제 #1
0
        private void บลสงเงนToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (dataGridView1.Rows.Count == 0) return;
            if (dataGridView1.SelectedRows.Count == 0) return;

            string no = dataGridView1.SelectedRows[0].Cells["SId"].Value.ToString();
            string base_ = dataGridView1.SelectedRows[0].Cells["Base"].Value.ToString();
            RptReport rpt = new RptReport(no, base_, Case_.BillSend);
            rpt.ShowDialog();
        }
예제 #2
0
        private void บลแคชเชยรToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (DgvHead.Rows.Count == 0) return;
            if (DgvHead.SelectedRows.Count == 0) return;

            string no = DgvHead.SelectedRows[0].Cells["ChId"].Value.ToString();
            string base_ = DgvHead.SelectedRows[0].Cells["Base"].Value.ToString();
            RptReport rpt = new RptReport(no, base_, Case_.BiilCashier);
            rpt.ShowDialog();
        }
예제 #3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (!ValidateValue()) return;

            List<string> iSql = new List<string>();

            if (EditId != "")
            {
                iSql.Add("DELETE FROM CashierSend WHERE SId = '" + EditId + "' ");
            }

            string Amnt = "";

            for (int i = 1; i <= 11; ++i)
            {
                Amnt += ((TextBox)tableLayoutPanel3.Controls["txtA" + i]).Text + "#";
            }

            iSql.Add("INSERT INTO CashierSend (SId,SDate,SDateSave,SBank,SAmnt,UserName,SNote,SPeriod,CashierStatusId)VALUES" +
                "('" + txtNo.Text.Trim() + "','" + Class.Function.GetDate(dateTimePicker1.Value) + "',GETDATE(),'" + Amnt + "'," + txtSum.Text.Trim().Replace(",", "") + ",'" + Class.DBConnString.UserName + "','" + txtNote.Text.Trim() + "','" + (radioMor.Checked ? "1" : "0") + "',1)");
            iSql.Add("INSERT INTO CashierSendLog (SId,SDate,SDateSave,SBank,SAmnt,UserName,SNote,SPeriod)VALUES" +
                "('" + txtNo.Text.Trim() + "','" + Class.Function.GetDate(dateTimePicker1.Value) + "',GETDATE(),'" + Amnt + "'," + txtSum.Text.Trim().Replace(",", "") + ",'" + Class.DBConnString.UserName + "','" + txtNote.Text.Trim() + "','" + (radioMor.Checked ? "1" : "0") + "')");

            if (MessageBox.Show("คุณต้องการบันทึกข้อมูลส่งเงิน " + txtNo.Text + "\nใช่หรือไม่ ?", "คำยืนยัน", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                if (cls.ExecuteTransactionNonAlert(iSql.ToArray()))
                {
                    if (MessageBox.Show("บันทึกสำเร็จ คุณต้องการพิมพ์รายงาน " + txtNo.Text + "\nใช่หรือไม่ ?", "คำยืนยัน", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        RptReport rpt = new RptReport(txtNo.Text,comboBox1.Text,Case_.BillSend);
                        rpt.ShowDialog();
                    }
                    Clear();
                    this.DialogResult = DialogResult.OK;
                    this.Close();
                }

            }
        }