Example #1
0
        public void ADD_PRODUCTS(int ID_cat, string Label_Product, string ID_product,
                                 int Qte, string Price, byte[] img)
        {
            Data_Access_Layer.Data_Access_Layer DAL = new Data_Access_Layer.Data_Access_Layer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[6];
            param[0]       = new SqlParameter("@ID_CAT", SqlDbType.Int);
            param[0].Value = ID_cat;

            param[1]       = new SqlParameter("@ID_PRODUCT", SqlDbType.VarChar, 30);
            param[1].Value = ID_product;

            param[2]       = new SqlParameter("@LABEL", SqlDbType.NVarChar);
            param[2].Value = Label_Product;

            param[3]       = new SqlParameter("@Qte", SqlDbType.Int);
            param[3].Value = Qte;

            param[4]       = new SqlParameter("@PRICE", SqlDbType.VarChar, 50);
            param[4].Value = Price;

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


            DAL.ExcecuteCommand("ADD_PRODUCT", param);
            DAL.close();
        }
Example #2
0
        public void ADD_ORDER_DETAILS(
            string ID_PRODUCT, int ID_ORDER, int QTE, string PRICE,
            float DISCOUNT, string AMOUNT, string TOTAL_AMOUNT
            )
        {
            Data_Access_Layer.Data_Access_Layer DAL = new Data_Access_Layer.Data_Access_Layer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[7];
            param[0]       = new SqlParameter("@ID_PRODUCT", SqlDbType.VarChar, 30);
            param[0].Value = ID_PRODUCT;

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

            param[2]       = new SqlParameter("@QTE", SqlDbType.Int);
            param[2].Value = QTE;

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

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

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

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


            DAL.ExcecuteCommand("ADD_ORDER_DETAILS", param);
            DAL.close();
        }
        public void EDIT_CUSTOMERS(string FIRST_NAME, string LAST_NAME,
                                   string TEL, string EMAIL, byte[] PICUTRE, string Criterion, int id)
        {
            Data_Access_Layer.Data_Access_Layer DAL = new Data_Access_Layer.Data_Access_Layer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[7];
            param[0]       = new SqlParameter("@FIRST_NAME", SqlDbType.NVarChar, 25);
            param[0].Value = FIRST_NAME;

            param[1]       = new SqlParameter("@LAST_NAME", SqlDbType.NVarChar, 25);
            param[1].Value = LAST_NAME;

            param[2]       = new SqlParameter("@TEL", SqlDbType.NChar, 15);
            param[2].Value = TEL;

            param[3]       = new SqlParameter("@EMAIL", SqlDbType.VarChar, 25);
            param[3].Value = EMAIL;

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

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

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


            DAL.ExcecuteCommand("EDIT_CUSTOMERS", param);
            DAL.close();
        }
Example #4
0
        public void ADD_ORDER(
            int ID_ORDER, DateTime DATE_ORDER,
            int CUSTOMER_ID, string DESCRIPTION_ORDER, string SALESMAN)
        {
            Data_Access_Layer.Data_Access_Layer DAL = new Data_Access_Layer.Data_Access_Layer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[5];
            param[0]       = new SqlParameter("@ID_ORDER", SqlDbType.Int);
            param[0].Value = ID_ORDER;

            param[1]       = new SqlParameter("@DATE_ORDER", SqlDbType.DateTime);
            param[1].Value = DATE_ORDER;

            param[2]       = new SqlParameter("@CUSTOMER_ID", SqlDbType.Int);
            param[2].Value = CUSTOMER_ID;

            param[3]       = new SqlParameter("@DESCRIPTION_ORDER", SqlDbType.NVarChar, 250);
            param[3].Value = DESCRIPTION_ORDER;

            param[4]       = new SqlParameter("@SALESMAN", SqlDbType.NVarChar, 75);
            param[4].Value = SALESMAN;


            DAL.ExcecuteCommand("ADD_ORDER", param);
            DAL.close();
        }
Example #5
0
        public DataTable GET_ALL_PRODUCTS()
        {
            Data_Access_Layer.Data_Access_Layer DAL = new Data_Access_Layer.Data_Access_Layer();
            DataTable Dt = new DataTable();

            Dt = DAL.SelectData("GET_ALL_PRODUCTS", null);
            DAL.close();
            return(Dt);
        }
Example #6
0
        public DataTable GET_LAST_ORDER_ID()
        {
            Data_Access_Layer.Data_Access_Layer DAL = new Data_Access_Layer.Data_Access_Layer();
            DataTable Dt = new DataTable();

            Dt = DAL.SelectData("GET_LAST_ORDER_ID", null);
            DAL.close();
            return(Dt);
        }
Example #7
0
        public void DELETE_PRODUCT(string ID)
        {
            Data_Access_Layer.Data_Access_Layer DAL = new Data_Access_Layer.Data_Access_Layer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[1];
            param[0]       = new SqlParameter("@ID", SqlDbType.NVarChar, 50);
            param[0].Value = ID;

            DAL.ExcecuteCommand("DELETE_PRODUCT", param);
            DAL.close();
        }
