コード例 #1
0
ファイル: ProcessUser.cs プロジェクト: hatrongphan/DA_PTTKHT
 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();
         }
     }
 }
コード例 #2
0
 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();
     }
 }
コード例 #3
0
 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();
     }
 }
コード例 #4
0
 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();
     }
 }
コード例 #5
0
ファイル: ProcessFood.cs プロジェクト: hatrongphan/DA_PTTKHT
 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();
     }
 }
コード例 #6
0
ファイル: ProcessCard.cs プロジェクト: hatrongphan/DA_PTTKHT
 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();
     }
 }
コード例 #7
0
 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();
     }
 }
コード例 #8
0
ファイル: ProcessDrink.cs プロジェクト: hatrongphan/DA_PTTKHT
 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();
     }
 }
コード例 #9
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();
     }
 }
コード例 #10
0
 public void InsertCatergory(string name)
 {
     using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext())
     {
         objWriter.Categories.InsertOnSubmit(new Category
         {
             CategoryName = name
         });
         objWriter.SubmitChanges();
     }
 }
コード例 #11
0
        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();
        }
コード例 #12
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();
     }
 }
コード例 #13
0
 public void InsertGroupClient(string groupClientName, string description)
 {
     using (QuanLyPhongNETDataContext objWriter = new QuanLyPhongNETDataContext())
     {
         objWriter.GroupClients.InsertOnSubmit(new GroupClient
         {
             GroupName   = groupClientName,
             Discription = description
         });
         objWriter.SubmitChanges();
     }
 }
コード例 #14
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();
         }
     }
 }
コード例 #15
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();
     }
 }
コード例 #16
0
ファイル: ProcessDrink.cs プロジェクト: hatrongphan/DA_PTTKHT
 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();
     }
 }
コード例 #17
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();
     }
 }
コード例 #18
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();
     }
 }
コード例 #19
0
ファイル: ProcessDrink.cs プロジェクト: hatrongphan/DA_PTTKHT
 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();
     }
 }
コード例 #20
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();
     }
 }