//json to display status page
        public JsonResult jsonStatusUserView(string CompanyId)
        {
            PerformCompanyComponentWithStatusIncident PerformStatusObj = new PerformCompanyComponentWithStatusIncident();
            List <DBComponent_With_Status>            ModelStatus      = PerformStatusObj.mGetStatus(Int32.Parse(CompanyId));

            return(Json(ModelStatus, JsonRequestBehavior.AllowGet));
        }
        //controller to add new company account by admin
        public string jsonCompanyRetrieve(string pstrJsonCompanyName, string pstrJsonCompanyURL, string pstrJsonPrimary, string pstrJsonSecondary)
        {
            PerformCompanyComponentWithStatusIncident CompanyAddAccountObj = new PerformCompanyComponentWithStatusIncident();
            string catchExceptionCompany = CompanyAddAccountObj.mSaveAddCompanyDetails(pstrJsonCompanyName, pstrJsonCompanyURL, pstrJsonPrimary, pstrJsonSecondary);

            return(catchExceptionCompany);
        }
        //controller to return master component list from database
        public JsonResult getMasterComponentDataFromDataBase()
        {
            PerformCompanyComponentWithStatusIncident      performObj = new PerformCompanyComponentWithStatusIncident();
            IEnumerable <DBMaster_DBComponent_With_Status> resultObj  = performObj.MasterComponentDataFromDB();

            return(Json(resultObj, JsonRequestBehavior.AllowGet));
        }
        //controller to return component details based on company name to component page
        public JsonResult ComponentandStatusFromDB(string pstrCompanyIdFromPage)
        {
            PerformCompanyComponentWithStatusIncident       performObj = new PerformCompanyComponentWithStatusIncident();
            IEnumerable <DummyClassForComponentPageDisplay> resultObj  = performObj.LoadExistingComponentsFromDataBase(Int32.Parse(pstrCompanyIdFromPage));

            return(Json(resultObj, JsonRequestBehavior.AllowGet));
        }
Beispiel #5
0
        //controller to display Company Page
        public ActionResult CompanyDashboard()
        {
            PerformCompanyComponentWithStatusIncident PerformCompanyComponentWithStatusIncidentObj = new PerformCompanyComponentWithStatusIncident();
            List <DBCompany> ModelCompany = PerformCompanyComponentWithStatusIncidentObj.mRetrieveCompanyDetails();

            return(View(ModelCompany));
        }
        public JsonResult jsonHistoryUserView(string mHistoryCompanyId)
        {
            PerformCompanyComponentWithStatusIncident PerformHistoryObj = new PerformCompanyComponentWithStatusIncident();
            List <DummyHistory> ModelHistory = PerformHistoryObj.mGetHistory(Int32.Parse(mHistoryCompanyId));

            return(Json(ModelHistory, JsonRequestBehavior.AllowGet));
        }
        //controller to fill the data center lists
        public JsonResult fillDataCenterListOnPage(string pstrDataCenterType)
        {
            PerformCompanyComponentWithStatusIncident performObj = new PerformCompanyComponentWithStatusIncident();
            List <DBDataCenter> testList = new List <DBDataCenter>();

            testList = performObj.fillingDataCenterListOnPage(pstrDataCenterType);
            return(Json(testList, JsonRequestBehavior.AllowGet));
        }
