Esempio n. 1
0
 /// <summary>
 /// 直接入库
 /// </summary>
 /// <param name="styleId"></param>
 /// <returns></returns>
 public static ISampleBaseInfo PutInStorage(string styleId)
 {
     using (SunginDataContext sc = new SunginDataContext())
     {
         ISampleBaseInfo s = sc.SampleBaseInfos.FirstOrDefault(p => p.StyleId == styleId);
         if (s != null)
         {
             s.State = SampleState.在库;
             sc.SaveChanges();
             return(s);
         }
         else
         {
             return(null);
         }
     }
 }
Esempio n. 2
0
 public static ISampleBaseInfo DeleteSample(string styleId, string user)
 {
     using (SunginDataContext sc = new SunginDataContext())
     {
         ISampleBaseInfo s = sc.SampleBaseInfos.FirstOrDefault(p => p.StyleId == styleId);
         if (s != null)
         {
             s.Delete(user);
             sc.SaveChanges();
             return(s);
         }
         else
         {
             return(null);
         }
     }
 }