using System.Collections.Generic; using System.Data; using Mesnac.Action.ChemicalWeighing.LjMaterial; namespace Mesnac.Action.ChemicalWeighing.LjStock { public class StockDbHelp:DBHelp { public static int Update(StockView view) { string sql = @"update lj_stock_material set MId=@MId ,MName=@MName where id=@id"; IDictionary dic = GetDefault(); dic.Add("@id",view.Id); dic.Add("@MId",view.MId); dic.Add("@MName",view.MName); ExecuteNonQuery(sql, dic); return 1; } public static DataTable GetById(int Id) { string sql = "select Id, Code, StockName, MTypeId, MTypeName, MId, MName, Remark from lj_stock_material where id=" + Id; return GetTable(sql); } } }