Beispiel #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            string   hoTen  = textBox4.Text.ToString();
            string   diaChi = textBox5.Text.ToString();
            DateTime ngCap  = DateTime.Parse(textBox6.Text.ToString());

            textBox6.Text = ngCap.ToString("dd/MM/yyyy");
            string   CMNDAN      = textBox7.Text.ToString();
            string   maDV        = comboBox1.Text.ToString();
            string   maGDV_lpgui = label14.Text.ToString();
            string   soTiengui   = textBox11.Text.ToString();
            DateTime ngDenhan    = DateTime.Parse(textBox6.Text.ToString());

            textBox6.Text = ngDenhan.ToString("dd/MM/yyyy");

            string[]  name           = { "@CMND", "@HOTEN", "@DIACHI", "@NGAYCAP", "@MADV", "@SOTIEN_GUI", "@NGAYDENHAN", "@MAGDV_LPGUI" };
            object[]  param          = { CMNDAN, hoTen, diaChi, ngCap, maDV, soTiengui, ngDenhan, maGDV_lpgui };
            DataTable thongtindichvu = DBAcess.ExecuteQuery("SP_THEMPHIEUGUI", name, param, 8);

            label15.DataBindings.Add("TEXT", thongtindichvu, "MAPHIEU");
            MessageBox.Show("Đã thêm thành công " + textBox11.Text + " " + "VDN vào phiếu gửi " + " " + label15.Text.ToUpper());

            textBox4.DataBindings.Clear();
            textBox5.DataBindings.Clear();
            textBox6.DataBindings.Clear();
            textBox7.DataBindings.Clear();
            comboBox1.DataBindings.Clear();
            textBox11.DataBindings.Clear();

            /* string laiSuat =
             *
             * string ngdenHan =
             * string maGDV_lpgui =*/
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            DateTime fromdate = DateTime.Parse(dateTimePicker1.Value.ToString());


            DateTime todate = DateTime.Parse(dateTimePicker2.Value.ToString());



            string[]  name             = { "@FROMDATE", "@TODATE" };
            object[]  param            = { fromdate, todate };
            DataTable phieutrongkhoang = DBAcess.ExecuteQuery("SP_LIETKEPHIEUGUI", name, param, 2);

            reportViewer1.ProcessingMode         = ProcessingMode.Local;
            reportViewer1.LocalReport.ReportPath = "Thongkephieugui.rdlc";
            if (phieutrongkhoang.Rows.Count > 0)
            {
                ReportDataSource rds = new ReportDataSource();
                rds.Name  = "DataSet1";
                rds.Value = phieutrongkhoang;

                reportViewer1.LocalReport.DataSources.Clear();
                reportViewer1.LocalReport.DataSources.Add(rds);
                reportViewer1.RefreshReport();
            }
        }
Beispiel #3
0
        private void AddMaPhieutoCompo()
        {
            MaPhieu = DBAcess.ExecuteQuery("SP_LAYMAPHIEU");
            comboBox2.DataSource = MaPhieu;

            comboBox2.ValueMember = "MAPHIEU";
        }
Beispiel #4
0
        private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            string maphieu = comboBox2.SelectedValue.ToString();

            string[] name  = { "@MAPHIEU" };
            object[] param = { maphieu };

            DataTable thongtinkhachhang = DBAcess.ExecuteQuery("SP_LAYTHONGTINKHACHANG", name, param, 1);

            textBox4.DataBindings.Add("TEXT", thongtinkhachhang, "HOTEN");
            textBox4.DataBindings.Clear();
            textBox5.DataBindings.Add("TEXT", thongtinkhachhang, "DIACHI");
            textBox5.DataBindings.Clear();

            /*textBox6.DataBindings.Add("TEXT", thongtinkhachhang, "NGAYCAP");
             * textBox6.DataBindings.Clear();*/

            dateTimePicker2.DataBindings.Clear();
            dateTimePicker2.DataBindings.Add("Value", thongtinkhachhang, "NGAYCAP");



            textBox7.DataBindings.Add("TEXT", thongtinkhachhang, "CMNDAN");
            textBox7.DataBindings.Clear();
            comboBox1.DataBindings.Add("TEXT", thongtinkhachhang, "MDV");
            comboBox1.DataBindings.Clear();
        }
Beispiel #5
0
        private void AddMaDichvuCompo()
        {
            madichvu             = DBAcess.ExecuteQuery("SP_LAYMADICHVU");
            comboBox1.DataSource = madichvu;

            comboBox1.ValueMember = "MADV";
        }
