Beispiel #1
0
 private void Save_Button_Click(object sender, EventArgs e)
 {
     blDVvaHD = new BLDVvaHD();
     if (blDVvaHD.CapNhatDVvaHD(MaDV_TextBox.Text, MaHD_TextBox.Text, SoNgaySD_TextBox.Text) == true)
     {
         LoadData();
         MessageBox.Show(" Cap nhat thanh cong");
     }
     else
     {
         MessageBox.Show(" Cap nhat that bai");
     }
 }
Beispiel #2
0
        private void Search_TextBox_TextChanged(object sender, EventArgs e)
        {
            string column;

            switch (Search_ComboBox.Text)
            {
            case "Mã Dịch Vụ":
            {
                column = "MaDV";
                break;
            }

            case "Mã Hợp Đồng":
            {
                column = "MaHD";
                break;
            }

            case "Số Ngày Sử Dụng":
            {
                column = "SoNgaySD";
                break;
            }

            default:
            {
                return;
            }
            }
            blDVvaHD = new BLDVvaHD();
            DataSet ds = blDVvaHD.TimKiem(column, Search_TextBox.Text);

            dtDVvaHD = new DataTable();
            dtDVvaHD = ds.Tables[0];
            dtDVvaHD.Columns.Remove("Hide");
            dgvDVvaHD.DataSource = dtDVvaHD;
        }
Beispiel #3
0
        private void ThongKeDichVu_Load(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            BLDVvaHD  bl = new BLDVvaHD();
            DataSet   ds = new DataSet();

            ds = bl.LayThongKeDichVu();
            dt = ds.Tables[0];
            dgvDV.DataSource = dt;
            dgvDV.Columns.Add("TongTien", "Tổng Tiền");
            for (int i = 0; i < dgvDV.Rows.Count - 1; i++)
            {
                dgvDV.Rows[i].Cells[5].Value += "";
                dgvDV.Rows[i].Cells[5].Value += (Convert.ToInt32(dgvDV.Rows[i].Cells[3].Value) * Convert.ToInt32(dgvDV.Rows[i].Cells[4].Value)).ToString();
            }

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                ChartDT.Series["TienDV"].Points.AddXY(dt.Rows[i].ItemArray[1], (Convert.ToInt32(dt.Rows[i].ItemArray[2]) * Convert.ToInt32(dt.Rows[i].ItemArray[3])));
                //ChartDT.Series["TienDV"].Points.Add((Convert.ToInt32(dt.Rows[i].ItemArray[2]) * Convert.ToInt32(dt.Rows[i].ItemArray[3])));
                //ChartDT.Series["TienDV"].Points[i].Label = (Convert.ToDouble(dt.Rows[i].ItemArray[2]) * Convert.ToDouble(dt.Rows[i].ItemArray[3])).ToString();
                //ChartDT.Series["TienDV"].Points[i].AxisLabel = dt.Rows[i].ItemArray[1].ToString();
            }
        }