private void NutXoa_Click(object sender, EventArgs e) { ChonSach.SelectedValue = "XXXX"; BoxGhiChu.Clear(); GiaTien.Text = "0 VNĐ" + Environment.NewLine; }
private void DonGiaoHang_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'qLNSDataSet2.SACH' table. You can move, or remove it, as needed. this.sACHTableAdapter1.Fill(this.qLNSDataSet2.SACH); // TODO: This line of code loads data into the 'qLNSDataSet1.SACH' table. You can move, or remove it, as needed. this.sACHTableAdapter.Fill(this.qLNSDataSet1.SACH); ChonSach.SelectedValue = "XXXX"; BoxGhiChu.Clear(); GiaTien.Text = "0 VNĐ"; }
private void DonGiaoHang_Load(object sender, EventArgs e) { ChonSach.Text = BookID; BoxGhiChu.Clear(); SqlConnection con = new SqlConnection(); con.ConnectionString = "Server=.;Database=QLNS;Trusted_Connection=true"; con.Open(); SqlDataAdapter cmd = new SqlDataAdapter("select * from SACH where MASACH ='" + BookID + "'", con); DataTable dt = new DataTable(); cmd.Fill(dt); if (dt.Rows.Count != 0) { TenSach.Text = dt.Rows[0][1].ToString(); GiaTien.Text = dt.Rows[0][3] + " VNĐ"; } con.Close(); }
private void DonGiaoHang_Load(object sender, EventArgs e) { nfi.NumberDecimalDigits = 0; ChonSach.Text = BookID; BoxGhiChu.Clear(); SqlConnection con = new SqlConnection(); con.ConnectionString = "Server=.;Database=QLNS;Trusted_Connection=true"; con.Open(); SqlDataAdapter cmd = new SqlDataAdapter("select * from SACH where MASACH ='" + BookID + "'", con); DataTable dt = new DataTable(); cmd.Fill(dt); string SL = tbSoLuong.Text; Int32.TryParse(SL, out temp); Int32.TryParse(dt.Rows[0][3].ToString(), out tien); tongtien = temp * tien; GiaTien.Text = tongtien.ToString("N", nfi) + " VNĐ"; TenSach.Text = dt.Rows[0][1].ToString(); con.Close(); }