예제 #1
0
        public DataTable HienThiNhaCungCap()
        {
            string        str = "Sho_NCC";
            DataTable     dt  = new DataTable();
            SqlConnection con = new SqlConnection(KetNoiDB.KetNoi());

            con.Open();
            SqlDataAdapter ad = new SqlDataAdapter(str, con);

            ad.Fill(dt);
            con.Close();
            return(dt);
        }
예제 #2
0
        public DataTable TimKiemTenHH(string TenHH)
        {
            DataTable     dt  = new DataTable();
            string        sql = "Sea_TenHH";
            SqlConnection con = new SqlConnection(KetNoiDB.KetNoi());

            con.Open();
            SqlCommand cmd = new SqlCommand(sql, con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@TenHH", TenHH);
            SqlDataAdapter da = new SqlDataAdapter(cmd);

            da.Fill(dt);
            return(dt);
        }
예제 #3
0
        public DataTable DangNhap(string Username, string Pass)
        {
            DataTable     dt  = new DataTable();
            string        sql = "LogIn";
            SqlConnection con = new SqlConnection(KetNoiDB.KetNoi());

            con.Open();
            SqlCommand cmd = new SqlCommand(sql, con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Username", Username);
            cmd.Parameters.AddWithValue("@Pass", Pass);
            SqlDataAdapter da = new SqlDataAdapter(cmd);

            da.Fill(dt);
            return(dt);
        }
예제 #4
0
        public void GhiPhieuNhap(string MaPhieuNhap, string MaNV, string MaNCC, string NgayNhap, string TongNhap)
        {
            string        str = "ADD_PN";
            SqlConnection con = new SqlConnection(KetNoiDB.KetNoi());

            con.Open();
            SqlCommand cmd = new SqlCommand(str, con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@MaPhieuNhap", MaPhieuNhap);
            cmd.Parameters.AddWithValue("@MaNV", MaNV);
            cmd.Parameters.AddWithValue("@MaNCC", MaNCC);
            cmd.Parameters.AddWithValue("@NgayNhap", NgayNhap);
            cmd.Parameters.AddWithValue("@TongNhap", TongNhap);
            cmd.ExecuteNonQuery();
            cmd.Dispose();
            con.Close();
        }
예제 #5
0
        public void GhiChiTietXuat(string MaPhieuXuat, string MaHH, string SoLuong, string DonGiaXuat, string ThanhTien)
        {
            string        str = "ADD_CTX";
            SqlConnection con = new SqlConnection(KetNoiDB.KetNoi());

            con.Open();
            SqlCommand cmd = new SqlCommand(str, con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@MaPhieuXuat", MaPhieuXuat);
            cmd.Parameters.AddWithValue("@MaHH", MaHH);
            cmd.Parameters.AddWithValue("@SoLuong", SoLuong);
            cmd.Parameters.AddWithValue("@DonGiaXuat", DonGiaXuat);
            cmd.Parameters.AddWithValue("@ThanhTien", ThanhTien);
            cmd.ExecuteNonQuery();
            cmd.Dispose();
            con.Close();
        }
예제 #6
0
        public void GhiPhieuXuat(string MaPhieuXuat, string MaNV, string MaKH, string NgayXuat, string TongXuat)
        {
            string str = "ADD_PX";

            SqlConnection con = new SqlConnection(KetNoiDB.KetNoi());

            con.Open();
            SqlCommand cmd = new SqlCommand(str, con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@MaPhieuXuat", MaPhieuXuat);
            cmd.Parameters.AddWithValue("@MaNV", MaNV);
            cmd.Parameters.AddWithValue("@MaKH", MaKH);
            cmd.Parameters.AddWithValue("@NgayXuat", NgayXuat);
            cmd.Parameters.AddWithValue("@TongXuat", TongXuat);
            cmd.ExecuteNonQuery();
            cmd.Dispose();
            con.Close();
        }