/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnNew_Click(object sender, EventArgs e) { string enterpriseName = this.EnterpriseName.Text.Trim(); string linkman = this.Linkman.Text.Trim(); string linktel = this.LinkTel.Text.Trim(); string email = this.Email.Text.Trim(); string needinfo = this.NeedInfo.Text.Trim(); try { using (ZLzuche.Model.ZLzucheEntities entity = new Model.ZLzucheEntities()) { ZLzuche.Model.rzzlApply model = new Model.rzzlApply(); model.EnterpriseName = enterpriseName; model.Linkman = linkman; model.LinkTel = linktel; model.Email = email; model.NeedInfo = needinfo; model.ApplyTime = DateTime.Now; entity.AddTorzzlApply(model); entity.SaveChanges(); ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('申请成功');window.close();</script>"); } } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('新增失败');</script>"); return; } }
/// <summary> /// 创建新的 rzzlApply 对象。 /// </summary> /// <param name="id">ID 属性的初始值。</param> public static rzzlApply CreaterzzlApply(global::System.Int32 id) { rzzlApply rzzlApply = new rzzlApply(); rzzlApply.ID = id; return rzzlApply; }
/// <summary> /// 用于向 rzzlApply EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet<T> 属性的 .Add 方法。 /// </summary> public void AddTorzzlApply(rzzlApply rzzlApply) { base.AddObject("rzzlApply", rzzlApply); }