Ejemplo n.º 1
0
        public void Edit_Customer(string FIRST_NAME, string LAST_NAME, string TEL, string EMAIL, byte[] IMAGE_CUSTOMER, string Criterion, int ID)
        {
            DAL.DataAcessLayer dll = new DAL.DataAcessLayer();
            dll.open();
            SqlParameter[] sqlparam = new SqlParameter[7];
            sqlparam[0]       = new SqlParameter("@FIRST_NAME", SqlDbType.VarChar, 25);
            sqlparam[0].Value = FIRST_NAME;
            sqlparam[1]       = new SqlParameter("@LAST_NAME", SqlDbType.VarChar, 25);
            sqlparam[1].Value = LAST_NAME;
            sqlparam[2]       = new SqlParameter("@TEL", SqlDbType.NVarChar, 15);
            sqlparam[2].Value = TEL;
            sqlparam[3]       = new SqlParameter("@EMAIL", SqlDbType.VarChar, 25);
            sqlparam[3].Value = EMAIL;
            sqlparam[4]       = new SqlParameter("@IMAGE_CUSTOMER", SqlDbType.Image);
            sqlparam[4].Value = IMAGE_CUSTOMER;

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

            sqlparam[6]       = new SqlParameter("@ID", SqlDbType.Int);
            sqlparam[6].Value = ID;

            dll.ExecuteCommand("SP_Edit_CUSTOM", sqlparam);
            dll.close();
        }
Ejemplo n.º 2
0
 //THIS code for delete any item in product
 public void DELETE_PRODUCT(string ID)
 {
     DAL.DataAcessLayer dl = new DAL.DataAcessLayer();
     dl.open();
     SqlParameter[] sqlparam = new SqlParameter[1];
     sqlparam[0]       = new SqlParameter("@ID", SqlDbType.VarChar, 50);
     sqlparam[0].Value = ID;
     dl.ExecuteCommand("SP_DELETE_PRODUCT", sqlparam);
     dl.close();
 }
Ejemplo n.º 3
0
 public void Delete_Customer(int id)
 {
     DAL.DataAcessLayer dll = new DAL.DataAcessLayer();
     dll.open();
     SqlParameter[] param = new SqlParameter[1];
     param[0]       = new SqlParameter("@id", SqlDbType.Int);
     param[0].Value = id;
     dll.ExecuteCommand("SP_DELETE_CUSTOMER", param);
     dll.close();
 }
Ejemplo n.º 4
0
        public void EDIT_User(string ID, string fULLNAME, string PWD, string USERTYPE)
        {
            DAL.DataAcessLayer dll = new DAL.DataAcessLayer();
            dll.open();
            SqlParameter[] sqlparam = new SqlParameter[4];
            sqlparam[0]       = new SqlParameter("@ID", SqlDbType.VarChar, 50);
            sqlparam[0].Value = ID;
            sqlparam[1]       = new SqlParameter("@fULLNAME", SqlDbType.VarChar, 50);
            sqlparam[1].Value = fULLNAME;
            sqlparam[2]       = new SqlParameter("@PWD", SqlDbType.VarChar, 50);
            sqlparam[2].Value = PWD;
            sqlparam[3]       = new SqlParameter("@USERTYPE", SqlDbType.VarChar, 50);
            sqlparam[3].Value = USERTYPE;

            dll.ExecuteCommand("SP_EDIT_USERS", sqlparam);
            dll.close();
        }