Beispiel #6
0
        private void btnTienlai_Click(object sender, EventArgs e)
        {
            try
            {
                /* Chuyen kieu string sang date time */
                DateTime ngGUI = DateTime.Parse(ngayguiTBOX.Text.ToString());
                ngayguiTBOX.Text = ngGUI.ToString("dd/MM/yyyy");

                DateTime ngDenHan = DateTime.Parse(ngaydenhanTBOX.Text.ToString());
                ngaydenhanTBOX.Text = ngDenHan.ToString("dd/MM/yyyy");


                DateTime ngRut = DateTime.Parse(dateTimePicker1.Value.ToString());
                dateTimePicker1.Text = ngRut.ToShortDateString();

                string maPH = comboBox1.SelectedItem.ToString();

                /*  DateTime ngGUI = DateTime.Parse(DateTime.Now.ToShortDateString());
                 * string ngayguiTBOX = ngGUI.Day + "/" + ngGUI.Month + "/" + ngGUI.Year;
                 * MessageBox.Show(ngayguiTBOX);*/



                /*string maDV = madichvuTBOX.Text.ToString();*/
                /*string ngGUI = ngayguiTBOX.Text.ToString();*/
                /*string ngDenHan = ngaydenhanTBOX.Text.ToString();*/

                /*string laiSuat = laisuatTBOX.Text.ToString();
                 * string sotienGui = sotienguiTBOX.Text.ToString();*/
                /*string ngRut = dateTimePicker1.Value.ToString();*/
                /*string kyHan = kyhanTBOX.Text.ToString();*/


                // truyen bien vao thuoc tinh khai bao trong sp
                string[]  name     = { "@MAPHIEU" };
                object[]  param    = { maPH };
                DataTable tien_lai = DBAcess.ExecuteQuery("SP_TINHTIENLAI", name, param, 1);


                ngayguiTBOX.DataBindings.Clear();
                ngaydenhanTBOX.DataBindings.Clear();
                dateTimePicker1.DataBindings.Clear();

                tienlaiTBOX.DataBindings.Add("TEXT", tien_lai, "TIENLAI");


                tienlaiTBOX.DataBindings.Clear();



                tienlaiTBOX.Enabled = false;
                btnGhi.Enabled      = true;
            }
            catch
            {
                MessageBox.Show("co loi");
            }
        }
 private void AddMaPhieutoCompo()
 {
     maphieu = DBAcess.ExecuteQuery("SP_LAYMAPHIEU");
     comboBox1.Items.Clear();
     foreach (DataRow s in maphieu.Rows)
     {
         comboBox1.Items.Add(s[1]);
     }
     comboBox1.SelectedIndex = 0;
 }
Beispiel #8
0
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                if (textBox4.Text.Trim() == "" | textBox5.Text.Trim() == "" | textBox7.Text.Trim() == "" | comboBox1.Text == "")
                {
                    MessageBox.Show("Không được để trống các trường trong form ");
                }
                if (textBox11.Text.Trim() == "")
                {
                    MessageBox.Show("Mời bạn nhập số tiền muốn gửi");
                }
                if (textBox4.Text.Trim() != "" && textBox5.Text.Trim() != "" && textBox7.Text.Trim() != "" && comboBox1.Text != "" && textBox7.Text.Length < 11)
                {
                    string hoTen  = textBox4.Text.ToString();
                    string diaChi = textBox5.Text.ToString();

                    /*DateTime ngCap = DateTime.Parse(textBox6.Text.ToString());
                     * textBox6.Text = ngCap.ToString("dd/MM/yyyy");*/
                    DateTime ngCap = DateTime.Parse(dateTimePicker2.Text.ToString());
                    dateTimePicker2.Text = ngCap.ToString();
                    string   CMNDAN      = textBox7.Text.ToString();
                    string   maDV        = comboBox1.Text.ToString();
                    string   maGDV_lpgui = label14.Text.ToString();
                    string   soTiengui   = textBox11.Text.ToString();
                    DateTime ngDenhan    = DateTime.Parse(textBox1.Text.ToString());
                    textBox1.Text = ngDenhan.ToString("dd/MM/yyyy");

                    string[]  name           = { "@CMND", "@HOTEN", "@DIACHI", "@NGAYCAP", "@MADV", "@SOTIEN_GUI", "@NGAYDENHAN", "@MAGDV_LPGUI" };
                    object[]  param          = { CMNDAN, hoTen, diaChi, ngCap, maDV, soTiengui, ngDenhan, maGDV_lpgui };
                    DataTable thongtindichvu = DBAcess.ExecuteQuery("SP_THEMPHIEUGUI", name, param, 8);

                    label15.DataBindings.Add("TEXT", thongtindichvu, "MAPHIEU");
                    MessageBox.Show("Đã thêm thành công " + textBox11.Text + " " + "VDN vào phiếu gửi " + " " + label15.Text.ToUpper());

                    textBox4.DataBindings.Clear();
                    textBox5.DataBindings.Clear();
                    /*textBox6.DataBindings.Clear();*/
                    dateTimePicker2.DataBindings.Clear();
                    textBox7.DataBindings.Clear();
                    comboBox1.DataBindings.Clear();
                    textBox11.DataBindings.Clear();

                    /* string laiSuat =
                     *
                     * string ngdenHan =
                     * string maGDV_lpgui =*/
                    PhieuGuiTien_Load(sender, e);
                }
            }
            catch
            {
                MessageBox.Show("GUI TIEN THAT BAI ROI");
            }
        }
