protected void btn_submit_Click(object sender, EventArgs e) { WebModels.Tbl_ProjectBuilderLog log = new WebModels.Tbl_ProjectBuilderLog(); log.ProjectID = Convert.ToInt32(this.ProjectID.SelectedValue); log.PBL_Time = Convert.ToDateTime(this.PBL_Time.Text); log.PBL_Whether = this.PBL_Whether.Value; log.PBL_Wind = this.PBL_Wind.Value; log.PBL_Temperature = this.PBL_Temperature.Value; log.PBL_Info1 = this.PBL_Info1.Value; log.PBL_Info1File = WebCommon.Public.UploadFile(PBL_Info1File, "ProjectBuilderLog"); log.PBL_Info2File = WebCommon.Public.UploadFile(PBL_Info2File, "ProjectBuilderLog"); log.PBL_Info3File = WebCommon.Public.UploadFile(PBL_Info3File, "ProjectBuilderLog"); log.PBL_Info2 = this.PBL_Info2.Value; log.PBL_Info3 = this.PBL_Info3.Value; log.DealUser = WebCommon.Public.GetUserName(); int count = WebBLL.Tbl_ProjectBuilderLogManager.AddTbl_ProjectBuilderLog(log); if (count > 0) { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('添加成功!');window.external.reload();window.external.close();", true); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('添加失败!');", true); } }
protected void Bind() { int ID = Convert.ToInt32(Request.QueryString["id"]); WebModels.Tbl_ProjectBuilderLog log = WebBLL.Tbl_ProjectBuilderLogManager.GetTbl_ProjectBuilderLogById(ID); this.PBL_Time.Text = log.PBL_Time.ToString("yyyy-MM-dd"); this.PBL_Whether.Value = log.PBL_Whether; this.PBL_Temperature.Value = log.PBL_Temperature; this.PBL_Wind.Value = log.PBL_Wind; this.PBL_Info1.Value = log.PBL_Info1; this.PBL_Info2.Value = log.PBL_Info2; this.PBL_Info3.Value = log.PBL_Info3; WebModels.Tbl_Project project = WebBLL.Tbl_ProjectManager.GetTbl_ProjectById(log.ProjectID); ProjectID.Items.Insert(0, new ListItem(project.ProjectName, project.ID.ToString())); }