Пример #1
0
        public ActionResult Approve(int id)
        {
            Invoice invoice = _db.Invoices.Find(id);

            invoice.InvoiceStatus    = 2;
            _db.Entry(invoice).State = EntityState.Modified;
            _db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
        public ActionResult AddUser(Guid employeeId)
        {
            Initialize();

            var authorizedUsers = new AuthorizedUser();

            _user = _restAPI.GetUser(employeeId);
            authorizedUsers.isAuthorized       = true;
            authorizedUsers.EmployeeGUID       = employeeId;
            authorizedUsers.EmployeeName       = _user.DisplayName;
            authorizedUsers.EmployeeDepartment = _user.Department;
            authorizedUsers.domain             = _domain;
            _db.AuthorizedUsers.Add(authorizedUsers);
            _db.SaveChanges();
            return(RedirectToAction("AddUsers"));
        }
Пример #3
0
        public ActionResult Create(Invoice invoice)
        {
            Initialize();

            if (ModelState.IsValid)
            {
                invoice.EmployeePUID  = _employeepuid;
                invoice.CompanyDomain = _domain;
                invoice.InvoiceStatus = 0;

                _db.Invoices.Add(invoice);
                _db.SaveChanges();

                return(RedirectToAction("Details", new { id = invoice.InvoiceID }));
            }
            return(View(invoice));
        }
Пример #4
0
        public ActionResult Create(int invoiceID, Item item)
        {
            var invoices = _db.Invoices.Single(r => r.InvoiceID == invoiceID);

            ViewBag.InvoiceName     = invoices.Reason;
            ViewBag.InvoiceEmployee = invoices.Employee;
            ViewBag.InvoiceID       = invoices.InvoiceID;

            if (ModelState.IsValid)
            {
                invoices.Items.Add(item);
                _db.SaveChanges();
                return(RedirectToAction("Details", "Invoice", new { id = invoices.InvoiceID }));
            }

            return(View(item));
        }
        public ActionResult Authorize1(Signup signup)
        {
            if (ModelState.IsValid)
            {
                signup.ServicePrincipalURL = signup.AppPrincipalId + "@" + signup.CompanyId;
                _db.Signups.Add(signup);
                _db.SaveChanges();
                return(RedirectToAction("Authorize2"));
            }

            return(View());
        }