public Models.DocVenda Get(string id) { try { Models.DocVenda doc = (from p in db.DocVenda where p.Id == id select p).AsQueryable().First(); return(doc); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e); return(null); } }
public EncomendaProduto Get(string id) { try { Models.DocVenda doc = (from p in db.DocVenda where p.Id == id select p).AsQueryable().First(); List <Models.LinhaDocVenda> linhas = (from i in db.LinhaDocVenda where i.IdCabecDoc == id select i).ToList(); EncomendaProduto encomenda = new EncomendaProduto(doc, linhas); return(encomenda); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e); return(null); } }
public EncomendaProduto(Models.DocVenda doc, List <Models.LinhaDocVenda> lines) { this.doc = doc; this.lines = lines; }