本文整理汇总了C#中Models.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Models.Save方法的具体用法?C# Models.Save怎么用?C# Models.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Models
的用法示例。
在下文中一共展示了Models.Save方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: editbugReports
public bool editbugReports(Models.GridModel g)
{
if (g.Save(g, g.getXmlPath()))
return true;
else
return false;
}
示例2: Create
public ActionResult Create(Models.ProjectModel P,Models.Project Pr)
{
Pr.Start_Date = DateTime.Today;
Pr.ProjectStatusID = 1;
P.Save(Pr);
return RedirectToAction("List");
}
示例3: 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");
}
示例4: Create
public ActionResult Create(Models.WorkPackageDescription wpd,Models.WorkPackageModel w)
{
wpd.Wp_Date = DateTime.Today;
if( w.Save(wpd))
return RedirectToAction("List");
else
{
Session["ErrorMessage"] = "Failed To Submit Changes";
return RedirectToAction("ErrorPage", "Home");
}
}
示例5: Create
public ActionResult Create( Models.StatusReportModel S,Models.StatusReport sr)
{
if (S.Save(sr))
{
return RedirectToAction("Status");
}
else
{
Session["ErrorMessage"] = "Failed To Submit Changes";
return RedirectToAction("ErrorPage", "Home");
}
}
示例6: Create
public ActionResult Create(Models.SoftwareReqtsModel S, Models.Software_Requirement sr)
{
sr.Sr_Date = DateTime.Now;
if (S.Save(sr))
{
return RedirectToAction("List");
}
else
{
Session["ErrorMessage"] = "Failed To Submit Changes";
return RedirectToAction("ErrorPage", "Home" );
}
}
示例7: 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");
}
示例8: Post
public Models.User Post(Models.UserModel value)
{
if (value.Oid > 0) // edit
{
if (!Validators.Validator.IsValid(value, "Password", "ConfirmPassword"))
throw new ArgumentException();
var user = value.Save();
if (user != null)
user.PasswordHash = String.Empty;
return user;
}
else
{
if (!Validators.Validator.IsValid(value)) // need to pass in properties to ignore...
throw new ArgumentException();
return Models.User.CreateUser(value.Username, value.EmailAddress, value.Password, value.UserRole, value.Administrator);
}
}
示例9: SchedulesDirect
public bool SchedulesDirect(Models.SchedulesDirectModel Model)
{
return Model.Save();
}
示例10: 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");
}
}
示例11: SaveInvestor
public IEnumerable<Helpers.ErrorInfo> SaveInvestor(Models.Entity.Investor investor)
{
return investor.Save();
}
示例12: SaveRecording
public bool SaveRecording(Models.RecordingSchedule Schedule)
{
var user = this.GetUser();
return Schedule.Save(user.Oid);
}
示例13: SaveFund
public IEnumerable<Helpers.ErrorInfo> SaveFund(Models.Entity.Fund fund)
{
return fund.Save();
}
示例14: UpdateRecurring
public bool UpdateRecurring(Models.RecurringRecording RecurringRecording)
{
var user = this.GetUser();
return RecurringRecording.Save(user.Oid);
}