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