コード例 #1
0
        public void Add_Product(int pID, string pName, string price, int Stock, byte[] pImage, int cat_id, string checker)
        {
            dal.opendb();
            SqlParameter[] param = new SqlParameter[7];
            param[0]       = new SqlParameter("@pID", SqlDbType.Int);
            param[0].Value = pID;

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

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

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

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

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

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


            dal.execmd("Add_Product", param);
            dal.closedb();
        }
コード例 #2
0
        public void Add_Customer(string fName, string lName, string phone, string E_Mail, byte[] cImage, string checker)
        {
            dal.opendb();
            SqlParameter[] param = new SqlParameter[6];
            param[0]       = new SqlParameter("@fName", SqlDbType.VarChar, 50);
            param[0].Value = fName;

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

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

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

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

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

            dal.execmd("Add_Customer", param);
            dal.closedb();
        }
コード例 #3
0
        public void Add_Order(DateTime Date, string Description, string Salesman, int cID)
        {
            dal.opendb();
            SqlParameter[] param = new SqlParameter[4];
            param[0]       = new SqlParameter("@Date", SqlDbType.DateTime);
            param[0].Value = Date;

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

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

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

            dal.execmd("Add_Order", param);
            dal.closedb();
        }
コード例 #4
0
        public void Add_User(string uid, string pwd, string usertpye, string username)
        {
            DAL.opendb();

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

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

            param[2]       = new SqlParameter("@usertype", SqlDbType.VarChar, 50);
            param[2].Value = usertpye;

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

            DAL.execmd("Add_User", param);
            DAL.opendb();
        }