Beispiel #1
0
        public static void ChangeNum(MODEL.InStockdetail instockdetail)
        {
            string sql = "select distinct GoodsID from stockgoods_table where GoodsID='"
                         + instockdetail.GoodID + "'";
            DataSet a = Datameans.getDataSet(sql);

            if (a.Tables[0].Rows.Count == 0)
            {
                string sql1 = "insert into stockgoods_table(GoodsID,Storename,GoodNum) values('"
                              + instockdetail.GoodID
                              + "','"
                              + instockdetail.Inventory
                              + "','"
                              + instockdetail.Amount + "')";
                Datameans.getsqlcom(sql1);
            }
            //如果表中有ID,根据入库单商品ID在库存表里增加相应数量Amount
            else
            {
                string sql2 = "update stockgoods_table set GoodNum = GoodNum + '" + instockdetail.Amount + "' where GoodsID='"
                              + instockdetail.GoodID + "'";
                Datameans.getsqlcom(sql2);
            }
            //如果表中没有该商品ID插入以下信息


            //Datameans.getsqlcom(sql1);
        }
Beispiel #2
0
        public static void InputDetail(MODEL.InStockdetail instockdetail)
        {
            String sql = "insert into stockdetail_table(GoodinID,GoodsID,Goodsname,Suppliername,Storename,GoodsinNum,Goodsinprice) values('"
                         + instockdetail.InID
                         + "','"
                         + instockdetail.GoodID
                         + "','"
                         + instockdetail.GoodName
                         + "','"
                         + instockdetail.Supplier
                         + "','"
                         + instockdetail.Inventory
                         + "','"
                         + instockdetail.Amount
                         + "','"
                         + instockdetail.goodinprice + "')";

            Datameans.getsqlcom(sql);



            //插入入库单从表
        }