protected void GetValue(object sender, EventArgs e) { CommonDao<Model.SafePitFalls> newmgr = new CommonDao<SafePitFalls>(); SafePitFalls spf = new SafePitFalls(); if (Request.QueryString["fid"] != null) { spf = newmgr.FindById(Request.QueryString["fid"].ToString()); } spf.area = this.TextAreaQuYu.InnerText.Trim().ToString(); spf.time = this.TextBoxDate.Text.ToString(); spf.person = this.DropDownListPerson.Text.Trim().ToString(); spf.pitresult = this.TextAreaJieguo.InnerHtml.Trim().ToString(); if (this.TextBoxfk.Text.ToString()!="") { spf.Fine = Int32.Parse(this.TextBoxfk.Text.ToString()); } spf.pitsuggestion = this.TextAreaYijian.InnerHtml.Trim().ToString(); spf.pitcontents = this.TextAreaYinhuan.InnerText.Trim().ToString().Replace("\"", "'");//.Replace("\"", "\"\'\"") spf.dept = this.DropDownListDept.Text.ToString(); spf.createperson = "测试"; spf.createtime = DateTime.Now.ToString(); GetImg getimg = new GetImg(); spf.picurl = getimg.MyGetImgUrl(this.TextAreaYinhuan.InnerText.ToString()); if (Request.QueryString["fid"] != null) { if (newmgr.Update(spf)) { MessageBox.ShowAndRedirect(this, "恭喜您,安全隐患修改成功!", "SafeResAdd.aspx"); } MessageBox.Show(this, "Sorry,安全隐患修改失败!请您重试!"); } else { if (newmgr.Add(spf)) { MessageBox.ShowAndRedirect(this, "恭喜您,安全隐患添加成功!", "SafeResAdd.aspx"); } MessageBox.Show(this, "Sorry,安全隐患添加失败!请您重试!"); } }
private void GetYinHuanPai() { CommonDao<SafePitFalls> newmgr = new CommonDao<SafePitFalls>(); string condition = " "; SafePitFalls s = new SafePitFalls(); condition = condition + " datediff (D,time,getdate())<2 "; RepeaterPubGG.DataSource = newmgr.FindBydesc("10",condition,"time"); RepeaterPubGG.DataBind(); }