public static bool creatActor(t_GZL_Actor actor) { using(DataClassesEduDataContext dc = new DataClassesEduDataContext()) { dc.t_GZL_Actor.InsertOnSubmit(actor); dc.SubmitChanges(); return true; } }
public static bool updateActor(t_GZL_Actor actor) { using (DataClassesEduDataContext dc = new DataClassesEduDataContext()) { t_GZL_Actor a = dc.t_GZL_Actor.Where(u => u.actorId == actor.actorId).Single(); a.actorName = actor.actorName; a.sortNo = actor.sortNo; dc.SubmitChanges(); return true; } }
protected void btAdd_Click(object sender, EventArgs e) { int routid = Convert.ToInt32( Request["routid"]); String actorname = tbActorName.Text; String sortno = tbSortNo.Text; t_GZL_Actor actor = new t_GZL_Actor(); actor.actorName = actorname; actor.sortNo = Convert.ToInt32(sortno); actor.routId = routid; if (BLL.Application.GZL.Setting.ActorManagement.creatActor(actor)) lbMessage.Text = "添加步骤成功"; databind(); }