Example #1
0
 public ActionResult Assets(string search)
 {
     if (search != "")
     {
         var asset = (from a in list.Assets()
                      join e in list.Employees()
                      on a.employeeNumber equals e.employeeNumber
                      select new AssetListViewModel
         {
             assetNumber = a.assetNumber,
             serialNumber = a.serialNumber,
             manufacturer = a.manufacturer,
             catergory = a.catergory,
             dateadded = a.dateadded,
             warranty = a.warranty,
             assetstatus = a.assignstatus,
             owner = e.firstName + " " + e.lastName,
             assetID = a.assetID,
             assigneddate = Convert.ToDateTime(a.assigndate).ToShortDateString()
         })
                     .Where(x => x.assetNumber.Contains(search.ToUpper()) && x.assetstatus == 1)
                     .ToList();
         return(View(asset));
     }
     return(View());
 }
Example #2
0
        public ViewResult Details(string id)
        {
            var model = (from e in resolver.Employees()
                         join a in resolver.Assets()
                         on e.employeeNumber equals a.employeeNumber
                         join d in resolver.Departments()
                         on e.departmentID equals d.departmentID
                         select new EmployeeViewModel
            {
                fullname = e.firstName + " " + e.lastName,
                employeeNumber = e.employeeNumber,
                IDNumber = e.IDNumber,
                hireDate = e.hireDate,
                departmentName = d.departmentName,
                position = e.position,
                emailAddress = e.emailAddress,
            }).FirstOrDefault(m => m.employeeNumber.Equals(id));

            return(View(model));
        }
        //
        // GET: /Dashboard/
        public ActionResult Dashboard()
        {
            int s = 0;

            ViewBag.getAssets   = list.Assets().Count;
            ViewBag.getEmployee = list.Employees().Count;
            HelpDeskLogic hdl = new HelpDeskLogic();

            ViewBag.AllTickets = hdl.getAllTickets();

            ViewBag.TicketParticipant = hdl.GetParticipantReport(User.Identity.Name);
            foreach (Stock st in context.Stocks.ToList())
            {
                s += st.quantity;
            }
            ViewBag.getStock = s;
            var ticketsPerDevice = new TicketsByDevicesReport();

            ticketsPerDevice.AssignTickets();
            return(View(ticketsPerDevice));;
        }