Пример #1
0
        public JsonResult AddSoftwares(int AssetID)
        {
            AssetsManagement asm = new AssetsManagement();
            IEnumerable <AssetsManagement.Softwares> softwarelist = asm.AddSoftwares(AssetID);

            return(Json(softwarelist, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public ActionResult ConfigureAsset(ViewAssetsModel assest)
        {
            ViewBag.AssetsData = ConfigureAssets();
            try
            {
                if (ModelState.IsValid)
                {
                    AssetsManagement AMB = new AssetsManagement();
                    int retuser          = AMB.AssetsInsert(assest.SystemName, assest.SystemIP, assest.SerialNumber, assest.MachineCode, assest.MachineType, assest.RegistrationDate, assest.ExpirationDate);

                    if (retuser == 1)
                    {
                        ViewBag.Message = "Record Inserted successfully";
                    }
                }
            }
            catch (Exception e)
            {
                Log.CreateLog(e);
            }

            MachineType();
            ModelState.Clear();
            return(View());
        }
Пример #3
0
        public JsonResult SoftwareDetails()
        {
            AssetsManagement asm = new AssetsManagement();
            IEnumerable <AssetsManagement.Softwares> software = asm.SoftwareDetails();

            return(Json(software, JsonRequestBehavior.AllowGet));
        }
Пример #4
0
        public JsonResult UnTagSoftware(int AssetID, int SoftwareID)
        {
            AssetsManagement asm = new AssetsManagement();
            int retVal           = asm.UnTagSoftware(AssetID, SoftwareID);

            return(Json(retVal, JsonRequestBehavior.AllowGet));
        }
Пример #5
0
        public ActionResult SRDetails()
        {
            AssetsManagement sa = new AssetsManagement();

            ViewBag.errmsg = null;
            int SRID  = 0;
            int check = Convert.ToInt32(Session["CountforSRDetails"]);

            if (check == 1)
            {
                SRID = Convert.ToInt32(System.Web.HttpContext.Current.Session["SRID"]);
            }
            if (check == 2)
            {
                SRID = Convert.ToInt32(Session["SRIDforSRDetails"]);
            }
            Session["SRIDforSRDetailsPost"] = SRID;
            Session["CountforSRDetails"]    = check;
            ViewBag.AssetName     = sa.GetAsset(SRID);
            ViewBag.AssetMIDList  = sa.GetAssetMIDList(SRID);
            ViewBag.SRDetails     = fetchSRDetails(SRID);
            ViewBag.TicketHistory = fetchTicketHistory(SRID);
            ViewBag.Attachment    = getAttachments(SRID);
            ViewBag.NextStatus    = new SelectList(Enum.GetValues(typeof(NextStatus)));

            foreach (var SRDetails in ViewBag.SRDetails)
            {
                if (SRDetails.statusName == "Open")
                {
                    ViewBag.statushelper = "Open - SR is currently pending for Approval/Rejection";
                }
                if (SRDetails.statusName == "Assigned")
                {
                    ViewBag.statushelper = "Assigned - SR is currently assigned to Infra Team";
                }
                if (SRDetails.statusName == "InProgress")
                {
                    ViewBag.statushelper = "InProgress - SR is currently worked upon by Infra team";
                }
                if (SRDetails.statusName == "Approved")
                {
                    ViewBag.statushelper = "Approved - SR is currently Approved by Admin";
                }
                if (SRDetails.statusName == "Cancel")
                {
                    ViewBag.statushelper = "Cancal - SR is cancelled";
                }
                if (SRDetails.statusName == "Closed")
                {
                    ViewBag.statushelper = "Closed - SR has been closed by Admin";
                }
                if (SRDetails.statusName == "Resolved")
                {
                    ViewBag.statushelper = "Resolved - SR is Resolved";
                }
                ViewBag.Statuses = SRDetails.statusName;
            }
            return(View());
        }
Пример #6
0
        public JsonResult TagSoftware(int AssetID, int SoftwareID)
        {
            AssetsManagement asm = new AssetsManagement();
            int retVal           = asm.TagSoftware(AssetID, SoftwareID);

            return(Json(retVal, JsonRequestBehavior.AllowGet));
            // return Content("<script>alert('Asset has been successfully unassigned to the Service Request');</script>");
        }
Пример #7
0
        public ActionResult AssetReport()
        {
            AssetsManagement asm = new AssetsManagement();

            MachineType();
            ViewBag.AssetReport = asm.AssetReport();
            return(View());
        }
Пример #8
0
        public ActionResult ConfigureAsset()
        {
            MachineType();
            ViewBag.AssetsData = ConfigureAssets();
            AssetsManagement asm = new AssetsManagement();

            ViewBag.SoftwareDetails = asm.SoftwareDetails();
            return(View());
        }
Пример #9
0
        public ActionResult AssetManageEdit(int ID)
        {
            MachineType();
            AssetsManagement AMB = new AssetsManagement();
            var std = AMB.ConfigureAssets().Where(s => s.ID == ID).FirstOrDefault();

            std.MachineType = std.MachineType.Trim();
            return(View(std));
        }
Пример #10
0
        public JsonResult AssetAssign(int SRID, int AssetID, string AssetName)
        {
            AssetsManagement asm = new AssetsManagement();

            asm.AssetAssign(SRID, AssetID);
            string toMailID = asm.SRCreatorMail(SRID);
            string subject  = "Asset Assignment against SR000000" + SRID;
            string mailBody = "This is to inform you that" + " " + AssetName + " " + "has been assigned against SR raised SR000000" + SRID + "<br/> Kindly visit the SR for more details";

            SendMail(subject, mailBody, toMailID);
            return(Json(true));
        }
Пример #11
0
        public JsonResult AddSoftware(int ID, string Name, string Description)
        {
            AssetsManagement asm = new AssetsManagement();
            int retVal           = 1;

            if (retVal == asm.AddSoftware(ID, Name, Description))
            {
                return(Json(true));
            }
            else
            {
                return(Json(false));
            }
        }
Пример #12
0
        public JsonResult ViewSoftwares(int AssetID)
        {
            AssetsManagement asm = new AssetsManagement();
            IEnumerable <AssetsManagement.Softwares> softwarelist = asm.ViewSoftwares(AssetID);

            if (softwarelist.Count() == 0)
            {
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(softwarelist, JsonRequestBehavior.AllowGet));
            }
        }
Пример #13
0
        public JsonResult SoftwareDelete(int ID)
        {
            AssetsManagement asm = new AssetsManagement();
            int retVal           = 1;

            if (retVal == asm.SoftwareDelete(ID))
            {
                return(Json(true));
            }
            else
            {
                return(Json(false));
            }
        }
Пример #14
0
        public ActionResult AssetReport(AssetsManagement.AssetReports reports)
        {
            AssetsManagement asm = new AssetsManagement();

            MachineType();

            ViewBag.AssetReport = asm.AssetReportSearch(reports);
            if (ViewBag.AssetReport.Count == 0)
            {
                TempData["Search"] = "No Data found";
                return(RedirectToAction("AssetReport"));
            }
            else
            {
                return(View());
            }
        }
Пример #15
0
 public ActionResult AssetManageEdit()
 {
     try
     {
         if (ModelState.IsValid)
         {
             ViewAssetsModel vm = new ViewAssetsModel();
             UpdateModel <ViewAssetsModel>(vm);
             AssetsManagement AMB = new AssetsManagement();
             AMB.UpdateAssets(vm);
             TempData["msg"] = "<script>alert('Record Updated successfully');</script>";
         }
     }
     catch (Exception e)
     {
         Log.CreateLog(e);
     }
     return(RedirectToAction("ConfigureAsset", "Admin"));
 }
Пример #16
0
        public ActionResult AdminDashboard()
        {
            AssetsManagement sa = new AssetsManagement();

            ViewBag.Roles          = new SelectList(Enum.GetValues(typeof(Roles)));
            ViewBag.getAvailable   = sa.getAvailableAssets();
            ViewBag.getUnAvailable = sa.getUnAvailableAssets();
            ViewBag.admindash      = Admindash();
            ViewBag.adminTask      = AdminTask();
            IEnumerable <Dashboardmanage.StatusValue> data = Admindash();

            int sum = 0;

            foreach (var a in data)
            {
                sum = sum + a.Total;
            }
            ViewData["sum"] = sum;
            return(View());
        }
Пример #17
0
 public ActionResult Delete(int ID)
 {
     try
     {
         AssetsManagement AMB = new AssetsManagement();
         int retVal           = AMB.DeleteAssests(ID);
         if (retVal == 1)
         {
             TempData["msg"] = "<script>alert('Record deleted successfully');</script>";
         }
         else
         {
             TempData["msg"] = "<script>alert('This Asset cannot be deleted as it is assigned to a Service Request. Please check on the View Asset Page !!');</script>";
         }
     }
     catch (Exception e)
     {
         Log.CreateLog(e);
     }
     return(RedirectToAction("ConfigureAsset"));
 }
Пример #18
0
        public void FreeAssetsAfterSRExpiry()
        {
            AssetsManagement asm = new AssetsManagement();

            try
            {
                int retVal = asm.SetAssetInActive();
                if (retVal > 0)
                {
                    Log.CreateLog("Assets are Inactive", logLevel: Level.Info);
                }
                else
                {
                    Log.CreateLog("Some error occured. Please check the database", logLevel: Level.Info);
                }
            }
            catch (Exception ex)
            {
                Log.CreateLog(ex.InnerException);
            }
        }
Пример #19
0
        public void AssetExpiryList()
        {
            string ExpiryMailID = System.Configuration.ConfigurationManager.AppSettings["AssetExpiryMailID"];

            AssetsManagement asm = new AssetsManagement();

            try
            {
                string textBody = "<table border=" + 1 + " cellpadding=" + 0 + " cellspacing=" + 0 + " width = " + 500 + "><tr bgcolor='yellow'><td><b>System Name</b></td><td><b>System IP</b></td><td><b>System Type</b></td><td><b>Expiration Date</b></td></tr>";
                if (asm.AssetExpiry().Count != 0)
                {
                    foreach (var item in asm.AssetExpiry())
                    {
                        textBody += "<tr><td>" + item.SystemName.Trim() + "</td><td> " + item.SystemIP.Trim() + "</td> <td> " + item.MachineType + "</td><td> " + item.ExpirationDate + "</td></tr>";
                    }
                    textBody += "</table>";
                    AssetExpiryMail(ExpiryMailID, textBody);
                }
            }
            catch (Exception e)
            {
            }
        }
Пример #20
0
        public ActionResult ViewAsset()
        {
            AssetsManagement asm = new AssetsManagement();

            if (!string.IsNullOrEmpty(Session["ajax"] as string))
            {
                string sessionVal  = Session["ajax"].ToString();
                int    index       = sessionVal.IndexOf(' ');
                string status      = sessionVal.Substring(0, index);
                string machineType = sessionVal.Substring(index + 1);

                ViewBag.AssetDetails     = asm.AssetDashboardSearch(machineType, status);
                TempData["Machinetype"]  = machineType;
                TempData["ServerStatus"] = status;
                Session["ajax"]          = null;
            }
            else
            {
                ViewBag.AssetDetails = asm.GetAssets();
            }
            MachineType();
            AssetStatus();
            return(View());
        }
Пример #21
0
        public IEnumerable <object> ConfigureAssets()
        {
            AssetsManagement asm = new AssetsManagement();

            return(asm.ConfigureAssets());
        }
Пример #22
0
        public IEnumerable <object> SearchAsset(AssetsManagement.Asset assetdata)
        {
            AssetsManagement asm = new AssetsManagement();

            return(asm.SearchAssets(assetdata));
        }
Пример #23
0
        public void AssetUnassign(int ID)
        {
            AssetsManagement asm = new AssetsManagement();

            asm.AssetUnassign(ID);
        }