public void UpdateUser(string name, string type, string groupUser, string phone, string email) { using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext()) { TheUser objUpdate; if ((objUpdate = objWriter.TheUsers.FirstOrDefault(x => x.UserName.Equals(name))) == null) { objWriter.TheUsers.InsertOnSubmit(new TheUser { UserName = name, Type = type, GroupUser = groupUser, PhoneNumber = phone, Email = email }); objWriter.SubmitChanges(); } else { objUpdate.UserName = name; objUpdate.Type = type; objUpdate.GroupUser = groupUser; objUpdate.PhoneNumber = phone; objUpdate.Email = email; objWriter.SubmitChanges(); } } }
public void DeleteClient(string clientName) { using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext()) { var objDelete = objWriter.Clients.Single(x => x.ClientName.Equals(clientName)); objWriter.Clients.DeleteOnSubmit(objDelete); objWriter.SubmitChanges(); } }
public void DeleteGroupUser(string groupUserName) { using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext()) { var objDelete = objWriter.GroupUsers.Single(x => x.GroupName.Equals(groupUserName)); objWriter.GroupUsers.DeleteOnSubmit(objDelete); objWriter.SubmitChanges(); } }
public void DeleteCategory(string name) { using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext()) { var objDelete = objWriter.Categories.Single(x => x.CategoryName.Equals(name)); objWriter.Categories.DeleteOnSubmit(objDelete); objWriter.SubmitChanges(); } }
public void DeleteFood(int foodID) { using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext()) { var objDelete = objWriter.Foods.Single(x => x.FoodID == foodID); objWriter.Foods.DeleteOnSubmit(objDelete); objWriter.SubmitChanges(); } }
public void DeleteCard(int cardID) { using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext()) { var objDelete = objWriter.TheCards.Single(x => x.CardID == cardID); objWriter.TheCards.DeleteOnSubmit(objDelete); objWriter.SubmitChanges(); } }
public void DeleteMember(int memberID) { using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext()) { var objDelete = objWriter.Members.Single(x => x.MemberID == memberID); objWriter.Members.DeleteOnSubmit(objDelete); objWriter.SubmitChanges(); } }
public void DeleteDrink(int drinkID) { using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext()) { var objDelete = objWriter.Drinks.Single(x => x.DrinkID == drinkID); objWriter.Drinks.DeleteOnSubmit(objDelete); objWriter.SubmitChanges(); } }
public void UpdateCategory(string name) { using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext()) { Category objUpdate; objUpdate = objWriter.Categories.FirstOrDefault(x => x.CategoryName.Equals(name)); objUpdate.CategoryName = name; objWriter.SubmitChanges(); } }
public void InsertCatergory(string name) { using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext()) { objWriter.Categories.InsertOnSubmit(new Category { CategoryName = name }); objWriter.SubmitChanges(); } }
public void CreateNewBill(int billID, string userName, DateTime foundedDate, float priceTotal) { Bill bill = new Bill(); bill.BillID = billID; bill.FoundedUser = userName; bill.FoundedDate = foundedDate; bill.PriceTotal = priceTotal; objReader.Bills.InsertOnSubmit(bill); objReader.SubmitChanges(); }
public void UpdateGroupClient(string groupClientName, string description) { using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext()) { GroupClient objUpdate; objUpdate = objWriter.GroupClients.FirstOrDefault(x => x.GroupName.Equals(groupClientName)); objUpdate.GroupName = groupClientName; objUpdate.Discription = description; objWriter.SubmitChanges(); } }
public void InsertGroupClient(string groupClientName, string description) { using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext()) { objWriter.GroupClients.InsertOnSubmit(new GroupClient { GroupName = groupClientName, Discription = description }); objWriter.SubmitChanges(); } }
public void UpdateGroupUser(string groupUserName, string typeName) { using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext()) { GroupUser objUpdate; if ((objUpdate = objWriter.GroupUsers.FirstOrDefault(x => x.GroupName.Equals(groupUserName))) == null) { objWriter.GroupUsers.InsertOnSubmit(new GroupUser { GroupName = groupUserName, TypeName = typeName }); objWriter.SubmitChanges(); } else { objUpdate.GroupName = groupUserName; objUpdate.TypeName = typeName; objWriter.SubmitChanges(); } } }
public void UpdateClient(string name, string groupClientName, string status, string note) { using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext()) { Client objUpdate; objUpdate = objWriter.Clients.FirstOrDefault(x => x.ClientName.Equals(name)); objUpdate.ClientName = name; objUpdate.GroupClientName = groupClientName; objUpdate.StatusClient = status; objUpdate.Note = note; objWriter.SubmitChanges(); } }
public void UpdateDrink(int drinkID, string name, string categoryName, float priceUnit, string unitLot, int inventoryNumber) { using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext()) { Drink objUpdate; objUpdate = objWriter.Drinks.FirstOrDefault(x => x.DrinkID == drinkID); objUpdate.DrinkName = name; objUpdate.CategoryName = categoryName; objUpdate.PriceUnit = priceUnit; objUpdate.UnitLot = unitLot; objUpdate.InventoryNumber = inventoryNumber; objWriter.SubmitChanges(); } }
public void InsertClient(string name, string groupClientName, string status, string note) { using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext()) { objWriter.Clients.InsertOnSubmit(new Client { ClientName = name, GroupClientName = groupClientName, StatusClient = status, Note = note }); objWriter.SubmitChanges(); } }
public void UpdateMember(int memberID, string account, string pass, string groupUser, TimeSpan time, float money, string status) { using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext()) { Member objUpdate; objUpdate = objWriter.Members.FirstOrDefault(x => x.MemberID == memberID); objUpdate.AccountName = account; objUpdate.Password = pass; objUpdate.GroupUser = groupUser; objUpdate.CurrentTime = time; objUpdate.CurrentMoney = money; objUpdate.StatusAccount = status; objWriter.SubmitChanges(); } }
public void InsertDrink(string name, string categoryName, float priceUnit, string unitLot, int inventoryNumber) { using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext()) { objWriter.Drinks.InsertOnSubmit(new Drink { DrinkName = name, CategoryName = categoryName, PriceUnit = priceUnit, UnitLot = unitLot, InventoryNumber = inventoryNumber }); objWriter.SubmitChanges(); } }
public void InsertMember(string account, string pass, string groupUser, TimeSpan time, float money, string status) { using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext()) { objWriter.Members.InsertOnSubmit(new Member { AccountName = account, Password = pass, GroupUser = groupUser, CurrentTime = time, CurrentMoney = money, StatusAccount = status }); objWriter.SubmitChanges(); } }