public void update_products(string prod_id, string name_prod, int quant, string price, int id_cat, byte[] img)
        {
            DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();
            dal.open_Connection();
            BL.Product prd = new BL.Product();

            SqlParameter[] paramter = new SqlParameter[6];
            paramter[0]       = new SqlParameter("@ID", SqlDbType.NChar, 50);
            paramter[0].Value = prod_id;
            paramter[1]       = new SqlParameter("@Name_prod", SqlDbType.NVarChar, 50);
            paramter[1].Value = name_prod;
            paramter[2]       = new SqlParameter("@quantity", SqlDbType.NChar, 10);
            paramter[2].Value = quant;
            paramter[3]       = new SqlParameter("@image", SqlDbType.Image);
            paramter[3].Value = img;
            paramter[4]       = new SqlParameter("@ID_Cat", SqlDbType.Int);
            paramter[4].Value = id_cat;;
            paramter[5]       = new SqlParameter("@price", SqlDbType.VarChar, 50);
            paramter[5].Value = price;



            dal.ExecuteCommand("update_product", paramter);
            dal.Close_Connection();
        }
Esempio n. 2
0
        public void Add_Order(int order_id, DateTime order_date, int cust_id, string descrip, string sales_man, int Delivery_man, string total)
        {
            DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();
            dal.open_Connection();
            BL.Product prd = new BL.Product();

            SqlParameter[] paramter = new SqlParameter[7];
            paramter[0]       = new SqlParameter("@ID_order", SqlDbType.Int);
            paramter[0].Value = order_id;
            paramter[1]       = new SqlParameter("@order_date", SqlDbType.Date);
            paramter[1].Value = order_date;
            paramter[2]       = new SqlParameter("@Customer_id", SqlDbType.Int);
            paramter[2].Value = cust_id;
            paramter[3]       = new SqlParameter("@Description_order", SqlDbType.VarChar, 250);
            paramter[3].Value = descrip;
            paramter[4]       = new SqlParameter("@sales_man", SqlDbType.VarChar, 50);
            paramter[4].Value = sales_man;
            paramter[5]       = new SqlParameter("@Delivery_man", SqlDbType.Int);
            paramter[5].Value = Delivery_man;
            paramter[6]       = new SqlParameter("@total", SqlDbType.VarChar, 50);
            paramter[6].Value = total;

            dal.ExecuteCommand("Add_product", paramter);
            dal.Close_Connection();
        }
        //====================================================
        //member functions
        public void  New_Cust()
        {
            DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();
            dal.open_Connection();

            SqlParameter[] param = new SqlParameter[7];

            param[0]       = new SqlParameter("@first", SqlDbType.VarChar, 50);
            param[0].Value = first;

            param[1]       = new SqlParameter("@last", SqlDbType.VarChar, 50);
            param[1].Value = last;

            param[2]       = new SqlParameter("@tele", SqlDbType.NChar, 20);
            param[2].Value = phone;

            param[3]       = new SqlParameter("@email", SqlDbType.VarChar, 50);
            param[3].Value = emai;

            param[4]       = new SqlParameter("@img", SqlDbType.Image);
            param[4].Value = img;

            param[5]       = new SqlParameter("@state", SqlDbType.VarChar, 50);
            param[5].Value = stat;

            param[6]       = new SqlParameter("@Pay", SqlDbType.VarChar, 50);
            param[6].Value = pment;

            dal.ExecuteCommand("new_customer", param);

            dal.Close_Connection();
        }
 public void delete_Cust()
 {
     DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();
     dal.open_Connection();
     SqlParameter[] par = new SqlParameter[1];
     par[0]       = new SqlParameter("@ID", SqlDbType.Int);
     par[0].Value = id;
     dal.ExecuteCommand("delete_customer", par);
     dal.Close_Connection();
 }
Esempio n. 5
0
        public void  Delete_Bell(int id_order)
        {
            DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();

            dal.open_Connection();

            SqlParameter[] par = new SqlParameter[1];
            par[0]       = new SqlParameter("@id_order", SqlDbType.Int);
            par[0].Value = id_order;
            dal.ExecuteCommand("delete_bell", par);
            dal.Close_Connection();
        }
Esempio n. 6
0
        public void Delete_User()
        {
            DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();
            dal.open_Connection();
            BL.Product prd = new BL.Product();

            SqlParameter[] paramter = new SqlParameter[1];
            paramter[0]       = new SqlParameter("@user_id", SqlDbType.NVarChar, 50);
            paramter[0].Value = user;


            dal.ExecuteCommand("delete_User", paramter);
            dal.Close_Connection();
        }
Esempio n. 7
0
        //==========================================================
        // member functions

        public void Add_User()
        {
            DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();
            dal.open_Connection();
            BL.Product prd = new BL.Product();

            SqlParameter[] paramter = new SqlParameter[4];
            paramter[0]       = new SqlParameter("@user_id", SqlDbType.NVarChar, 50);
            paramter[0].Value = user;
            paramter[1]       = new SqlParameter("@password", SqlDbType.NVarChar, 50);
            paramter[1].Value = password;
            paramter[2]       = new SqlParameter("@state", SqlDbType.NChar, 10);
            paramter[2].Value = state;
            paramter[3]       = new SqlParameter("@Fullname", SqlDbType.VarChar, 50);
            paramter[3].Value = fullname;

            dal.ExecuteCommand("ADD_USER", paramter);
            dal.Close_Connection();
        }
Esempio n. 8
0
        public void Add_products_order(string id_prod, int order_ID, string quantiy, string price, double discount, string amount)
        {
            DAL.Data_Access_Layer dal = new DAL.Data_Access_Layer();
            dal.open_Connection();
            BL.Product prd = new BL.Product();

            SqlParameter[] paramter = new SqlParameter[6];
            paramter[0]       = new SqlParameter("@ID_PROD", SqlDbType.NChar, 10);
            paramter[0].Value = id_prod;
            paramter[1]       = new SqlParameter("@ID_ORDER", SqlDbType.Int);
            paramter[1].Value = order_ID;
            paramter[2]       = new SqlParameter("@quantity", SqlDbType.NChar, 10);
            paramter[2].Value = quantiy;
            paramter[3]       = new SqlParameter("@Price", SqlDbType.VarChar, 50);
            paramter[3].Value = price;
            paramter[4]       = new SqlParameter("@discount", SqlDbType.Float);
            paramter[4].Value = discount;
            paramter[5]       = new SqlParameter("@Amount", SqlDbType.VarChar, 50);
            paramter[5].Value = amount;


            dal.ExecuteCommand("Add_Order_products", paramter);
            dal.Close_Connection();
        }