Example #1
0
        public List <Code> LayThongTinVeCuaChuyenXe(int machuyen)
        {
            CodeRepository coderepo = new CodeRepository();
            var            codes    = coderepo.SearchFor(o => o.TABLE_NAME == "Ghe" && o.TABLE_PK == machuyen);

            return(codes.ToList());
        }
Example #2
0
        public string GetHinhAnhCuaXe(int maxe)
        {
            CodeRepository codeRepo = new CodeRepository();
            var            code     = codeRepo.SearchFor(o => o.TABLE_NAME == "Xe" && o.TYPE == "IMG" && o.TABLE_PK == maxe);

            if (code != null && code.Count() > 0)
            {
                return(code.SingleOrDefault().VALUE);
            }
            else
            {
                return("{}");
            }
        }
Example #3
0
 public bool Datve(int machuyen, string code, int sovedat)
 {
     try
     {
         CodeRepository coderepo = new CodeRepository();
         var            codes    = coderepo.SearchFor(o => o.TABLE_NAME == "Ghe" && o.TABLE_PK == machuyen && o.TYPE == "TICTYPE" && o.CODE1 == code);
         if (codes != null && code.Count() > 0)
         {
             var res    = codes.SingleOrDefault();
             int tongve = int.Parse(res.VALUE);
             res.CODE1 = (tongve - sovedat).ToString();
             coderepo.Save();
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch
     {
         return(false);
     }
 }