コード例 #1
0
        public static int DeleteProfile(PhieuXuatObj qh)
        {
            SqlParameter[] para = new SqlParameter[]
            {
                new SqlParameter("@ma", qh.MaPX)
            };

            return(ConectToSQL_Datvd.Execute_NonQuery("XoaPhieuXuat", para));
        }
コード例 #2
0
        public static int UpdateProfile(ChiTietPhieuXuatObj qh)
        {
            SqlParameter[] para = new SqlParameter[]
            { new SqlParameter("@ma", qh.MaPX),
              new SqlParameter("@masp", qh.MaSP),
              new SqlParameter("@sl", qh.SoLuong),
              new SqlParameter("@ChungLoai", qh.ChungLoai) };

            return(ConectToSQL_Datvd.Execute_NonQuery("SuaPhieuXuatCT", para));
        }
コード例 #3
0
        public static int UpdateProfile(PhieuXuatObj qh)
        {
            SqlParameter[] para = new SqlParameter[]
            { new SqlParameter("@ma", qh.MaPX),
              new SqlParameter("@makh", qh.MaKH),
              new SqlParameter("@manv", qh.MaNV),
              new SqlParameter("@ngay", qh.NgayXuat), };

            return(ConectToSQL_Datvd.Execute_NonQuery("SuaPhieuXuat", para));
        }
コード例 #4
0
 public static DataTable GetDataSanPham()
 {
     try
     {
         DataTable dt  = new DataTable();
         string    sql = "select MaSP,TenSP from SanPham ";
         conn = ConectToSQL_Datvd.Connect();
         SqlDataAdapter da = new SqlDataAdapter(sql, conn);
         da.Fill(dt);
         conn.Close();
         return(dt);
     }
     catch
     {
         conn.Close();
         return(null);
     }
 }
コード例 #5
0
 public static DataTable GetData(string s)
 {
     try
     {
         DataTable dt  = new DataTable();
         string    sql = "select s.TenSP,p.SoLuong,p.ChungLoai from PhieuXuatChiTiet p right join SanPham s on p.MaSP=s.MaSP where p.MaPX ='" + s + "'";
         conn = ConectToSQL_Datvd.Connect();
         SqlDataAdapter da = new SqlDataAdapter(sql, conn);
         da.Fill(dt);
         conn.Close();
         return(dt);
     }
     catch
     {
         conn.Close();
         return(null);
     }
 }
コード例 #6
0
 public static DataTable GetDataKhachHang()
 {
     try
     {
         DataTable dt  = new DataTable();
         string    sql = " select MaKH,TenkH from KhachHang";
         conn = ConectToSQL_Datvd.Connect();
         SqlDataAdapter da = new SqlDataAdapter(sql, conn);
         da.Fill(dt);
         conn.Close();
         return(dt);
     }
     catch
     {
         conn.Close();
         return(null);
     }
 }
コード例 #7
0
 public static DataTable GetDataNhanVien()
 {
     try
     {
         DataTable dt  = new DataTable();
         string    sql = "select MaNV,TenNV from NhanVien ";
         conn = ConectToSQL_Datvd.Connect();
         SqlDataAdapter da = new SqlDataAdapter(sql, conn);
         da.Fill(dt);
         conn.Close();
         return(dt);
     }
     catch
     {
         conn.Close();
         return(null);
     }
 }
コード例 #8
0
 public static DataTable GetData()
 {
     try
     {
         DataTable dt  = new DataTable();
         string    sql = " select a.MaPX,a.NgayXuat,a.TenNV,k.TenKH from KhachHang k right join (select p.MaPX,p.NgayXuat,n.TenNV,p.MaKH from PhieuXuat p left join NhanVien n on p.MaNV=n.MaNV) a on a.MaKH=k.MaKH";
         conn = ConectToSQL_Datvd.Connect();
         SqlDataAdapter da = new SqlDataAdapter(sql, conn);
         da.Fill(dt);
         conn.Close();
         return(dt);
     }
     catch
     {
         conn.Close();
         return(null);
     }
 }