List <Fas_Depo_Test_Result> Loads() { using (FASEntities Con = new FASEntities()) { var inq = new int[] { 41849, 42891, 43575, 43575, 43575, 43575, 44114, 42983, 42335, 47192, 19438, 42928, 42369, 44972, 36102, 44165, 44891, 03702, 03686, 03685 }; return((from i in Con.Fas_Depo_Test_Result where (inq.Contains(i.SN)) select i).ToList()); } }
bool Check(int SN) { using (FASEntities Con = new FASEntities()) { return(Con.Fas_Depo_Test_Result.Where(c => c.SN == SN).Select(c => c.SN == SN).FirstOrDefault()); } }
List <Fas_Depo_Test_Result> Loads(int start, int end) { using (FASEntities Con = new FASEntities()) { return((from i in Con.Fas_Depo_Test_Result where (i.SN <= start && i.SN >= end) select i).ToList()); } }
void Update(int SN, string FullName, byte[] Byte) { using (FASEntities Con = new FASEntities()) { var _count = Con.Fas_Depo_Test_Result.Where(c => c.SN == SN).Select(c => c.Count).FirstOrDefault(); var A = Con.Fas_Depo_Test_Result.Where(c => c.SN == SN); A.FirstOrDefault().ResultFileName = FullName; A.FirstOrDefault().ResultData = Byte; A.FirstOrDefault().RegDate = DateTime.Now; A.FirstOrDefault().Count = (Convert.ToInt32(_count) + 1).ToString(); Con.SaveChanges(); } }
void Add(int SN, string FullName, byte[] Byte) { using (FASEntities Con = new FASEntities()) { var depo = new Fas_Depo_Test_Result() { SN = SN, ResultFileName = FullName, ResultData = Byte, RegDate = DateTime.Now, Count = "1" }; Con.Fas_Depo_Test_Result.Add(depo); Con.SaveChanges(); } }