public void setParmValue(ParmDefine ParmName, object value) { db0 = getDB0; string str = Enum.GetName(typeof(ParmDefine), ParmName); var item = db0.i_Parm.Where(x => x.ParmName == str).FirstOrDefault(); if (item != null) { if (item.ParmType == "S") { item.S = (string)value; } if (item.ParmType == "I") { item.I = (int)value; } if (item.ParmType == "F") { item.F = (decimal)value; } if (item.ParmType == "D") { item.D = (DateTime)value; } if (item.ParmType == "B") { item.B = (bool)value; } } db0.SaveChanges(); }
public object getParmValue(ParmDefine ParmName) { db0 = getDB0; string getName = Enum.GetName(typeof(ParmDefine), ParmName); var item = db0.i_Parm.Where(x => x.ParmName == getName).FirstOrDefault(); if (item != null) { if (item.ParmType == "S") { return item.S; } if (item.ParmType == "I") { return item.I; } if (item.ParmType == "F") { return item.F; } if (item.ParmType == "D") { return item.D; } if (item.ParmType == "B") { return item.B; } else { return null; } } else { return null; } }