public void GetNextFileName(ref string next_filename, ref int next_file_order) { CDocument_recepFactory faDocument_recep = new CDocument_recepFactory(); List <CDocument_recep> lstDocument_recep = faDocument_recep.GetAll(); int max = 0; if (lstDocument_recep != null && lstDocument_recep.Count() > 0) { max = lstDocument_recep.Max(c => Convert.ToInt32(c.Order_file)); } next_file_order = max + 1; next_filename = String.Format("{0}-{1}", "R", next_file_order.ToString().PadLeft(6, '0')); }
public List <CDocAttach> GetLstDocAttach(long idrecep_sample) { List <CDocument_recep> lstDocument_recep = new CDocument_recepFactory().GetAll(); List <CRecep_sample_attach> lstRecep_sample_attach = new CRecep_sample_attachFactory().GetAll().Where(c => c.Idrecep_sample == idrecep_sample).ToList(); List <CDocAttach> lstDocAttach = new List <CDocAttach>((from t1 in lstDocument_recep join t2 in lstRecep_sample_attach on t1.Iddocument_recep equals t2.Iddocument_recep select new CDocAttach { Iddocument_recep = t1.Iddocument_recep, Idrecep_sample = t2.Idrecep_sample, Name_file = t1.Name_file, Order_file = t1.Order_file, Source_path = "" }).ToList <CDocAttach>()); return(lstDocAttach); }