Beispiel #8
0
        //json to display status page
        public JsonResult jsonStatusUserView(jsonStatusServer jsonStatusServers)
        {
            string mStatusCompanyId = jsonStatusServers.jsonCompanyId;
            PerformCompanyComponentWithStatusIncident PerformStatusObj = new PerformCompanyComponentWithStatusIncident();
            List <GetStatus> ModelStatus = PerformStatusObj.mGetStatus(Int32.Parse(mStatusCompanyId));

            return(Json(ModelStatus, JsonRequestBehavior.AllowGet));
        }
        public string jsonSpecificComponentRetrieve(jsonSpecificComponentServer jsonSpecificComponentServers)
        {
            string mSpecificComponentNameSend   = jsonSpecificComponentServers.jsonSpecificComponentName.ToString();
            string mSpecificComponentStatusSend = jsonSpecificComponentServers.jsonSpecificComponentStatus.ToString();
            string mSpecificComponentCompanyId  = jsonSpecificComponentServers.jsonSpecificComponentCompanyId.ToString();
            string mSpecificComponentDataCenter = jsonSpecificComponentServers.jsonSpecificComponentDataCenter.ToString();

            PerformCompanyComponentWithStatusIncident SpecificComponentAddObj = new PerformCompanyComponentWithStatusIncident();
            string catchExceptionSpecificComponent = SpecificComponentAddObj.mSaveAddSpecificComponentDetails(mSpecificComponentNameSend, mSpecificComponentStatusSend, Int32.Parse(mSpecificComponentCompanyId), mSpecificComponentDataCenter);

            return(catchExceptionSpecificComponent);
        }
        //controller to add selected master components from page to company component list
        public string addMasterComponentToDB(string pstrMasterComponentListFromPage, string pstrCompanyId, string pstrPrimaryDataCenterName)
        {
            PerformCompanyComponentWithStatusIncident performObj = new PerformCompanyComponentWithStatusIncident();
            List <string> MasterComponentListFromPage            = new List <string>();

            string[] distributedMasterComponents = pstrMasterComponentListFromPage.Split(new char[] { '&' });
            foreach (var masterComponentFromPage in distributedMasterComponents)
            {
                string[] componentProp = masterComponentFromPage.Split(new char[] { '=' });
                MasterComponentListFromPage.Add(componentProp[1]);
            }
            return(performObj.AddComponentToDb(MasterComponentListFromPage, Int32.Parse(pstrCompanyId), pstrPrimaryDataCenterName));
        }
 //controller to display Company Page
 public ActionResult CompanyDashboard(string commonCheck)
 {
     if (commonCheck == "CheckIfTrueErrorWin")
     {
         PerformCompanyComponentWithStatusIncident PerformCompanyComponentWithStatusIncidentObj = new PerformCompanyComponentWithStatusIncident();
         List <DBCompany> ModelCompany = PerformCompanyComponentWithStatusIncidentObj.mRetrieveCompanyDetails();
         return(View(ModelCompany));
     }
     else
     {
         return(null);
     }
 }
        //controller to update the data Center in DB
        public void changeDataCenter(string pstrListOfCheckBoxes, string pstrCompanyId, string pstrDataCenterSelected)
        {
            List <int> mListOfCheckBoxes = new List <int>();

            string[] separatedCheckBoxes = pstrListOfCheckBoxes.Split(new char[] { '&' });
            foreach (string separateComponent in separatedCheckBoxes)
            {
                string[] componentProperty = separateComponent.Split(new char[] { '=' });
                mListOfCheckBoxes.Add(Int32.Parse(componentProperty[1]));
            }
            PerformCompanyComponentWithStatusIncident performObj = new PerformCompanyComponentWithStatusIncident();

            performObj.ChangingDataCenter(mListOfCheckBoxes, Int32.Parse(pstrCompanyId), pstrDataCenterSelected);
        }
        //controller to delete selected components
        public void deleteSelectedComponents(string pComponentList, string pCompanyId)
        {
            List <int> mListOfComponents = new List <int>();
            string     strResult         = string.Empty;

            string[] separatedCheckBoxes = pComponentList.Split(new char[] { '&' });
            foreach (string separateComponent in separatedCheckBoxes)
            {
                string[] componentProperty = separateComponent.Split(new char[] { '=' });
                mListOfComponents.Add(Int32.Parse(componentProperty[1]));
            }
            PerformCompanyComponentWithStatusIncident performObj = new PerformCompanyComponentWithStatusIncident();

            performObj.DeleteSelectedComponents(mListOfComponents, Int32.Parse(pCompanyId));
        }
        public void setPrimaryDataCenter(string pstrCompanyId, string pstrComponentsSelected, string pstrSelectedDataCenter)
        {
            PerformCompanyComponentWithStatusIncident performObj = new PerformCompanyComponentWithStatusIncident();

            List <int> mListOfComponents = new List <int>();
            string     strResult         = string.Empty;

            string[] separatedCheckBoxes = pstrComponentsSelected.Split(new char[] { '&' });
            foreach (string separateComponent in separatedCheckBoxes)
            {
                string[] componentProperty = separateComponent.Split(new char[] { '=' });
                mListOfComponents.Add(Int32.Parse(componentProperty[1]));
            }

            performObj.settingPrimaryDataCenter(Int32.Parse(pstrCompanyId), mListOfComponents, pstrSelectedDataCenter);
        }
        //controller to update the status of selected components
        public string updateStatusOfSelectedComponents(string pstrListOfCheckBoxes, string pstrStatusSelected, string pstrCompanyId)
        {
            List <int> mListOfCheckBoxes = new List <int>();
            string     strResult         = string.Empty;

            string[] separatedCheckBoxes = pstrListOfCheckBoxes.Split(new char[] { '&' });
            foreach (string separateComponent in separatedCheckBoxes)
            {
                string[] componentProperty = separateComponent.Split(new char[] { '=' });
                mListOfCheckBoxes.Add(Int32.Parse(componentProperty[1]));
            }
            PerformCompanyComponentWithStatusIncident performObj = new PerformCompanyComponentWithStatusIncident();

            strResult = performObj.UpdatingStatusOfComponentsSelected(mListOfCheckBoxes, pstrStatusSelected, Int32.Parse(pstrCompanyId));
            return(strResult);
        }
        public string jsonIncidentRetreive(jsonIncidentServer jsonIncidentServers)
        {
            string        mIncidentNameSend    = jsonIncidentServers.jsonIncidentName;
            string        mIncidentDetailsSend = jsonIncidentServers.jsonIncidentDetails;
            List <string> mComponentIdList     = jsonIncidentServers.jsonComponentIdList;
            int           mCompanyId           = Int32.Parse(jsonIncidentServers.jsonCompanyID);
            List <int>    componentIdList      = new List <int>();

            foreach (string componentId in mComponentIdList)
            {
                componentIdList.Add(Int32.Parse(componentId));
            }

            PerformCompanyComponentWithStatusIncident IncidentAddObj = new PerformCompanyComponentWithStatusIncident();
            string catchExceptionIncident = IncidentAddObj.mSaveAddIncidentDetails(mIncidentNameSend, mIncidentDetailsSend, componentIdList, mCompanyId);

            return(catchExceptionIncident);
        }
 //returns companyname from url
 public ActionResult userMasterPage(string pUserCompanyName)
 {
     if (pUserCompanyName != null)
     {
         PerformCompanyComponentWithStatusIncident PerformCompanyComponentWithStatusCompanyIdObj = new PerformCompanyComponentWithStatusIncident();
         if (PerformCompanyComponentWithStatusCompanyIdObj.mGetUserCompanyId(pUserCompanyName) != 0)
         {
             ViewBag.mUserCompanyId   = PerformCompanyComponentWithStatusCompanyIdObj.mGetUserCompanyId(pUserCompanyName);
             ViewBag.mUserCompanyName = pUserCompanyName;
             return(View(ViewBag));
         }
         else
         {
             return(null);
         }
     }
     else
     {
         return(null);
     }
 }
        //controller function to get incident details of component
        public JsonResult getIncidentDetailsOfComponent(string pstrComponentId)
        {
            PerformCompanyComponentWithStatusIncident performObj = new PerformCompanyComponentWithStatusIncident();

            return(Json(performObj.gettingIncidentDetailsOfComponent(Int32.Parse(pstrComponentId))));
        }
        //controller to get all components related to company
        public JsonResult getComponents(string pstrCompanyId)
        {
            PerformCompanyComponentWithStatusIncident performObj = new PerformCompanyComponentWithStatusIncident();

            return(Json(performObj.gettingComponents(Int32.Parse(pstrCompanyId)), JsonRequestBehavior.AllowGet));
        }
