Update() public method

public Update ( ) : void
return void
示例#1
0
        public void InsertBook()
        {
            Function iFt = new Function();
            string   sql = "INSERT book SET book_id = '" + book_id + "' ,book_type = '" + book_type + "', book_name = '" + book_name + "', author = '" + author + "',book_price = '" + book_price + "', publisher = '" + publisher + "', amount = '" + amount + "'";

            iFt.Update(sql);
        }
示例#2
0
        public void AddSelline()
        {
            Function iFt = new Function();

            string sql = "INSERT INTO sellline SET sale_id = '" + sale_id + "', book_id = '" + book_id + "', amount = '" + amount + "'";

            iFt.Update(sql);
            UpdateStock();
        }
示例#3
0
        public void Insert(string purchase_id)
        {
            Function iFt = new Function();

            string sql = string.Format("INSERT INTO purchaseline " +
                                       "VALUES ('{0}', '{1}', '{2}', '{3}', '{4}')"
                                       , purchase_id, book_id, amount, 0, price * amount);

            iFt.Update(sql);
        }
示例#4
0
        public void Insert()
        {
            // Insert this item and item.line into database

            Function iFt = new Function();

            string sql = "";

            sql = string.Format("INSERT INTO purchaseorder " +
                                "VALUES ('{0}', '{1}', NOW()) "
                                , purchase_id, employee_id);

            iFt.Update(sql);
            purchase_item.ForEach(item => item.Insert(purchase_id));
        }
示例#5
0
        public void UpdateStock()
        {
            Function  iFt    = new Function();
            string    sql1   = "SELECT amount FROM book WHERE book_id = '" + book_id + "'";
            DataTable Dtable = iFt.Select(sql1);

            string temp = "";

            foreach (DataRow row in Dtable.Rows)
            {
                temp = row[0].ToString();
            }

            string sql = "UPDATE book SET amount = '" + (Int32.Parse(temp) - amount).ToString() + "' WHERE book_id = '" + book_id + "'";

            iFt.Update(sql);
        }
示例#6
0
        public void AddSell(DataGridViewRowCollection data_rows)
        {
            Function iFt = new Function();

            string sql = "INSERT INTO sell SET sale_id =  '" + sale_id + "', employee_id = '" + employee_id + "', sale_date = '" + date + "'";

            //string sql = String.Format("INSERT INTO sell SET sale_id = '{0}', employee_id = '{1}', sale_date = '{2}'", sale_id, employee_id, date);

            iFt.Update(sql);

            foreach (DataGridViewRow dr in data_rows)
            {
                sale_item         = new Sellline();
                sale_item.sale_id = sale_id;
                sale_item.book_id = dr.Cells["ID"].Value.ToString();
                sale_item.amount  = Int32.Parse(dr.Cells["qty"].Value.ToString());
                sale_item.AddSelline();
            }
        }