Beispiel #9
0
        private void button1_Click(object sender, EventArgs e)
        {
            string maPH = comboBox1.SelectedItem.ToString();

            string[]  name     = { "@MAPHIEU" };
            object[]  param    = { maPH };
            DataTable thongtin = DBAcess.ExecuteQuery("SP_LAYDULIEUFORPHIEURUT", name, param, 1);

            /*SqlCommand cmd = new SqlCommand("SP_LAYDULIEUFORPHIEURUT", conn);
             * cmd.CommandType = CommandType.StoredProcedure;*/

            hotenTBOX.DataBindings.Add("TEXT", thongtin, "HOTEN");
            cmndTBOX.DataBindings.Add("TEXT", thongtin, "CMND");
            diachiTBOX.DataBindings.Add("TEXT", thongtin, "DIACHI");
            ngaycapTBOX.DataBindings.Add("TEXT", thongtin, "NGAYCAP");
            madichvuTBOX.DataBindings.Add("TEXT", thongtin, "MADV");
            dichvuTBOX.DataBindings.Add("TEXT", thongtin, "TENDV");
            kyhanTBOX.DataBindings.Add("TEXT", thongtin, "KYHAN");
            ngayguiTBOX.DataBindings.Add("TEXT", thongtin, "NGAYGUI");
            ngaydenhanTBOX.DataBindings.Add("TEXT", thongtin, "NGAYDENHAN");
            laisuatTBOX.DataBindings.Add("TEXT", thongtin, "LAISUAT");
            sotienguiTBOX.DataBindings.Add("TEXT", thongtin, "SOTIEN_GUI");
            magdvTBOX.DataBindings.Add("TEXT", thongtin, "MAGDV_LPGUI");


            /* clear databindings */
            hotenTBOX.DataBindings.Clear();
            cmndTBOX.DataBindings.Clear();
            diachiTBOX.DataBindings.Clear();
            ngaycapTBOX.DataBindings.Clear();
            madichvuTBOX.DataBindings.Clear();
            dichvuTBOX.DataBindings.Clear();
            kyhanTBOX.DataBindings.Clear();
            ngayguiTBOX.DataBindings.Clear();
            ngaydenhanTBOX.DataBindings.Clear();
            laisuatTBOX.DataBindings.Clear();
            sotienguiTBOX.DataBindings.Clear();
            magdvTBOX.DataBindings.Clear();

            /* enable text box */

            hotenTBOX.Enabled      = false;
            cmndTBOX.Enabled       = false;
            diachiTBOX.Enabled     = false;
            ngaycapTBOX.Enabled    = false;
            madichvuTBOX.Enabled   = false;
            dichvuTBOX.Enabled     = false;
            kyhanTBOX.Enabled      = false;
            ngayguiTBOX.Enabled    = false;
            ngaydenhanTBOX.Enabled = false;
            laisuatTBOX.Enabled    = false;
            sotienguiTBOX.Enabled  = false;
            btnTienlai.Enabled     = true;
        }
Beispiel #10
0
        private void AddMaPhieutoCompo()
        {
            dichvu = DBAcess.ExecuteQuery("SP_LAYMADICHVU");

            comboBox1.Items.Clear();
            foreach (DataRow s in dichvu.Rows)
            {
                comboBox1.Items.Add(s[0]);
            }
            comboBox1.SelectedIndex = 0;
        }
Beispiel #11
0
        private void button12_Click_1(object sender, EventArgs e)
        {
            DateTime year = DateTime.Parse(dateTimePicker3.Value.ToString());

            string[] name  = { "@YEAR" };
            object[] param = { year };

            DataTable table = DBAcess.ExecuteQuery("SP_LIETKETIENTHEOTHANG", name, param, 1);

            this.sP_LIETKETIENTHEOTHANGDataGridView.DataSource = table;
        }
Beispiel #12
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Bạn muốn xóa mã phiếu :" + " " + comboBox2.Text, "Xác nhận", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         string    maPhieu     = comboBox2.Text.ToString();
         string[]  name        = { "@MAPHIEU" };
         object[]  param       = { maPhieu };
         DataTable xoaphieugui = DBAcess.ExecuteQuery("SP_XOAPHIEUGUI", name, param, 1);
         MessageBox.Show("Đã xóa mã phiếu" + " " + maPhieu + " " + "thành công");
         comboBox2.DataBindings.Clear();
         PhieuGuiTien_Load(sender, e);
     }
 }
