当前位置: 首页>>代码示例>>C#>>正文


C# Models.Update方法代码示例

本文整理汇总了C#中Models.Update方法的典型用法代码示例。如果您正苦于以下问题:C# Models.Update方法的具体用法?C# Models.Update怎么用?C# Models.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Models的用法示例。


在下文中一共展示了Models.Update方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Submit

        public ActionResult Submit(Models.StatusReportModel S, Models.StatusReport sr)
        {
            int id;
            id = Convert.ToInt32(Session["status"].ToString());

            foreach (Models.StatusReport s in S.StR)
            {
                if (s.StatusReportID == id)
                {
                    s.ReportTitle = sr.ReportTitle;
                    s.StatusReportLog = sr.StatusReportLog;

                    s.Wp_Id = sr.Wp_Id;

                }

            }
               if( S.Update())
            return RedirectToAction("DetailView/" + id);

               else
            {
                Session["ErrorMessage"] = "Failed To Submit Changes";
                return RedirectToAction("ErrorPage", "Home");
            }
        }
开发者ID:mukund24,项目名称:Project-Center,代码行数:26,代码来源:StatusReportsController.cs

示例2: UpdateCompositionsEquipes

 public ActionResult UpdateCompositionsEquipes(Models.CompositionsEquipes compo)
 {
     if (ModelState.IsValid)
     {
         compo.Update();
         return RedirectToAction("Index");
     }
     else
         return View(compo);
 }
开发者ID:Dave1840438,项目名称:Session5-TP-MVC-Chourot,代码行数:10,代码来源:CompositionsEquipesController.cs

示例3: Post

		public async Task<HttpResponseMessage> Post( Models.Tag PostedTag ) {
			using( SqlConnection Connection = new SqlConnection( RoleEnvironment.GetConfigurationSettingValue( "DatabaseConnectionString" ) ) ) {
				Connection.Open();

				if( -1 == PostedTag.Id ) {
					await PostedTag.Insert( Connection );
					HttpResponseMessage Response = new HttpResponseMessage( HttpStatusCode.Created );
					Response.Content = new StringContent( await JsonConvert.SerializeObjectAsync( PostedTag ) );
					return Response;
				} else {
					await PostedTag.Update( Connection );
					return new HttpResponseMessage( HttpStatusCode.OK );
				}
			}
		}
开发者ID:freestylecoder,项目名称:DevSpace2015,代码行数:15,代码来源:TagsController.cs

示例4: UpdateJoueur

        public ActionResult UpdateJoueur(Models.Joueurs joueur)
        {
            if (ModelState.IsValid)
            {
                WebImage logo = WebImage.GetImageFromRequest();

                if (logo != null)
                    joueur.Photo = saveImageToServer(logo);

                joueur.Update();

                return RedirectToAction("Index");
            }
            else
                return View(joueur);
        }
开发者ID:Dave1840438,项目名称:Session5-TP-MVC-Chourot,代码行数:16,代码来源:JoueursController.cs

示例5: Post

		public async Task<HttpResponseMessage> Post( Models.Session PostedSession ) {
			using( SqlConnection Connection = new SqlConnection( RoleEnvironment.GetConfigurationSettingValue( "DatabaseConnectionString" ) ) ) {
				Connection.Open();
				HttpResponseMessage Response = new HttpResponseMessage();

				if( PostedSession.Id == -1 ) {
					Response.StatusCode = HttpStatusCode.Created;
					await PostedSession.Insert( Connection );
				} else {
					Response.StatusCode = HttpStatusCode.OK;
					await PostedSession.Update( Connection );
				}

				Response.Content = new StringContent( await Newtonsoft.Json.JsonConvert.SerializeObjectAsync( PostedSession, Formatting.None ) );
				return Response;
			}
		}
开发者ID:freestylecoder,项目名称:DevSpace2015,代码行数:17,代码来源:SessionsController.cs

示例6: Submit

        public ActionResult Submit(Models.ProjectModel P, Models.Project Pr)
        {
            int id;
            id=Convert.ToInt32(Session["prid"].ToString());
            foreach (Models.Project p in P.ProjectList)
            {
                if (p.ProjectID == id)
                {
                    p.End_Date = Pr.End_Date;
                    p.Last_Review_Date = Pr.Last_Review_Date;
                    p.Project_Desc = Pr.Project_Desc;
                    p.ProjectName = Pr.ProjectName;
                    p.ManagerID = Pr.ManagerID;
                    p.ProjectStatusID = Pr.ProjectStatusID;
                }

            }
            if(P.Update())
            return RedirectToAction("DetailView/"+id);
            else
            {
                Session["ErrorMessage"] = "Failed To Submit Changes";
                return RedirectToAction("ErrorPage", "Home");
            }
        }
