本文整理汇总了C#中Models.getXmlPath方法的典型用法代码示例。如果您正苦于以下问题:C# Models.getXmlPath方法的具体用法?C# Models.getXmlPath怎么用?C# Models.getXmlPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Models
的用法示例。
在下文中一共展示了Models.getXmlPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: editbugReports
public bool editbugReports(Models.GridModel g)
{
if (g.Save(g, g.getXmlPath()))
return true;
else
return false;
}
示例2: Delete
public ActionResult Delete(string id, Models.GridModel model)
{
// We got here from an ActionLink, so no data is posted,
// but we do get the link's id.
int selected = Int32.Parse(id);
model.Bugs.RemoveAt(selected);
model.Save(model, model.getXmlPath());
return RedirectToAction("List");
}
示例3: Insert
public ActionResult Insert(Models.BugReport cmodel, Models.GridModel model)
{
// We got here from a submit button on the Insert form, one of two
// in the Show.aspx view. Therefore, model data was sent to us
// via the cmodel parameter, but we don't get an id.
int cnt = Int32.Parse(model.count);
cnt++;
cmodel.Id = cnt.ToString();
model.count = cnt.ToString();
model.Bugs.Add(cmodel);
cmodel.DateAdded = DateTime.Today.ToShortDateString();
model.Save(model, model.getXmlPath());
return RedirectToAction("List");
}
示例4: Save
public ActionResult Save(Models.BugReport cmodel, Models.GridModel model)
{
// We get here when a "Save" submit button is clicked, so an Http Post
// message was used. Thus, we get model data sent up via the cmodel
// parameter, however we can't get an id number. That comes only with
// the actionlinks.
// Therefore we used a Session["selected"] value to transfer
// this one datum from the view to this controller method.
int selected = (int)Session["selected"];
model.Bugs[selected].EmpId = cmodel.EmpId;
model.Bugs[selected].Title = cmodel.Title;
model.Bugs[selected].Requirement = cmodel.Requirement;
model.Bugs[selected].ProjectName = cmodel.ProjectName;
model.Bugs[selected].BugDesc = cmodel.BugDesc;
model.Bugs[selected].SeverityLevel = cmodel.SeverityLevel;
model.Bugs[selected].Solution = cmodel.Solution;
model.Bugs[selected].DateAdded = cmodel.DateAdded;
model.Bugs[selected].LastModifiedDate = cmodel.LastModifiedDate;
model.Bugs[selected].ResolvedDate = cmodel.ResolvedDate;
model.Bugs[selected].Checked = false;
if(model.Save(model, model.getXmlPath()))
return RedirectToAction("Detail/" +selected);
else
{
Session["ErrorMessage"] = "Failed To Submit Changes";
return RedirectToAction("ErrorPage", "Home");
}
}