public int checkMatHang(string maHang, string maKho) { string sql = string.Format("SELECT 1 FROM TONKHO WHERE MAHANG = N'{0}'and MAKHO = N'{1}'", maHang, maKho); int check = Convert.ToInt32(ConnectionDB.ExcuteQuery(sql)); return(check); }
public object getSumSoLuongXuat(string maHang, string maKho) { string sql = string.Format("SELECT SUM( ct.SoLuong) FROM THONGTIN_PHIEU_BANHANG tt, CT_PHIEUXUAT ct " + "WHERE ct.MaPhieuXuat = tt.MaPhieu and ct.MaHang = '{0}' and tt.maKho = '{1}'", maHang, maKho); return(ConnectionDB.ExcuteQuery(sql)); }
public int getSoLuong(TonKho tk) // lấy so luongj tồn kho của mH { string sql = string.Format("SELECT SOLUONGTON FROM TONKHO WHERE MAKHO = '{0}' and MAHANG = '{1}'", tk.MaKho, tk.MaHang); int sl = Convert.ToInt32(ConnectionDB.ExcuteQuery(sql)); return(sl); }
public object getSumTongTienNhap(string maHang, string maKho) { string sql = string.Format("SELECT SUM( ct.ThanhTien) FROM THONGTIN_PHIEUNHAPHANG tt, CT_PHIEUNHAP ct " + "WHERE ct.MaPhieu = tt.MaPhieu and ct.MaHang = '{0}' and tt.maKho = '{1}'", maHang, maKho); return(ConnectionDB.ExcuteQuery(sql)); }
public int getUserLogin(string userName, string pass) { string sql = String.Format("SELECT 1 FROM [SYS_USER] where UserName = '******' and Password = '******'", "admin", "01"); int check = ConnectionDB.ExcuteQuery(sql); return(check); }
public double getPhatSinhTrongKy(string maKH) { double phatSinh = 0; string sql = string.Format("SELECT SUM(TONGTIENNHAN) FROM THONGTIN_PHIEU_BANHANG WHERE MaKH = '{0}' ", maKH); phatSinh = Convert.ToDouble(ConnectionDB.ExcuteQuery(sql)); return(phatSinh); }
public double getPhatSinhTrongKyNCC(string MaNCC) { double phatSinh = 0; string sql = string.Format("SELECT SUM(TONGTIENTRA) FROM THONGTIN_PHIEUNHAPHANG WHERE MaNCC = '{0}' ", MaNCC); phatSinh = Convert.ToDouble(ConnectionDB.ExcuteQuery(sql)); return(phatSinh); }
public float getSumTienFromNCC(string maNCC) { string sql = string.Format("SELECT sum(TongTienTra) FROM THONGTIN_PHIEUNHAPHANG where MaNCC = '{0}'", maNCC); if (ConnectionDB.ExcuteQuery(sql).ToString() == "") { return(0); } return((float)Convert.ToDouble(ConnectionDB.ExcuteQuery(sql))); }
public float getSumTienFromKH(string maKH) { string sql = string.Format("SELECT sum(TongTienNhan) FROM THONGTIN_PHIEU_BANHANG where MaKH = '{0}'", maKH); if (ConnectionDB.ExcuteQuery(sql).ToString() == "") { return(0); } return((float)Convert.ToDouble(ConnectionDB.ExcuteQuery(sql))); }
public float getSumTienBan(string maNV) { string sql = string.Format("SELECT sum(ThanhToan) FROM THONGTIN_PHIEU_BANHANG tt, CT_PHIEUXUAT ct " + "WHERE tt.MaPhieu = ct.MaPhieuXuat and tt.MaNVLap = '{0}'", maNV); if (ConnectionDB.ExcuteQuery(sql).ToString() == "") { return(0); } return((float)Convert.ToDouble(ConnectionDB.ExcuteQuery(sql))); }
public float sumTienBan(DateTime a) { string sql = string.Format("SELECT sum(TongTienNhan) " + "FROM THONGTIN_PHIEU_BANHANG where NgayLap = '{0}' ", a); if (ConnectionDB.ExcuteQuery(sql).ToString() == "") { return(0); } return((float)Convert.ToDouble(ConnectionDB.ExcuteQuery(sql))); }
public int checkMaChungTuInPhieuThu(string maChungTu) { string sql = string.Format("SELECT 1 FROM BANGKE_PHIEUTHUTIEN WHERE MAPHIEUXUAT = '{0}'", maChungTu); return(Convert.ToInt32(ConnectionDB.ExcuteQuery(sql))); }
public int checkMaPhieuChuyenKho(string maPhieu) { string sql = string.Format("SELECT 1 FROM THONGTIN_CHUYENKHO WHERE MaPhieuChuyen = '{0}'", maPhieu); return(Convert.ToInt32(ConnectionDB.ExcuteQuery(sql))); }
public int checkMaHang(string MaHang, string maPhieu) { string sql = string.Format("Select 1 from [CT_PHIEUNHAP] where MaHang = '{0}' and MaPhieu = '{1}' ", MaHang, maPhieu); return(Convert.ToInt32(ConnectionDB.ExcuteQuery(sql))); }
public int checkMaHangTrongTonKho(string maHang) { string sql = string.Format("SELECT 1 FROM TONKHO where MaHang = '{0}' and Soluongton >= {1} ", maHang, 1); return(Convert.ToInt32(ConnectionDB.ExcuteQuery(sql))); }
public int checkMaPhieuBan(string maPhieu) { string sql = string.Format("SELECT 1 FROM THONGTIN_PHIEU_BANHANG WHERE MaPhieu = '{0}'", maPhieu); return(Convert.ToInt32(ConnectionDB.ExcuteQuery(sql))); }
public int checkMaChungTuInPhieuChi(string maChungTu) { string sql = string.Format("SELECT 1 FROM [BANGKE_PHIEUCHITIEN] WHERE MAPHIEUCHI = '{0}'", maChungTu); return(Convert.ToInt32(ConnectionDB.ExcuteQuery(sql))); }