private static void Commit(IEnumerable<Detail> details ) { using (DocumentService documentService=new DocumentService()) { foreach (var detail in details) { documentService.CommitTrackById(detail.id); } } }
public void InitFromBase(int id,User user) { using (DocumentService docService = new DocumentService()) { Document doc = docService.GetDocumentById(id); this.docNum = doc.docNum; this.docType = doc.DocType.id; this.ActionUser = user; this.Hash = doc.hash; this.qtText = docNum + ";" + doc.DocType.name; // ну и допишите что хотите IsInited = true; } }
private static IEnumerable<Detail> GetData(bool deleted, string Type) { IEnumerable<Detail> details; using (DocumentService documentService = new DocumentService()) { details = documentService.GetDetails(deleted, Type); } return details; }