Example #8
0
        public DataTable SEARCH_PRODUCT(string id)
        {
            Data_Access_Layer.Data_Access_Layer DAL = new Data_Access_Layer.Data_Access_Layer();
            DataTable Dt = new DataTable();

            SqlParameter[] param = new SqlParameter[1];
            param[0]       = new SqlParameter("@ID", SqlDbType.NVarChar, 50);
            param[0].Value = id;
            Dt             = DAL.SelectData("SEARCH_PRODUCTS", param);
            DAL.close();
            return(Dt);
        }
        public DataTable SEARCH_CUSTOMER(string Criterion)
        {
            Data_Access_Layer.Data_Access_Layer DAL = new Data_Access_Layer.Data_Access_Layer();
            DataTable Dt = new DataTable();

            SqlParameter[] param = new SqlParameter[1];
            param[0]       = new SqlParameter("@Criterion", SqlDbType.NVarChar, 50);
            param[0].Value = Criterion;
            Dt             = DAL.SelectData("SEARCH_CUSTOMER", param);
            DAL.close();
            return(Dt);
        }
        public void DELETE_CUSTOMERS(int id)
        {
            Data_Access_Layer.Data_Access_Layer DAL = new Data_Access_Layer.Data_Access_Layer();
            DAL.open();
            SqlParameter[] param = new SqlParameter[1];

            param[0]       = new SqlParameter("@ID", SqlDbType.Int);
            param[0].Value = id;


            DAL.ExcecuteCommand("DELETE_CUSTOMER", param);
            DAL.close();
        }
        public DataTable DELETE_USER(string ID)
        {
            Data_Access_Layer.Data_Access_Layer DAL = new Data_Access_Layer.Data_Access_Layer();
            SqlParameter[] param = new SqlParameter[1];
            param[0]       = new SqlParameter("@ID", SqlDbType.NVarChar, 50);
            param[0].Value = ID;

            DataTable Dt = new DataTable();

            Dt = DAL.SelectData("DELETE_USER", param);
            DAL.close();
            return(Dt);
        }
        public DataTable LOGIN(string ID, string PWD)
        {
            Data_Access_Layer.Data_Access_Layer DAL = new Data_Access_Layer.Data_Access_Layer();
            SqlParameter[] param = new SqlParameter[2];
            param[0]       = new SqlParameter("@ID", SqlDbType.VarChar, 50);
            param[0].Value = ID;
            param[1]       = new SqlParameter("@PWD", SqlDbType.VarChar, 50);
            param[1].Value = PWD;
            DataTable Dt = new DataTable();

            Dt = DAL.SelectData("SP_LOGIN", param);
            DAL.close();
            return(Dt);
        }
Example #13
0
        public DataTable GET_ORDER_DETAILS(int id)
        {
            Data_Access_Layer.Data_Access_Layer DAL = new Data_Access_Layer.Data_Access_Layer();
            DataTable Dt = new DataTable();

            SqlParameter[] param = new SqlParameter[1];

            param[0]       = new SqlParameter("@ID_ORDER", SqlDbType.VarChar, 30);
            param[0].Value = id;

            Dt = DAL.SelectData("GET_ORDER_DETAILS", param);
            DAL.close();
            return(Dt);
        }
Example #14
0
        public DataTable VERIFY_QTE(string id, int qty)
        {
            Data_Access_Layer.Data_Access_Layer DAL = new Data_Access_Layer.Data_Access_Layer();
            DataTable Dt = new DataTable();

            SqlParameter[] param = new SqlParameter[2];

            param[0]       = new SqlParameter("@ID_PRODUCT", SqlDbType.VarChar, 30);
            param[0].Value = id;

            param[1]       = new SqlParameter("@Qty_ENTERED", SqlDbType.Int);
            param[1].Value = qty;
            Dt             = DAL.SelectData("VERIFY_QTE", param);
            DAL.close();
            return(Dt);
        }
        public DataTable EDIT_USER(string ID, string PWD, string fullname, string type)
        {
            Data_Access_Layer.Data_Access_Layer DAL = new Data_Access_Layer.Data_Access_Layer();
            SqlParameter[] param = new SqlParameter[4];
            param[0]       = new SqlParameter("@ID", SqlDbType.NVarChar, 50);
            param[0].Value = ID;

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

            param[2]       = new SqlParameter("@UserType", SqlDbType.NVarChar, 50);
            param[2].Value = type;

            param[3]       = new SqlParameter("@FullName", SqlDbType.NVarChar, 100);
            param[3].Value = fullname;
            DataTable Dt = new DataTable();

            Dt = DAL.SelectData("EDIT_USER", param);
            DAL.close();
            return(Dt);
        }