Beispiel #20
0
        //controller function to update incident details
        public void updateIncidentDetails(string pstrComponentId, string pstrExpectedDuration)
        {
            PerformCompanyComponentWithStatusIncident performObj = new PerformCompanyComponentWithStatusIncident();

            performObj.updatingIncidentDetails(Int32.Parse(pstrComponentId), Int32.Parse(pstrExpectedDuration));
        }
        //controller to delete existing incident
        public void deleteExistingIncidentOfComponent(string pstrComponentId, string pstrCompanyId)
        {
            PerformCompanyComponentWithStatusIncident performObj = new PerformCompanyComponentWithStatusIncident();

            performObj.deletingExistingIncidentOfComponent(Int32.Parse(pstrComponentId), Int32.Parse(pstrCompanyId));
        }
        //controller to check if incident exists
        public string checkIfIncidentExists(string pstrComponentId)
        {
            PerformCompanyComponentWithStatusIncident performObj = new PerformCompanyComponentWithStatusIncident();

            return(performObj.checkingIfIncidentExists(Int32.Parse(pstrComponentId)));
        }
        //controller to populate the data center list in component page
        public JsonResult getCompanyDetailWithId(string pstrCompanyId)
        {
            PerformCompanyComponentWithStatusIncident performObj = new PerformCompanyComponentWithStatusIncident();

            return(Json(performObj.populatingDataCenterListOnComponentPage(Int32.Parse(pstrCompanyId)), JsonRequestBehavior.AllowGet));
        }
        //controller to add new data center
        public void addDataCenterToDB(string pstrDataCenterName, string pstrDataCentertype)
        {
            PerformCompanyComponentWithStatusIncident performObj = new PerformCompanyComponentWithStatusIncident();

            performObj.AddingNewDataCenterToDB(pstrDataCenterName, pstrDataCentertype);
        }
Beispiel #25
0
        //controller function to load all the existing companies
        public JsonResult loadExistingCompanies()
        {
            PerformCompanyComponentWithStatusIncident performObj = new PerformCompanyComponentWithStatusIncident();

            return(Json(performObj.loadingExistingCompanies()));
        }