コード例 #1
0
        // Get /proj_
        public ActionResult createStakeHolder(int id)
        {
            //            stakeholder stake = stakeholderInfo.GetStakeholder();
            stakeholderViewModel holder = new stakeholderViewModel
            {
                //_stakeholder_id          =   0,
                _stakeholder_first_name = string.Empty,
                _stakeholder_last_name  = string.Empty,
                _stakeholder_phone      = string.Empty,
                _stakeholder_gm_ext     = null,
                _stakeholder_email      = string.Empty,
                _notes       = string.Empty,
                _createdby   = User.Identity.Name.Replace("GREENSPOONMARDE\\", ""),
                _createddate = DateTime.Now
            };

            return(PartialView("_createStakeHolder", holder));
        }
コード例 #2
0
        public ActionResult createStakeHolder(stakeholderViewModel stakeholderViewModel, int id)
        {
            string projDesc = projectInfo.returnProjectDescription(id);

            if (ModelState.IsValid)
            {
                var s = new proj_stakeholder
                {
                    proj_info_id   = id,
                    stakeholder_id = stakeholderViewModel._stakeholder_id,
                    createdby      = stakeholderViewModel._createdby,
                    createddate    = stakeholderViewModel._createddate.Value
                };
                _ctx.proj_stakeholder.Add(s);
                _ctx.SaveChanges();

                return(RedirectToAction("Index", new { searchTerm = projDesc }));
            }

            return(View(stakeholderViewModel));
        }