Ejemplo n.º 5
0
        public void ADD_Orders(int ID_ORDER, DateTime DATE_ORDER, int CUSTOMER_ID, string DESCRIPTION_ORDER, string SALESMAN)
        {
            DAL.DataAcessLayer dll = new DAL.DataAcessLayer();
            dll.open();
            SqlParameter[] sqlparam = new SqlParameter[5];
            sqlparam[0]       = new SqlParameter("@ID_ORDER", SqlDbType.Int);
            sqlparam[0].Value = ID_ORDER;
            sqlparam[1]       = new SqlParameter("@DATE_ORDER", SqlDbType.DateTime);
            sqlparam[1].Value = DATE_ORDER;
            sqlparam[2]       = new SqlParameter("@CUSTOMER_ID", SqlDbType.Int);
            sqlparam[2].Value = CUSTOMER_ID;
            sqlparam[3]       = new SqlParameter("@DESCRIPTION_ORDER", SqlDbType.VarChar, 75);
            sqlparam[3].Value = DESCRIPTION_ORDER;
            sqlparam[4]       = new SqlParameter("@SALESMAN", SqlDbType.VarChar, 75);
            sqlparam[4].Value = SALESMAN;

            dll.ExecuteCommand("SP_ADD_ORDER", sqlparam);
            dll.close();
        }
Ejemplo n.º 6
0
 // to inisialize to add product data
 public void ADD_PRODUCT(int ID_CAT, string ID_PRODUCT, int QTE, string LABEL_Product, int PRICE, byte[] IMG)
 {
     DAL.DataAcessLayer DAL = new DAL.DataAcessLayer();
     DAL.open();
     SqlParameter[] sqlparam = new SqlParameter[6];
     sqlparam[0]       = new SqlParameter("@ID_CAT", SqlDbType.Int);
     sqlparam[0].Value = ID_CAT;
     sqlparam[1]       = new SqlParameter("@ID_PRODUCT", SqlDbType.VarChar, 30);
     sqlparam[1].Value = ID_PRODUCT;
     sqlparam[2]       = new SqlParameter("@QTE", SqlDbType.Int);
     sqlparam[2].Value = QTE;
     sqlparam[3]       = new SqlParameter("@LABEL", SqlDbType.VarChar, 30);
     sqlparam[3].Value = LABEL_Product;
     sqlparam[4]       = new SqlParameter("@PRICE", SqlDbType.VarChar, 50);
     sqlparam[4].Value = PRICE;
     sqlparam[5]       = new SqlParameter("@IMG", SqlDbType.Image);
     sqlparam[5].Value = IMG;
     DAL.ExecuteCommand("SP_ADD_PRODUCT", sqlparam);
     DAL.close();
 }
Ejemplo n.º 7
0
        public void ADD_Order_Details(string ID_PRODUCT, int ID_ORDER, int QTE, string PRICE, float DISCOUNT, string AMOUNT, string TOTAL_AMOUNT)
        {
            DAL.DataAcessLayer dll = new DAL.DataAcessLayer();
            dll.open();
            SqlParameter[] sqlparam = new SqlParameter[7];
            sqlparam[0]       = new SqlParameter("@ID_PRODUCT", SqlDbType.VarChar, 30);
            sqlparam[0].Value = ID_PRODUCT;
            sqlparam[1]       = new SqlParameter("@ID_ORDER", SqlDbType.Int);
            sqlparam[1].Value = ID_ORDER;
            sqlparam[2]       = new SqlParameter("@QTE", SqlDbType.Int);
            sqlparam[2].Value = QTE;
            sqlparam[3]       = new SqlParameter("@PRICE", SqlDbType.VarChar, 50);
            sqlparam[3].Value = PRICE;
            sqlparam[4]       = new SqlParameter("@DISCOUNT", SqlDbType.Float);
            sqlparam[4].Value = DISCOUNT;
            sqlparam[5]       = new SqlParameter("@AMOUNT", SqlDbType.VarChar, 50);
            sqlparam[5].Value = AMOUNT;
            sqlparam[6]       = new SqlParameter("@TOTAL_AMOUNT", SqlDbType.VarChar, 50);
            sqlparam[6].Value = TOTAL_AMOUNT;

            dll.ExecuteCommand("SP_ADD_ORDER_DETAILS", sqlparam);
            dll.close();
        }