public ActionResult Create()
        {
            qbModels = new QBModels();
            qbModels.SyncObjectsModel    = new QBSyncdto();
            qbModels.OAuthorizationModel = new QBAuthorizationdto();
            qbModels.IsReadySync         = false;
            var oAuthModel = new QBOAuthService(qbModels.OAuthorizationModel).IsTokenAvailable(this, siteusercompanyid);

            ViewBag.IsQBConnected = "false";
            if (oAuthModel.IsConnected)
            {
                ViewBag.IsConnected = "true";
                //qbModels.IsReadySync = true;
                //qbModels.OAuthorizationModel = oAuthModel;
                //qbModels.IsConnected = oAuthModel.IsConnected;
                //var syncService = new QBSyncService(oAuthModel);
                //qbModels.SyncObjectsModel.OauthToken = oAuthModel;
                //Random random = new Random();
                //SyncObjectsModelId = random.Next(1, 100);
                //ViewBag.IsQBConnected = "true";
                //SyncObjectsModelId = qbModels.SyncObjectsModel.Id;
            }
            ViewBag.Group        = new SelectList(db.GetGroupsBySiteCoID(base.siteusercompanyid).ToList(), nameof(GetGroupsBySiteCoID_Result.ViewID), nameof(GetGroupsBySiteCoID_Result.Group));
            ViewBag.Manufacturer = new SelectList(db.GetManufacturersBySiteCoID(base.siteusercompanyid).ToList(), nameof(GetManufacturersBySiteCoID_Result.ViewID), nameof(GetManufacturersBySiteCoID_Result.Name));
            return(View());
        }
Esempio n. 2
0
        // This list displays Items to the Project
        public ActionResult List(int ProjectID)
        {
            int siteCoID = base.siteusercompanyid;

            ViewBag.ProjectID = ProjectID;

            // ViewBag.CoItems = db.GetItemsBySiteCoID(siteCoID).ToList();

            ViewBag.Divisions        = new SelectList(db.GetDivisionsByProjectID(Convert.ToInt32(ProjectID)), nameof(GetDivisionsByProjectID_Result.ViewID), nameof(GetDivisionsByProjectID_Result.Division));
            ViewBag.Areas            = new MultiSelectList(db.GetAreasByProjectID(Convert.ToInt32(ProjectID)), nameof(GetAreasByProjectID_Result.ViewID), nameof(GetAreasByProjectID_Result.Division));
            ViewBag.GroupList        = db.GetGroupsBySiteCoID(siteCoID).Where(s => s.Group != null && s.Group != "").ToList();
            ViewBag.ManufacturerList = db.GetManufacturersBySiteCoID(siteCoID).Where(s => s.Name != null && s.Name != "").ToList();
            ViewBag.StageList        = db.GetMasterStagesBySiteID(siteCoID).Where(s => s.Stage != null && s.Stage != "").ToList();

            return(View());
        }
        public ActionResult Index()
        {
            int siteCoID = base.siteusercompanyid;

            ViewBag.CoGroups = db.GetGroupsBySiteCoID(siteCoID);

            return(View());
        }