public List <menuCategory> IsCatogeryNameExist(string catogeryname, int id)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.menuCategories.Where(t => t.id != id && t.name == catogeryname).ToList());
     }
 }
 public List <Sale> Getpendingsale()
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.Sales.Where(a => a.IsBillPending == 1 && a.OrderType == "Dine_In").GroupBy(z => z.TableName).Select(g => g.FirstOrDefault()).ToList());
     }
 }
 public List <Sale> GetpendingsaleofSelectedTable(string name)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.Sales.Where(a => a.IsBillPending == 1 && a.OrderType == "Dine_In" && a.TableName == name).ToList());
     }
 }
 public List <Sale> Get_SelectedSale(String s, string orderType)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.Sales.Where(t => t.TicketNo == s && t.OrderType == orderType).ToList());
     }
 }
 public List <Sale> Get_PendingOrderSingle(string ticketno)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.Sales.Where(t => t.TicketNo == ticketno && t.OrderType == "Home_Delivery" && t.IsRefund == 0 && t.IsBillPending == 1).ToList());
     }
 }
 public List <menuItem> Get_SelectedMenuItem(int id)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.menuItems.Where(t => t.cat_id == id && t.status == true).ToList());
     }
 }
        public bool Save_MenuItems_tables(menuItem model)
        {
            using (RMSDBEntities db = new RMSDBEntities())
            {
                if (model.id == 0)
                {
                    db.menuItems.Add(model);
                    db.SaveChanges();
                    return(true);
                }
                else if (model.id > 0)
                {
                    menuItem RowinDb = db.menuItems.Where(d => d.id == model.id).SingleOrDefault();
                    RowinDb.itemName = model.itemName;

                    RowinDb.color          = model.color;
                    RowinDb.Price          = model.Price;
                    RowinDb.discountpercnt = model.discountpercnt;
                    RowinDb.status         = model.status;
                    RowinDb.cat_id         = model.cat_id;
                    RowinDb.section_id     = model.section_id;

                    db.SaveChanges();
                    return(true);
                }
                return(false);
            }
        }
 public List <section> GetAllCounters()
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.sections.ToList());
     }
 }
 public List <section> IsSectionNameExist(string sectionname, int id)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.sections.Where(t => t.id != id && t.sectionname == sectionname).ToList());
     }
 }
Exemplo n.º 10
0
        public bool SaveUser(UserTable model, int checkupdate)
        {
            using (RMSDBEntities db = new RMSDBEntities())
            {
                if (checkupdate == 0)

                {
                    db.UserTables.Add(model);
                    db.SaveChanges();
                    return(true);
                }
                else
                {
                    UserTable RowinDb = db.UserTables.Where(d => d.UserName == model.UserName).SingleOrDefault();



                    RowinDb.FullName        = model.FullName;
                    RowinDb.Password        = model.Password;
                    RowinDb.ConfirmPassword = model.ConfirmPassword;
                    RowinDb.IsAdmin         = model.IsAdmin;

                    db.SaveChanges();
                    return(true);
                }
            }
        }
Exemplo n.º 11
0
 public List <UserTable> IsUsernameExist(string username, int id)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.UserTables.Where(t => t.UserId != id && t.UserName == username).ToList());
     }
 }
Exemplo n.º 12
0
 public List <UserTable> GetAunthenticatedUsers(String Username, string password)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.UserTables.Where(d => d.UserName == Username && d.Password == password).ToList());
     }
 }
Exemplo n.º 13
0
 public List <UserTable> GetSpecificUsers(String Username)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.UserTables.Where(d => d.UserName == Username).ToList());
     }
 }
Exemplo n.º 14
0
 public List <UserTable> GetAllUsers()
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.UserTables.ToList());
     }
 }
 public List <menuCategory> Get_CategoryID(string catname)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.menuCategories.Where(t => t.name == catname).ToList());
     }
 }
 public List <menuItem> GetAllMenuItems()
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.menuItems.ToList());
     }
 }
 public List <section> Get_SectionID(string Secname)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.sections.Where(t => t.sectionname == Secname).ToList());
     }
 }
 public List <menuItem> IsItemNameExist(string itemname, int id)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.menuItems.Where(t => t.id != id && t.itemName == itemname).ToList());
     }
 }
 public List <menuItem> Get_SelectedMenuItemONDVG(int id)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.menuItems.Where(t => t.id == id).ToList());
     }
 }
 public List <menuItem> Get_SelectedBarcode(String barcode)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.menuItems.Where(t => t.barcode == barcode).ToList());
     }
 }
 public List <Sale> GetAllSalesItems()
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.Sales.ToList());
     }
 }
 public List <menuItem> Get_barcodeOrItemName(String borname)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.menuItems.Where(t => t.barcode == borname || t.itemName == borname).ToList());
     }
 }
 public List <Sale> Get_PendingOrderListDineIn(int i, string orderType)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.Sales.Where(t => t.IsBillPending == i && t.OrderType == orderType).ToList());
     }
 }
 public List <menuItem> Get_AllCatIdForGstUpdateFromADdCatogery(int catid)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.menuItems.Where(t => t.cat_id == catid).ToList());
     }
 }
 public List <SaleDetail> Get_SelectedSaledetailItemup(int id, String s)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.SaleDetails.Where(t => t.TicketNo == s && t.ItemId == id).ToList());
     }
 }
 public List <menuCategory> Get_CategoryName(int catname)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.menuCategories.Where(t => t.id == catname).ToList());
     }
 }
 public List <SaleDetail> Get_SelectedSaleDetail(String s)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.SaleDetails.Where(t => t.TicketNo == s).ToList());
     }
 }
 public List <section> Get_SectionyName(int Secname)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.sections.Where(t => t.id == Secname).ToList());
     }
 }
        public bool SaveSaleDetailItems(SaleDetail model, int checkupdate)
        {
            using (RMSDBEntities db = new RMSDBEntities())
            {
                if (checkupdate == 0)

                {
                    db.SaleDetails.Add(model);
                    db.SaveChanges();
                    return(true);
                }
                else
                {
                    SaleDetail RowinDb = db.SaleDetails.Where(d => d.TicketNo == model.TicketNo && d.ItemId == model.ItemId).SingleOrDefault();



                    RowinDb.ItemId         = model.ItemId;
                    RowinDb.itemName       = model.itemName;
                    RowinDb.Price          = model.Price;
                    RowinDb.Discount       = model.Discount;
                    RowinDb.Quantity       = model.Quantity;
                    RowinDb.Total          = model.Total;
                    RowinDb.TicketNo       = model.TicketNo;
                    RowinDb.RecordID       = model.RecordID;
                    RowinDb.Aed_Vat        = model.Aed_Vat;
                    RowinDb.Aed_Vat_Amount = model.Aed_Vat_Amount;
                    RowinDb.Date           = model.Date;

                    db.SaveChanges();
                    return(true);
                }
            }
        }
 public List <menuItem> CheckEmptyItem(int cat)
 {
     using (RMSDBEntities db = new RMSDBEntities())
     {
         return(db.menuItems.Where(d => d.cat_id == cat).ToList());
     }
 }