using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; public partial class Financial_YFAdd : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ZWL.Common.PublicMethod.CheckSession(); } } protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { DataEntityDataContext context = new DataEntityDataContext(); ERPYS Model = new ERPYS(); Model.HeTongName = this.txtHeTongName.Text.ToString(); Model.QianYueKeHu = this.txtQianYueKeHu.Text.ToString(); Model.HTJE = this.txtHeTongMiaoShu.Text.ToString(); Model.TiXingDate = DateTime.Parse(this.txtShengXiaoDate.Text); Model.DaoKuanDate = DateTime.Parse(this.txtTiXingDate.Text); Model.CreateTime = DateTime.Now; Model.CreateUser = ZWL.Common.PublicMethod.GetSessionValue("UserName"); Model.BackInfo = this.txtBackInfo.Text.ToString(); Model.SFDK = this.DZ.Value; Model.NowState = "F"; context.ERPYS.InsertOnSubmit(Model); context.SubmitChanges(); //写系统日志 ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi(); MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName"); MyRiZhi.DoSomething = "用户添加应付计划信息(" + this.txtHeTongName.Text + ")"; MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString(); MyRiZhi.Add(); ZWL.Common.MessageBox.ShowAndRedirect(this, "应付信息添加成功!", "YF.aspx"); } }