public SmsinfosprModel FindOne(int ID) { SmsinfosprRepository _repo = new SmsinfosprRepository(); SmsinfosprModel theSpr = _repo.FindAll("ID=" + ID.ToString())[0]; this.ID = theSpr.ID; this.Name = theSpr.Name; this.ParentID = theSpr.ParentID; return(this); }
public void Delete() { SmsinfosprRepository _repo = new SmsinfosprRepository(); List <SmsinfosprModel> listResult = new List <SmsinfosprModel>(); listResult = FindAll("PARENT_ID=" + this.ID); if (listResult.Count > 0) { for (int i = 0; i < listResult.Count; i++) { SmsinfosprModel item = listResult[i]; item.Delete(); } } _repo.Delete(this); }
public List <SmsinfosprModel> FindAll(string condition = "", string order = "") { SmsinfosprRepository _repo = new SmsinfosprRepository(); return(_repo.FindAll(condition, order)); }
public void Update() { SmsinfosprRepository _repo = new SmsinfosprRepository(); _repo.Update(this); }
public void Create() { SmsinfosprRepository _repo = new SmsinfosprRepository(); _repo.Create(this); }