コード例 #1
0
ファイル: TeamController.cs プロジェクト: amirrezabarin/WERC
        public ActionResult Create(VmTeam model)
        {
            var result = -1;
            var blTeam = new BLTeam();

            model.CurrentUserId = CurrentUserId;

            try
            {
                if (ModelState.IsValid)
                {
                    if (model.UploadedDocument != null)
                    {
                        model.TeamImageUrl = UIHelper.UploadFile(model.UploadedDocument, "/Resources/Uploaded/Teams/" + CurrentUserId.Replace("-", ""));
                    }
                }

                result = blTeam.CreateTeam(model);
            }

            catch (Exception ex)
            {
                result = -1;
            }


            if (result != -1)
            {
                return(RedirectToAction("tl", "Advisor", new { activeItemId = result }));
            }

            model.ActionMessageHandler.Message = "Operation has been failed...\n";

            return(View("../Advisor/CreateTeam", model));
        }