Example #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            HOADONDIENNUOC hd = new HOADONDIENNUOC();

            hd.Mahdn      = txtMaHD.Text;
            hd.MaNV       = txtNhanVien.Text;
            hd.Ngaylap    = dtpNgaylap.Value;
            hd.HDThang    = Convert.ToInt32(txtHDThang.Text);
            hd.Sophong    = txtSophong.Text;
            hd.Sokhoinuoc = Convert.ToInt32(txtSokhoinuoc.Text);
            hd.Dongianuoc = Convert.ToDecimal(txtDongiaNuoc.Text);
            hd.Sokidien   = Convert.ToInt32(txtSokidien.Text);
            hd.Dongiadien = Convert.ToDecimal(txtDongiaDien.Text);
            hd.Tongtien   = Convert.ToDecimal(txtTongtien.Text);
            db.HOADONDIENNUOCs.Add(hd);
            db.SaveChanges();
            LoadHoaDonDienNuoc();
        }
Example #2
0
 void AddCheckIn(SINHVIEN sinhVien)
 {
     try
     {
         if (sinhVien != null)
         {
             CheckIn checkIn = new CheckIn();
             checkIn.Masv     = sinhVien.Masv;
             checkIn.ThoiGian = DateTime.Now;
             //MessageBox.Show(DateTime.Now.ToString());
             db.CheckIns.Add(checkIn);
             db.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Example #3
0
 public void SaveChanges()
 {
     entities.SaveChanges();
 }