public void SelpropDelete(int id) { Selprop prop = prop_repo.Get(d => d.id == id); prop_repo.Delete(prop); SubmitChanges(); }
public int SelpropAdd(mSelprop prop) { Selprop newprop = new Selprop(); prop_repo.Add(prop.ToDb(newprop)); SubmitChanges(); return(newprop.id); }
public mSelprop SelpropUpdate(mSelprop upprop) { Selprop item = prop_repo.Get(d => d.id == upprop.Id); upprop.ToDb(item); SubmitChanges(); return(new mSelprop(item)); }
public mSelprop(Selprop p) { Id = p.id; Act = (eAct)p.act; Name = p.name; ClassName = p.className; PropType = (eSelpropType)p.type; }
public Selprop ToDb(Selprop db) { if (!string.IsNullOrEmpty(Name)) { db.name = Name; } if (!string.IsNullOrEmpty(ClassName)) { db.className = ClassName; } db.act = (int)Act; db.type = (int)PropType; return(db); }