Beispiel #13
0
        private void tinhngaydenhan()
        {
            DateTime ngGUI = DateTime.Parse(dateTimePicker1.Value.ToString());

            dateTimePicker1.Text = ngGUI.ToShortDateString();
            string kyhan = textBox8.Text.ToString();

            string [] name       = { "@NGAYGUI", "@KYHAN" };
            object[]  param      = { ngGUI, kyhan };
            DataTable ngaydenhan = DBAcess.ExecuteQuery("SP_TINHNGAYDENHAN", name, param, 2);

            textBox1.DataBindings.Add("TEXT", ngaydenhan, "NGAYDENHAN");
            textBox1.DataBindings.Clear();
        }
Beispiel #14
0
        private void button5_Click_1(object sender, EventArgs e)
        {
            DateTime fromdate = DateTime.Parse(dateTimePicker2.Value.ToString());


            DateTime todate = DateTime.Parse(dateTimePicker1.Value.ToString());



            string[]  name             = { "@FROMDATE", "@TODATE" };
            object[]  param            = { fromdate, todate };
            DataTable phieutrongkhoang = DBAcess.ExecuteQuery("SP_LIETKEPHIEUGUI", name, param, 2);

            this.sP_LIETKEPHIEUGUIDataGridView.DataSource = phieutrongkhoang;
        }
Beispiel #15
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            string maDV = comboBox1.SelectedValue.ToString();

            string[] name  = { "@MADV" };
            object[] param = { maDV };

            DataTable thongtindichvu = DBAcess.ExecuteQuery("SP_LAYTHONGTINDICHVU", name, param, 1);

            textBox9.DataBindings.Add("TEXT", thongtindichvu, "TENDV");
            textBox9.DataBindings.Clear();
            textBox8.DataBindings.Add("TEXT", thongtindichvu, "KYHAN");
            textBox8.DataBindings.Clear();
            textBox10.DataBindings.Add("TEXT", thongtindichvu, "LAISUAT");
            textBox10.DataBindings.Clear();
            tinhngaydenhan();
        }
Beispiel #16
0
        private void ReportDV_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'TKBUUDIENDataSet2.SP_LAYTHONGTINDICHVU' table. You can move, or remove it, as needed.
            this.reportViewer1.RefreshReport();

            dichvu = DBAcess.ExecuteQuery("SP_LIETKEDICHVU");
            reportViewer1.ProcessingMode         = ProcessingMode.Local;
            reportViewer1.LocalReport.ReportPath = "Thongkedichvu.rdlc";
            if (dichvu.Rows.Count > 0)
            {
                ReportDataSource rds = new ReportDataSource();
                rds.Name  = "DataSet2";
                rds.Value = dichvu;

                reportViewer1.LocalReport.DataSources.Clear();
                reportViewer1.LocalReport.DataSources.Add(rds);
                reportViewer1.RefreshReport();
            }
        }
Beispiel #17
0
        private void ReportPhieuGuiquahan_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'TKBUUDIENDataSet2.SP_LIETKEPHIEUGUIQUAHAN' table. You can move, or remove it, as needed.


            this.reportViewer1.RefreshReport();
            pguiquahan = DBAcess.ExecuteQuery("SP_LIETKEPHIEUGUIQUAHAN");
            reportViewer1.ProcessingMode         = ProcessingMode.Local;
            reportViewer1.LocalReport.ReportPath = "Thongkephieuguiquahan.rdlc";
            if (pguiquahan.Rows.Count > 0)
            {
                ReportDataSource rds = new ReportDataSource();
                rds.Name  = "DataSet3";
                rds.Value = pguiquahan;

                reportViewer1.LocalReport.DataSources.Clear();
                reportViewer1.LocalReport.DataSources.Add(rds);
                reportViewer1.RefreshReport();
            }
        }
Beispiel #18
0
        private void DANHSACH_LOAD()
        {
            DataTable dsbackup = DBAcess.ExecuteQuery("SP_DANHSACHBACKUP");

            sP_DANHSACHBACKUPBindingSource.DataSource = dsbackup;
        }
Beispiel #19
0
        private void load_dichvu(object sender, EventArgs e)
        {
            DataTable dichvu = DBAcess.ExecuteQuery("SP_LIETKEDICHVU");

            sP_LIETKEDICHVUBindingSource1.DataSource = dichvu;
        }
Beispiel #20
0
        private void load_phieuguiquahan()
        {
            DataTable pguiquahan = DBAcess.ExecuteQuery("SP_LIETKEPHIEUGUIQUAHAN");

            sP_LIETKEPHIEUGUIQUAHANBindingSource.DataSource = pguiquahan;
        }