public IActionResult Index(int uid, string userName, string userPassword)
        {
            cid = LoginController.active_user.CompanyId;
            UserCompany uc = new UserCompany();

            uc.companies = context.Companies.Where(i => i.CompanyId == cid).ToList();
            LoginController.active_user.UserName = userName;
            LoginController.active_user.password = userPassword;
            uc.user = LoginController.active_user;

            context.SaveChanges();
            return(View(uc));
        }
Пример #2
0
        public IActionResult Orders(int oid)
        {
            //Sipariş tamamlanırsa cargo ve orders tablosundan ilgili oid ye sahip verileri silmeliyim.
            Order order = context.Orders.FirstOrDefault(i => i.OrderId == oid);
            Cargo cargo = context.Cargos.First(i => i.OrderId == oid);

            context.Orders.Remove(order);
            context.Cargos.Remove(cargo);
            context.SaveChanges();
            return(View(context.Orders));
        }