示例#1
0
 public bool themLoaiMonAn(LoaiMonAn loaiMon)
 {
     if (tonTaiLoaiMonAn(loaiMon.MALOAI))
     {
         return(false);
     }
     else
     {
         loaiMon.CREADTEDAT = DateTime.Now;
         DataProvider.ISCreated.DB.LoaiMonAns.Add(loaiMon);
         DataProvider.ISCreated.DB.SaveChanges();
         return(true);
     }
 }
示例#2
0
 public bool suaLoaiMonAn(LoaiMonAn loaiMon)
 {
     if (!tonTaiLoaiMonAn(loaiMon.MALOAI))
     {
         return(false);
     }
     else
     {
         var temp = DataProvider.ISCreated.DB.LoaiMonAns.Where(x => x.MALOAI == loaiMon.MALOAI).SingleOrDefault();
         temp.MALOAI    = loaiMon.MALOAI;
         temp.TENLOAI   = loaiMon.TENLOAI;
         temp.UPDATEDAT = DateTime.Now;
         DataProvider.ISCreated.DB.SaveChanges();
         return(true);
     }
 }
示例#3
0
 public static bool IsDrink(LoaiMonAn loaiMonAn)
 {
     return(!IsTopping(loaiMonAn) && !IsOption(loaiMonAn));
 }
示例#4
0
 public static bool IsOption(LoaiMonAn loaiMonAn)
 {
     return(loaiMonAn.TENLOAI.Equals("SIZE") || loaiMonAn.TENLOAI.Equals("TYPE"));
 }
示例#5
0
 public static bool IsTopping(LoaiMonAn loaiMonAn)
 {
     return(loaiMonAn.TENLOAI.Equals("CÁC LOẠI HẠT"));
 }
示例#6
0
 public Category(LoaiMonAn a)
 {
     this.Name = a.TENLOAI;
     this.ID   = a.MALOAI;
 }