Beispiel #1
0
 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();
     }
 }
Beispiel #2
0
 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();
     }
 }
Beispiel #3
0
 public void InsertCatergory(string name)
 {
     using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext())
     {
         objWriter.Categories.InsertOnSubmit(new Category
         {
             CategoryName = name
         });
         objWriter.SubmitChanges();
     }
 }
Beispiel #4
0
 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();
     }
 }
Beispiel #5
0
 public void InsertGroupClient(string groupClientName, string description)
 {
     using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext())
     {
         objWriter.GroupClients.InsertOnSubmit(new GroupClient
         {
             GroupName   = groupClientName,
             Discription = description
         });
         objWriter.SubmitChanges();
     }
 }
Beispiel #6
0
 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();
     }
 }
Beispiel #7
0
 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();
     }
 }
Beispiel #8
0
 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();
     }
 }
Beispiel #9
0
 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();
     }
 }
Beispiel #10
0
 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();
     }
 }
Beispiel #11
0
 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();
     }
 }
Beispiel #12
0
 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();
         }
     }
 }
Beispiel #13
0
 public ProcessGroupUser()
 {
     objReader = new QuanLyPhongNETDataContext();
     objWriter = new QuanLyPhongNETDataContext();
 }
Beispiel #14
0
 public ProcessDrink()
 {
     objReader = new QuanLyPhongNETDataContext();
     objWriter = new QuanLyPhongNETDataContext();
 }
Beispiel #15
0
 public ProcessCategory()
 {
     objReader = new QuanLyPhongNETDataContext();
     objWriter = new QuanLyPhongNETDataContext();
 }