本文整理汇总了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");
}
}
示例2: UpdateCompositionsEquipes
public ActionResult UpdateCompositionsEquipes(Models.CompositionsEquipes compo)
{
if (ModelState.IsValid)
{
compo.Update();
return RedirectToAction("Index");
}
else
return View(compo);
}
示例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 );
}
}
}
示例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);
}
示例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;
}
}
示例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");
}
}
示例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);
}
示例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");
}
}
示例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");
}
}
示例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);
}
示例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);
}