Beispiel #1
0
        // to select to add CATEGORIES data
        public DataTable GET_ALL_CATEGORIES()
        {
            DAL.DataAcessLayer DAL = new DAL.DataAcessLayer();
            DataTable          dt  = new DataTable();

            dt = DAL.SelectData("SP_GET_ALL_CATEGORIES", null);
            return(dt);
        }
Beispiel #2
0
        // this to initialize data to datat grid view
        public DataTable GET_ALL_PRODUCTS()
        {
            DAL.DataAcessLayer DLL = new DAL.DataAcessLayer();
            DataTable          dt  = new DataTable();

            dt = DLL.SelectData("SP_GET_ALL_PRODUCT", null);
            DLL.close();
            return(dt);
        }
Beispiel #3
0
        public DataTable GET_Last_Orders_ID_FOR_PRINT()
        {
            DAL.DataAcessLayer dll = new DAL.DataAcessLayer();
            DataTable          dt  = new DataTable();

            dt = dll.SelectData("SP_GET_LAST_ORDER_FOR_PRINT", null);
            dll.close();
            return(dt);
        }
Beispiel #4
0
        public DataTable Select_customers()
        {
            DAL.DataAcessLayer dll = new DAL.DataAcessLayer();
            dll.open();
            DataTable dt = new DataTable();

            dt = dll.SelectData("SP_SELECT_ALL_CUSTOMER", null);
            dll.close();
            return(dt);
        }
Beispiel #5
0
        //TO SEARCH from tbl product
        public DataTable SEARCH_PRODUCT(string id)
        {
            DAL.DataAcessLayer da       = new DAL.DataAcessLayer();
            SqlParameter[]     sqlparam = new SqlParameter[1];
            sqlparam[0]       = new SqlParameter("@ID", SqlDbType.VarChar, 50);
            sqlparam[0].Value = id;
            DataTable dt = new DataTable();

            dt = da.SelectData("SP_SEARCH_PRODUCT", sqlparam);
            return(dt);
        }
Beispiel #6
0
        //to get image
        public DataTable Select_Image(string id)
        {
            DAL.DataAcessLayer dl       = new DAL.DataAcessLayer();
            SqlParameter[]     sqlparam = new SqlParameter[1];
            sqlparam[0]       = new SqlParameter("@ID", SqlDbType.VarChar, 50);
            sqlparam[0].Value = id;
            DataTable dt = new DataTable();

            dt = dl.SelectData("SP_SELECT_IMAGE_PRODUCT", sqlparam);
            dl.close();
            return(dt);
        }
Beispiel #7
0
        public DataTable SEARCH_Users(string Criterion)
        {
            DAL.DataAcessLayer dll = new DAL.DataAcessLayer();
            DataTable          dt  = new DataTable();

            SqlParameter[] sqlparam = new SqlParameter[1];
            sqlparam[0]       = new SqlParameter("@Criterion", SqlDbType.VarChar, 50);
            sqlparam[0].Value = Criterion;

            dt = dll.SelectData("SP_SEARCH_USER", sqlparam);
            dll.close();
            return(dt);
        }
Beispiel #8
0
        //to check if id product found 2 once or one once
        public DataTable VerifyProductID(string ID)
        {
            DAL.DataAcessLayer DLL = new DAL.DataAcessLayer();
            DLL.open();
            SqlParameter[] sqlparam = new SqlParameter[1];
            sqlparam[0]       = new SqlParameter("@ID", SqlDbType.VarChar, 50);
            sqlparam[0].Value = ID;
            DataTable dt = new DataTable();

            dt = DLL.SelectData("SP_VerifyProductID", sqlparam);
            DLL.close();
            return(dt);
        }
Beispiel #9
0
        public DataTable GetOrderDetails(int ID_Order)
        {
            DAL.DataAcessLayer dll = new DAL.DataAcessLayer();
            DataTable          dt  = new DataTable();

            SqlParameter[] sqlparam = new SqlParameter[1];
            sqlparam[0]       = new SqlParameter("@ID_ORDER", SqlDbType.Int);
            sqlparam[0].Value = ID_Order;

            dt = dll.SelectData("SP_GetOrderDetails", sqlparam);
            dll.close();
            return(dt);
        }
Beispiel #10
0
        public DataTable Search_Customer(string criterion)
        {
            DAL.DataAcessLayer dll = new DAL.DataAcessLayer();
            dll.open();
            SqlParameter[] param = new SqlParameter[1];
            param[0]       = new SqlParameter("@Criterion", SqlDbType.VarChar, 50);
            param[0].Value = criterion;
            DataTable dt = new DataTable();

            dt = dll.SelectData("SP_SEARCH_CUSTOMER", param);
            dll.close();
            return(dt);
        }
Beispiel #11
0
        //*7* initialize to login from DataBase
        public DataTable LogIN(String ID, String PWD)
        {
            DAL.DataAcessLayer DAL      = new DAL.DataAcessLayer();
            SqlParameter[]     sqlparam = new SqlParameter[2];
            sqlparam[0]       = new SqlParameter("ID", SqlDbType.VarChar, 50);
            sqlparam[0].Value = ID;
            sqlparam[1]       = new SqlParameter("PWD", SqlDbType.VarChar, 50);
            sqlparam[1].Value = PWD;
            DAL.open();
            DataTable dt = new DataTable();

            dt = DAL.SelectData("SP_LOGIN", sqlparam);
            return(dt);
        }
Beispiel #12
0
        public DataTable VERIFYQTY(string ID_PRODUCT, int QTY_ENTERED)
        {
            DAL.DataAcessLayer dll = new DAL.DataAcessLayer();
            DataTable          dt  = new DataTable();

            SqlParameter[] sqlparam = new SqlParameter[2];
            sqlparam[0]       = new SqlParameter("@ID_PRODUCT", SqlDbType.VarChar, 30);
            sqlparam[0].Value = ID_PRODUCT;
            sqlparam[1]       = new SqlParameter("@QTY_ENTERED", SqlDbType.Int);
            sqlparam[1].Value = QTY_ENTERED;
            dt = dll.SelectData("SP_VERIFYQTY", sqlparam);
            dll.close();
            return(dt);
        }