コード例 #1
0
 public void Delete_user(string id)
 {
     DAL.DataAccessLayer Dal = new DAL.DataAccessLayer();
     Dal.Open();
     SqlParameter[] param = new SqlParameter[1];
     param[0]       = new SqlParameter("@user_id", SqlDbType.VarChar, 50);
     param[0].Value = id;
     Dal.ExecuteDml("Delete_user", param);
     Dal.Close();
 }
コード例 #2
0
 public void DeleteCAR(int ID)
 {
     DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
     DAL.Open();
     SqlParameter[] param = new SqlParameter[1];
     param[0]       = new SqlParameter("@ID", SqlDbType.VarChar, 50);
     param[0].Value = ID;
     DAL.ExecuteDml("DeleteCAR", param);
     DAL.Close();
 }
コード例 #3
0
        public void Del_Customer(int cus_id)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.Open();
            SqlParameter[] param = new SqlParameter[1];
            param[0]       = new SqlParameter("@cus_id", SqlDbType.Int);
            param[0].Value = cus_id;

            DAL.ExecuteDml("Del_Customer", param);
            DAL.Close();
        }
コード例 #4
0
        public void ADD_CATEGORY(string cat_name, int deal_id)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.Open();
            SqlParameter[] param = new SqlParameter[2];

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

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

            DAL.ExecuteDml("ADD_CATEGORY", param);
            DAL.Close();
        }
コード例 #5
0
 public void Edit_user(string id, string pass, string usertype, string userfullname)
 {
     DAL.DataAccessLayer Dal = new DAL.DataAccessLayer();
     Dal.Open();
     SqlParameter[] param = new SqlParameter[4];
     param[0]       = new SqlParameter("@user_id", SqlDbType.VarChar, 50);
     param[0].Value = id;
     param[1]       = new SqlParameter("@user_password ", SqlDbType.VarChar, 50);
     param[1].Value = pass;
     param[2]       = new SqlParameter("@user_type ", SqlDbType.VarChar, 20);
     param[2].Value = usertype;
     param[3]       = new SqlParameter("@user_fullname", SqlDbType.VarChar, 50);
     param[3].Value = userfullname;
     Dal.ExecuteDml("Edit_user", param);
     Dal.Close();
 }
コード例 #6
0
 public void Add_Order(DateTime order_date, int cus_id, string order_descrip, string salesman)
 {
     DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
     DAL.Open();
     SqlParameter[] param = new SqlParameter[4];
     param[0]       = new SqlParameter("@order_date", SqlDbType.DateTime);
     param[0].Value = order_date;
     param[1]       = new SqlParameter("@cus_id", SqlDbType.Int);
     param[1].Value = cus_id;
     param[2]       = new SqlParameter("@order_desciption", SqlDbType.VarChar, 200);
     param[2].Value = order_descrip;
     param[3]       = new SqlParameter("@salesman", SqlDbType.VarChar, 75);
     param[3].Value = salesman;
     DAL.ExecuteDml("Add_Order", param);
     DAL.Close();
 }
コード例 #7
0
 public void update_car(string car_name, int car_price, byte[] car_image, int car_quantity, int cat_id)
 {
     DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
     DAL.Open();
     SqlParameter[] param = new SqlParameter[5];
     param[0]       = new SqlParameter("@car_name", SqlDbType.VarChar, 30);
     param[0].Value = car_name;
     param[1]       = new SqlParameter("@car_price", SqlDbType.Int);
     param[1].Value = car_price;
     param[2]       = new SqlParameter("@car_image", SqlDbType.Image);
     param[2].Value = car_image;
     param[3]       = new SqlParameter("@car_quantity", SqlDbType.Int);
     param[3].Value = car_quantity;
     param[4]       = new SqlParameter("@cat_id", SqlDbType.Int);
     param[4].Value = cat_id;
     DAL.ExecuteDml("update_car", param);
     DAL.Close();
 }
コード例 #8
0
        public void Add_Customer(string cus_name, string cus_phone, string cus_address)
        {
            DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
            DAL.Open();
            SqlParameter[] param = new SqlParameter[3];
            param[0]       = new SqlParameter("@cus_name", SqlDbType.VarChar, 50);
            param[0].Value = cus_name;

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

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


            DAL.ExecuteDml("Add_Customer", param);

            DAL.Close();
        }
コード例 #9
0
 public void Add_Order_details(int car_id, int order_id, int quantity, int price, float discount, string amount, string totamount)
 {
     DAL.DataAccessLayer DAL = new DAL.DataAccessLayer();
     DAL.Open();
     SqlParameter[] param = new SqlParameter[7];
     param[0]       = new SqlParameter("@car_id", SqlDbType.Int);
     param[0].Value = car_id;
     param[1]       = new SqlParameter("@order_id", SqlDbType.Int);
     param[1].Value = order_id;
     param[2]       = new SqlParameter("@quantity", SqlDbType.Int);
     param[2].Value = quantity;
     param[3]       = new SqlParameter("@price", SqlDbType.Int);
     param[3].Value = price;
     param[4]       = new SqlParameter("@discount", SqlDbType.Float);
     param[4].Value = discount;
     param[5]       = new SqlParameter("@amount", SqlDbType.NVarChar, 50);
     param[5].Value = amount;
     param[6]       = new SqlParameter("@total_amount", SqlDbType.NVarChar, 50);
     param[6].Value = totamount;
     DAL.ExecuteDml("Add_Order_details", param);
     DAL.Close();
 }