public DataTable Get_allprdcts()
        {
            DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();
            DataTable             Dt  = new DataTable();

            Dt = dal.Read_Data("select_all_prdcts", null);
            return(Dt);
        }
        public DataTable Get_Categories()
        {
            DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();
            DataTable             Dt  = new DataTable();

            Dt = dal.Read_Data("Get_Categories", null);

            return(Dt);
        }
Ejemplo n.º 3
0
        public DataTable Get_Last_order()
        {
            DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();
            DataTable             Dt  = new DataTable();

            Dt = dal.Read_Data("Get_last_order_ID", null);

            return(Dt);
        }
        public DataTable Get_Customers()
        {
            DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();
            DataTable             Dt  = new DataTable();

            Dt = dal.Read_Data("Get_All_Customers", null);

            return(Dt);
        }
        public DataTable Delete(string ID)
        {
            DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();
            DataTable             Dt  = new DataTable();

            SqlParameter[] par = new SqlParameter[1];
            par[0]       = new SqlParameter("@ID", SqlDbType.NChar, 50);
            par[0].Value = ID;
            Dt           = dal.Read_Data("mydel", par);
            return(Dt);
        }
        public DataTable Search(string word)
        {
            DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();
            DataTable             Dt  = new DataTable();

            SqlParameter[] par = new SqlParameter[1];
            par[0]       = new SqlParameter("@word", SqlDbType.VarChar, 50);
            par[0].Value = word;
            Dt           = dal.Read_Data("Search", par);
            return(Dt);
        }
        public DataTable get_image(string ID)
        {
            DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();
            DataTable             Dt  = new DataTable();

            SqlParameter[] par = new SqlParameter[1];
            par[0]       = new SqlParameter("@ID", SqlDbType.NChar, 10);
            par[0].Value = ID;
            Dt           = dal.Read_Data("get_my_imag", par);
            dal.Close_Connection();
            return(Dt);
        }
        public DataTable find_cust( )
        {
            DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();
            DataTable             Dt  = new DataTable();

            SqlParameter[] par = new SqlParameter[1];
            par[0]       = new SqlParameter("@id", SqlDbType.Int);
            par[0].Value = id;
            Dt           = dal.Read_Data("find_customer", par);

            return(Dt);
        }
Ejemplo n.º 9
0
        public DataTable GET_BELLS(string word)
        {
            DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();
            DataTable             Dt  = new DataTable();

            SqlParameter[] par = new SqlParameter[1];
            par[0]       = new SqlParameter("@WORD", SqlDbType.VarChar, 50);
            par[0].Value = word;
            Dt           = dal.Read_Data("SEARCH_BELLS", par);

            return(Dt);
        }
Ejemplo n.º 10
0
        public DataTable GET_Details_return(int id)
        {
            DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();
            DataTable             Dt  = new DataTable();

            SqlParameter[] par = new SqlParameter[1];
            par[0]       = new SqlParameter("@id_order", SqlDbType.Int);
            par[0].Value = id;
            Dt           = dal.Read_Data("GET_Details_Order_return", par);

            return(Dt);
        }
Ejemplo n.º 11
0
        public DataTable Return_Quantity(string ID, int quant, int order_id)
        {
            DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();
            DataTable             Dt  = new DataTable();

            SqlParameter[] par = new SqlParameter[3];
            par[0]       = new SqlParameter("@product_id", SqlDbType.NChar, 10);
            par[0].Value = ID;
            par[1]       = new SqlParameter("@quantity", SqlDbType.Int);
            par[1].Value = quant;
            par[2]       = new SqlParameter("@id_order", SqlDbType.Int);
            par[2].Value = order_id;
            Dt           = dal.Read_Data("return_product", par);

            return(Dt);
        }
        public bool Find_ID(string ID)
        {
            DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();
            DataTable             Dt  = new DataTable();

            SqlParameter[] par = new SqlParameter [1];
            par[0]       = new SqlParameter("@ID", SqlDbType.VarChar, 50);
            par[0].Value = ID;
            Dt           = dal.Read_Data("Find_ID", par);

            if (Dt.Rows.Count > 0)
            {
                return(false);
            }

            return(true);
        }
Ejemplo n.º 13
0
        //Method to check authentication
        public DataTable authentication_login(string UserName, string password)
        {
            DAL.Data_Access_Layer dal  = new DAL.Data_Access_Layer();
            SqlParameter []       para = new SqlParameter [2];
            para[0]       = new SqlParameter("@ID", SqlDbType.NVarChar, 50);
            para[0].Value = UserName;

            para[1]       = new SqlParameter("@Password", SqlDbType.NVarChar, 50);
            para[1].Value = password;



            DataTable Dt = new DataTable();

            Dt = dal.Read_Data("Loging_info", para);
            dal.Close_Connection();
            return(Dt);
        }
Ejemplo n.º 14
0
        public bool Check_Quantity(string ID, int quant)
        {
            DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();
            DataTable             Dt  = new DataTable();

            SqlParameter[] par = new SqlParameter[2];
            par[0]       = new SqlParameter("@id_prod", SqlDbType.NChar, 10);
            par[0].Value = ID;
            par[1]       = new SqlParameter("@quant", SqlDbType.Int);
            par[1].Value = quant;
            Dt           = dal.Read_Data("check_quantity", par);

            if (Dt.Rows.Count > 0)
            {
                return(true);
            }

            return(false);
        }