Exemple #1
0
        public void Save(NhapDiemSV_BE lst)
        {
            string result = string.Empty;

            try
            {
                bool   check = CheckDiemThiSV(lst.MaSV, lst.MaLop, lst.MaMH, lst.LanThi);
                string sql   = string.Empty;
                if (!check)
                {
                    //insert
                    sql  = @"insert into tbl_DIEM (MaSV,MaLop,MaMH,DiemQTHeS1,DiemQTHeS2,DiemThi,DiemTP,DiemTBHP,DiemChuTBHP,LanThi,HocKi,SoTietNghi)";
                    sql += "values( '" + lst.MaSV + "','" + lst.MaLop + "','" + lst.MaMH + "','" + lst.DiemQTHeS1 + "','" + lst.DiemQTHeS2 + "','" + lst.DiemThi + "','" + lst.DiemTP + "','" + lst.DiemTBHP + "','" + lst.DiemChuTBHP + "','" + lst.LanThi + "','" + lst.HocKi + "','" + lst.SoTietNghi + "')";
                    // kn.ExcuteNonQuery(sql);
                }
                else
                {
                    //update
                    sql = "update tbl_DIEM set MaSV = '" + lst.MaSV + "', MaLop='" + lst.MaLop + "',MaMH='" + lst.MaMH + "', DiemQTHeS1='" + lst.DiemQTHeS1 + "',DiemQTHeS2='" + lst.DiemQTHeS2 + "',DiemThi='" + lst.DiemThi + "',DiemTP='" + lst.DiemTP + "',DiemTBHP='" + lst.DiemTBHP + "',DiemChuTBHP='" + lst.DiemChuTBHP + "',LanThi='" + lst.LanThi + "',HocKi='" + lst.HocKi + "',SoTietNghi='" + lst.SoTietNghi + "'  "
                          + "  where MaSV='" + lst.MaSV + "' and  MaLop='" + lst.MaLop + "' and MaMH = '" + lst.MaMH + "'  and LanThi = '" + lst.LanThi + "'   ";
                }
                //SAVE
                kn.ExcuteNonQuery(sql);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #2
0
        public void InsertNhanVien(NhanVienDTO nv)
        {
            string gt;

            if (nv.GioiTinh.Equals("Nam"))
            {
                gt = "True";
            }
            else
            {
                gt = "False";
            }
            nv.GioiTinh = gt;
            string sql = "Insert into NhanVien2 values(N'" + nv.MaNV + "', N'" + nv.TenNV + "', '" + nv.GioiTinh + "', N'" + nv.DiaChi + "' , N'" + nv.Sdt + "', N'" + nv.MaTrinhDo + "', '" + nv.TaiKhoan + "', '" + nv.MatKhau + "')";

            data.ExcuteNonQuery(sql);
        }
Exemple #3
0
        public void InsertKhachHang(KhachHangDTO kh)
        {
            string gt;

            if (kh.GioiTinh.Equals("Nam"))
            {
                gt = "True";
            }
            else
            {
                gt = "False";
            }
            kh.GioiTinh = gt;
            string sql = "Insert into KhachHang2 values('" + kh.MaKH + "',N'" + kh.TenKH + "','" + kh.SDT + "','" + kh.GioiTinh + "',N'" + kh.DiaChi + "','" + kh.MaNV + "')";

            data.ExcuteNonQuery(sql);
        }
Exemple #4
0
 public void DeleteTK(string tk)
 {
     try
     {
         string sql = @"delete from tbl_NGUOIDUNG WHERE TaiKhoan='" + tk + "'";
         kn.ExcuteNonQuery(sql);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #5
0
        public void InsertNhaCungCap(NhaCungCapDTO ncc)
        {
            string sql = "Insert into NhaCungCap2 values('" + ncc.MaNCC + "',N'" + ncc.TenNCC + "','" + ncc.SDT + "',N'" + ncc.DiaChi + "')";

            data.ExcuteNonQuery(sql);
        }
Exemple #6
0
        public void InsertChiTietHD(ChiTietHoaDonDTO ct)
        {
            string sql = "Insert into ChiTietHoaDon2 values('" + ct.MaHD + "','" + ct.MaHH + "','" + ct.SoLuong + "')";

            data.ExcuteNonQuery(sql);
        }
Exemple #7
0
        public void InsertHangHoa(HangDTO h)
        {
            string sql = "Insert into Hang2 values('" + h.Mahang + "',N'" + h.Tenhang + "','" + h.Donvitinh + "','" + h.Dongia + "','" + h.Maloai + "','" + h.Nhacungcap + "','" + h.Soluongco + "')";

            data.ExcuteNonQuery(sql);
        }
Exemple #8
0
        public void addLichSuGia(LichSuGiaDTO lh)
        {
            string sql = "Insert into LichSuGia2 values(N'" + lh.MaHang + "','" + lh.NgayBatDau + "','" + lh.NgayKetThuc + "', " + lh.DonGia + ",'" + lh.NgayCapNhat + "')";

            data.ExcuteNonQuery(sql);
        }
Exemple #9
0
        public void InsertHoaDon(HoaDonDTO hd)
        {
            string sql = "Insert into HoaDon2 values('" + hd.MaHD + "','" + hd.MaKH + "','" + hd.MaNV + "','" + hd.NgayLap + "')";

            data.ExcuteNonQuery(sql);
        }
Exemple #10
0
        public void InsertHangHoa(HangHoaObj hh)
        {
            string sql = "Insert into Hang2 values('" + hh.MaHH + "',N'" + hh.TenHH + "','" + hh.MaNCC + "','" + hh.DonGia + "','" + hh.SoLuong + "','" + hh.HoaHong + "')";

            data.ExcuteNonQuery(sql);
        }
Exemple #11
0
        public void EditTrinhDo(TrinhDoDTO trinhDoDTO)
        {
            string sql = "Update TrinhDo2 set TenTrinhDo = N'" + trinhDoDTO.TenTrinhDo + "', LuongCung = '" + trinhDoDTO.LuongCung + "' where MaTrinhDo = " + trinhDoDTO.MaTrinhDo;

            data.ExcuteNonQuery(sql);
        }