예제 #1
0
        public static int CheckHangTonKho(int mamh, int soluong)
        {
            string query = "USP_CheckHangTonKho @mamh , @soluong ";

            int chk = (int)SqlServerHelper.ExecuteScalar(query, new object[] { mamh, soluong });

            return(chk);
        }
예제 #2
0
        public static double TongTien(int mahdb)
        {
            string query = "USP_TongTien @mahdb ";

            try
            {
                int data = (int)SqlServerHelper.ExecuteScalar(query, new object[] { mahdb });
                return(data);
            }
            catch
            {
                return(0);
            }
        }
예제 #3
0
        public static int LayHoaDonTheoBan(int idtable)
        {
            string query = "select mahdb from hoadonban where MABA = " + idtable + " ";

            try
            {
                int id = (int)SqlServerHelper.ExecuteScalar(query);

                return(id);
            }
            catch (System.Exception ex)
            {
                return(-1);
            }
        }
예제 #4
0
 public static int LayHoaDonBanMax()
 {
     return((int)SqlServerHelper.ExecuteScalar("select MAX(MAHDB) from HoaDonBan"));
 }