Esempio n. 1
0
        public bool addToDataTable(NewItemArgs e)
        {
            DataRow row = dataTable.NewRow();

            row["商品名"]  = e.name;
            row["单价"]   = e.price;
            row["条形码"]  = e.code;
            row["允许打折"] = e.isDiscount;
            row["允许销售"] = e.isSaled;
            row["数量"]   = e.quantity;
            if (e.pro_price != -1)
            {
                row["促销起时间"] = e.start_time;
                row["促销止时间"] = e.end_time;
                row["促销价格"]  = e.pro_price;
            }
            if (e.quan_planned != -1)
            {
                row["计划进货数量"] = e.quan_planned;
            }
            if (e.quan_warning != -1)
            {
                row["库存警告数量"] = e.quan_warning;
            }
            //找到供应商ID
            DataTable tb_supplier = dataset.Tables["supplier"];

            DataRow[] rows = tb_supplier.Select("supplier_name = '" + e.supplier_name + "'");
            if (rows.Count() == 1)
            {
                row["供应商ID"] = rows[0]["supplier_id"];
            }
            dataTable.Rows.Add(row);
            return(false);
        }
        public bool addToDataTable(NewItemArgs e)
        {
            DataRow row = dataTable.NewRow();

            row["供应商名称"] = e.name;
            row["供应商地址"] = e.addr;
            row["供应商电话"] = e.phone;
            dataTable.Rows.Add(row);
            return true;
        }
Esempio n. 3
0
        public bool addToDataTable(NewItemArgs e)
        {
            DataRow row = dataTable.NewRow();

            row["供应商名称"] = e.name;
            row["供应商地址"] = e.addr;
            row["供应商电话"] = e.phone;
            dataTable.Rows.Add(row);
            return(true);
        }
Esempio n. 4
0
        private void bt_add_Click(object sender, EventArgs e)
        {
            NewItemArgs args = new NewItemArgs(tb_supplier_name.Text, tb_supplier_addr.Text, tb_supplier_phone.Text);

            manager.addToDataTable(args);
        }
Esempio n. 5
0
        public bool addToDataTable(NewItemArgs e)
        {
            DataRow row = dataTable.NewRow();

            row["商品名"] = e.name;
            row["单价"] = e.price;
            row["条形码"] = e.code;
            row["允许打折"] = e.isDiscount;
            row["允许销售"] = e.isSaled;
            row["数量"] = e.quantity;
            if (e.pro_price!=-1)
            {
                row["促销起时间"] = e.start_time;
                row["促销止时间"] = e.end_time;
                row["促销价格"] = e.pro_price;
            }
            if (e.quan_planned!=-1)
            {
                row["计划进货数量"] = e.quan_planned;
            }
            if (e.quan_warning != -1)
            {
                row["库存警告数量"] = e.quan_warning;
            }
            //找到供应商ID
            DataTable tb_supplier = dataset.Tables["supplier"];
            DataRow[] rows = tb_supplier.Select("supplier_name = '" + e.supplier_name + "'");
            if(rows.Count() == 1)
            {
                row["供应商ID"] = rows[0]["supplier_id"];
            }
            dataTable.Rows.Add(row);
            return false;
        }
Esempio n. 6
0
 private void bt_add_Click(object sender, EventArgs e)
 {
     NewItemArgs args = new NewItemArgs(tb_supplier_name.Text, tb_supplier_addr.Text, tb_supplier_phone.Text);
     manager.addToDataTable(args);
 }