//This Method Attach object of type Obligations to the context.

        public void UpdateObligations(Obligations obligation)
        {
            var context = new CashierSystemEntities();

            context.Obligations.Attach(obligation);

            context.SaveChanges();
        }
Пример #2
0
        //This Method Attach object of type Cashier to the context.

        public void UpdateCashier(Cashier cashier)
        {
            var context = new CashierSystemEntities();

            context.Cashier.Attach(cashier);

            context.SaveChanges();
        }
        //This Method Attach object of type Client to the context.

        public void UpdateClient(Client client)
        {
            var context = new CashierSystemEntities();

            context.Client.Attach(client);

            context.SaveChanges();
        }
        //This Method add object of type Obligations to the table Obligations.

        public Obligations AddObligations(Obligations obligation)
        {
            var context = new CashierSystemEntities();

            context.Obligations.Add(obligation);

            context.SaveChanges();

            return(obligation);
        }
        //This Method add object of type Client to the table Client.

        public Client AddClient(Client client)
        {
            var context = new CashierSystemEntities();

            context.Client.Add(client);

            context.SaveChanges();

            return(client);
        }
Пример #6
0
        //This Method add object of type Cashier to the table Cashier.


        public void AddCashier(string FirstName, string LastName, string userName, string Pass)
        {
            var context = new CashierSystemEntities();

            var include = context.Cashier.Include("CashierClientTable").Where(x => x.cashier_user_name == userName);


            Cashier newCashier = context.Cashier.Add
                                 (
                new Cashier
            {
                cashier_first_name = FirstName,
                cashier_last_name  = LastName,
                cashier_user_name  = userName,
                cashier_password   = Pass
            }
                                 );



            context.SaveChanges();
        }