开发者ID:mukund24,项目名称:Project-Center,代码行数:25,代码来源:ProjectsController.cs

示例7: UpdateESport

        public ActionResult UpdateESport(Models.Esports esport)
        {
            if (ModelState.IsValid)
            {
                WebImage logo = WebImage.GetImageFromRequest();
                if (logo != null)
                {
                    String newFileName = Guid.NewGuid().ToString() + "_" + Path.GetFileName(logo.FileName);
                    String fullPath = @"Images/" + newFileName;
                    string folderPath = Server.MapPath(@"~/Images");
                    if (!Directory.Exists(folderPath))
                        Directory.CreateDirectory(folderPath);

                    logo.Save(@"~/" + fullPath);
                    esport.Logo = newFileName;
                }

                esport.Update();

                return RedirectToAction("Contact");
            }
            else
                return View(esport);
        }
开发者ID:Dave1840438,项目名称:Session5-TP-MVC-Chourot,代码行数:24,代码来源:HomeController.cs

示例8: Submit

        public ActionResult Submit(Models.SoftwareReqtsModel S, Models.Software_Requirement sr)
        {
            int id;
            id=Convert.ToInt32(Session["srid"].ToString());

            foreach (Models.Software_Requirement s in S.Sr)
            {
                if (s.Sr_ID == id)
                {
                    s.Sr_Desc = sr.Sr_Desc;
                    s.Sr_IssuesText = sr.Sr_IssuesText;
                    s.Sr_Title = sr.Sr_Title;
                    s.ProjectID = sr.ProjectID;

                }

            }
            if(S.Update())
            return RedirectToAction("DetailedView/"+id);

            else
            {
                Session["ErrorMessage"] = "Failed To Submit Changes";
                return RedirectToAction("ErrorPage", "Home");
            }
        }
开发者ID:mukund24,项目名称:Project-Center,代码行数:26,代码来源:Software_ReqtsController.cs

示例9: Submit

        public ActionResult Submit(Models.WorkPackageDescription wpd, Models.WorkPackageModel w)
        {
            int id;
            id = Convert.ToInt32(Session["wpid"].ToString());
            foreach (Models.WorkPackageDescription x in w.WorkPackageList)
            {
                if (x.Wp_Id == id)
                {
                    x.Wp_Title = wpd.Wp_Title;
                    x.Wp_Description = wpd.Wp_Description;
                    x.ProjectID = wpd.ProjectID;
                    x.CreatedBy = wpd.CreatedBy;
                }

            }
               if( w.Update())
            return RedirectToAction("Detail/" + id);
               else
               {
               Session["ErrorMessage"] = "Failed To Submit Changes";
               return RedirectToAction("ErrorPage", "Home");
               }
        }
开发者ID:mukund24,项目名称:Project-Center,代码行数:23,代码来源:WorkPackageController.cs

示例10: UpdateTeam

        public ActionResult UpdateTeam(Models.Teams team)
        {
            if (ModelState.IsValid)
            {
                WebImage logo = WebImage.GetImageFromRequest();

                if (logo != null)
                    team.LogoEquipe = saveImageToServer(logo);

                team.Update();

                return RedirectToAction("Index");
            }
            else
                return View(team);
        }
开发者ID:Dave1840438,项目名称:Session5-TP-MVC-Chourot,代码行数:16,代码来源:TeamsController.cs

示例11: UpdateESport

        public ActionResult UpdateESport(Models.Esports esport)
        {
            if (ModelState.IsValid)
            {
                WebImage logo = WebImage.GetImageFromRequest();

                if (logo != null)
                    esport.Logo = saveImageToServer(logo);

                esport.Update();

                return RedirectToAction("Index");
            }
            else
                return View(esport);
        }
开发者ID:Dave1840438,项目名称:Session5-TP-MVC-Chourot,代码行数:16,代码来源:ESportsController.cs


注:本文中的Models.Update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。