public double GetParamDefaultValueDouble(string grpId, string name) { ParamDefaultComponent paramDefValue = this.ParamDefaultComponents.Single( pdc => pdc.GroupId == grpId && pdc.Name == name); return(paramDefValue.Value); }
public void InsertParamDefaultValue(PLMPackEntities db, string grpId, string name, double value) { if (db.ParamDefaultComponents.Count( pdc => (pdc.ComponentGuid == Guid) && (pdc.GroupId == grpId) && (pdc.Name == name)) > 0) { ParamDefaultComponent paramDefValue = db.ParamDefaultComponents.Single( pdc => (pdc.ComponentGuid == Guid) && (pdc.GroupId == grpId) && (pdc.Name == name)); paramDefValue.Value = value; } else { db.ParamDefaultComponents.Add(new ParamDefaultComponent() { ComponentGuid = Guid, GroupId = grpId, Name = name, Value = value } ); } db.SaveChanges(); }