public ActionResult Available()
        {
            List <AvailableListingGeneralInfoView> model = AvailableListingGeneralInfoHelpers.GetAllAvailableListingsGeneralInfoView(User);

            Company userCompany = CompanyHelpers.GetCompanyForUser(User);

            ViewBag.CurrentCompanyId = userCompany.CompanyId;

            return(View(model));
        }
        public ActionResult Requirements()
        {
            List <RequirementListingGeneralInfoView> model = RequirementListingGeneralInfoHelpers.GetAllRequirementListingsGeneralInfoView(User);

            Company userCompany = CompanyHelpers.GetCompanyForUser(User);

            ViewBag.CurrentCompanyId = userCompany.CompanyId;

            return(View(model));
        }
示例#3
0
        public ActionResult ProcessButton(string buttonName)
        {
            string[] keys = buttonName.Split(':');

            string buttonType    = keys[0];
            string buttonLevel   = keys[1];
            Guid   ofReferenceId = Guid.Empty;
            Guid   byAppUserId   = Guid.Empty;

            Guid.TryParse(keys[2], out ofReferenceId);
            Guid.TryParse(keys[3], out byAppUserId);

            Guid      byReferenceId = Guid.Empty;
            LevelEnum levelEnum     = LevelEnum.User;

            //Set the byReference to be either the user, the user's branch or the user's company depending on level
            switch (buttonLevel)
            {
            case "company":
                levelEnum     = LevelEnum.Company;
                byReferenceId = CompanyHelpers.GetCompanyForUser(byAppUserId).CompanyId;
                break;

            case "branch":
                levelEnum     = LevelEnum.Branch;
                byReferenceId = AppUserHelpers.GetAppUser(byAppUserId).CurrentBranchId;
                break;

            case "user":
                levelEnum     = LevelEnum.User;
                byReferenceId = byAppUserId;
                break;
            }

            switch (buttonType)
            {
            case "block":
                BlockHelpers.CreateBlock(levelEnum, ofReferenceId, byReferenceId, byAppUserId);
                break;

            case "friend":
                FriendHelpers.CreateFriend(levelEnum, ofReferenceId, byReferenceId, byAppUserId);
                break;

            case "group":
                //Need to go to Group screen to select a group or allow adding of a new group
                return(RedirectToAction("Create", "Groups", new { level = levelEnum, ofReferenceId = ofReferenceId, byReferenceId = byReferenceId, appUserid = byAppUserId }));
            }

            return(Json(new { success = true }));
        }
示例#4
0
        //// GET: Branches
        //public ActionResult Index()
        //{
        //    return View(db.Branches.ToList());
        //}

        //// GET: Branches/Details/5
        //public ActionResult Details(Guid? id)
        //{
        //    if (id == null)
        //    {
        //        return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
        //    }
        //    Branch branch = db.Branches.Find(id);
        //    if (branch == null)
        //    {
        //        return HttpNotFound();
        //    }
        //    return View(branch);
        //}

        // GET: Branches/Create
        public ActionResult Create()
        {
            ViewBag.CompanyId = CompanyHelpers.GetCompanyForUser(User).CompanyId;
            return(View());
        }