Пример #1
0
 public ActionResult Create([Bind(Include = "Id,Firm_Invoice,Case_Name,Status,Invoice_Date,Appealable_Items,Total_Billed,pdf")] Invoice invoice, HttpPostedFileBase files)
 {
     if (ModelState.IsValid)
     {
         db.Invoices.Add(invoice);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(invoice));
 }
Пример #2
0
        public ActionResult Create([Bind(Include = "AssetID,AssetDescription,EmployeeID,AssetCategoryID,StatusID,DepartmentID,VendorID,Make,ModelNumber,SerialNumber,DateAcquired,DateSold,PurchasePrice,DepreciationMethod,DepreciableLife,SalvageValue,CurrentValue,Comments,Description,NextSchedMaint,Processor,RAM,Condition,ComputerName,SSMA_TimeStamp")] Asset asset)
        {
            if (ModelState.IsValid)
            {
                db.Assets.Add(asset);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(asset));
        }
Пример #3
0
        public ActionResult Create([Bind(Include = "EmployeeID,DepartmentID,FirstName,LastName,OfficeLocation,GroupID")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                db.Employees.Add(employee);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.DepartmentID = new SelectList(db.Departments, "DepartmentID", "DepartmentName", employee.DepartmentID);
            ViewBag.EmployeeID   = new SelectList(db.Employees, "EmployeeID");
            ViewBag.GroupID      = new SelectList(db.Groups, "GroupID", "GroupName", employee.GroupID);
            return(View(employee));
        }
Пример #4
0
        public ActionResult Create([Bind(Include = "ManagerListID,EmployeeID,GroupID")] ManagerList managerList)
        {
            if (ModelState.IsValid)
            {
                db.ManagerLists.Add(managerList);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ManagerListID = new SelectList(db.Assets, "AssetID", "AssetDescription", managerList.ManagerListID);
            ViewBag.EmployeeID    = new SelectList(db.Employees.Where(x => x.GroupID == 1), "EmployeeID", "FirstName", managerList.EmployeeID);
            ViewBag.GroupID       = new SelectList(db.Groups, "GroupID", "GroupName", managerList.GroupID);
            return(View(managerList));
        }