protected void btnconfirm_Click(object sender, EventArgs e) { custtransEntity trans = new custtransEntity(); trans.Ttitle = this.txtttitle.Text; trans.Tgcustom = this.txtpname.Text; trans.Tglinkuser = this.txttransuser.Text; trans.Tcontent = this.txtcontent.Text; trans.Tdiopen = this.dropti.SelectedItem.Text; trans.Ttype = this.dropswtype.SelectedItem.Text; trans.Tdifinish = this.dropfinish.SelectedItem.Text; trans.Tdidate = this.txtditime.Text; trans.Tdate = this.txttranstime.Text; trans.Treader = Session["username"].ToString();//"honey";//session if (Request.QueryString["action"] == "update") { trans.Id = cid; int i = custransBll.updateCusnote(trans); if (i > 0) { js("更新成功!"); action = ""; } } else { int i = custransBll.insertCusnote(trans); if (i>0) { js("录入成功!"); } } Response.Redirect("custranlist.aspx"); }
public static int getCommcountun(string mark, custtransEntity custinfo) { string strWhere = ""; strWhere = " tdifinish='ĩ���'"; return conString.Getcommentcount("custom_tranction", "id", strWhere); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["id"])) { this.txtcid.Text = Request.QueryString["id"]; trans = custransBll.getcusnoteInfo(Request.QueryString["id"]); } } }
public static int getCommcount(string mark, custtransEntity custinfo) { string strWhere = ""; if (mark == "begin") { strWhere = ""; } else { strWhere = " ttitle like '" + custinfo.Ttitle + "%' and convert(datetime,tdate) >= convert(datetime, '" + custinfo.Btime + "') and convert(datetime,tdate) <= convert(datetime,'" + custinfo.Etime + "') "; } return conString.Getcommentcount("custom_tranction", "id", strWhere); }
/// <summary> /// ��ü�¼��Ϣ�� /// </summary> /// <param name="id"></param> /// <returns></returns> public static custtransEntity getcusnoteInfo(string id) { custtransEntity note = new custtransEntity(); string sql = "select * from custom_tranction where id=" + id; using (SqlDataReader dr = SqlHelper.ExecuteReader(DataBll.conString.constr, CommandType.Text, sql)) { if (dr.Read()) { note.Ttitle = dr["ttitle"].ToString(); note.Tgcustom = dr["tgcustom"].ToString(); note.Tglinkuser = dr["tglinkuser"].ToString(); note.Tdate = dr["tdate"].ToString(); note.Tdidate = dr["tdidate"].ToString(); note.Tcontent = dr["tcontent"].ToString(); note.Tdiopen = dr["tdiopen"].ToString(); note.Tdifinish = dr["tdifinish"].ToString(); note.Treader = dr["treader"].ToString(); note.Ttype = dr["ttype"].ToString(); } } return note; }
void bindlikedata(int pi, int ps, custtransEntity custinfo) { this.Repeater1.DataSource = custransBll.getCusnoteinfo("", pi, ps, custinfo); this.Repeater1.DataBind(); int pagecount = custransBll.getCommcount("", custinfo); this.AspNetPager1.PageSize = pageSize; this.AspNetPager1.RecordCount = pagecount; this.AspNetPager1.CustomInfoHTML = "总:" + AspNetPager1.RecordCount.ToString() + "条,每页:%PageSize%条,当前:%CurrentPageIndex%/%PageCount%"; }
/// <summary> /// �������� /// </summary> /// <param name="note"></param> /// <returns></returns> public static int updateCusnote(custtransEntity note) { string sql = "update custom_tranction set ttitle='" + note.Ttitle + "',tgcustom='" + note.Tgcustom + "',tglinkuser='******',tdate='" + note.Tdate + "',tdidate='" + note.Tdidate + "',tcontent='" + note.Tcontent + "',tdiopen='" + note.Tdiopen + "',tdifinish='" + note.Tdifinish + "',treader ='" + note.Treader + "',ttype='"+note.Ttype+"' where id=" + note.Id.ToString(); return SqlHelper.ExecuteNonQuery(DataBll.conString.constr, CommandType.Text, sql); }
/// <summary> /// �����¼��Ϣ /// </summary> /// <param name="note"></param> /// <returns></returns> /// public static int insertCusnote(custtransEntity note) { string sql = "insert into custom_tranction ( ttitle,tgcustom,tglinkuser,tdate,tdidate,tcontent,tdiopen,tdifinish,treader,ttype ) values"; sql += "('" + note.Ttitle + "','" + note.Tgcustom + "','" + note.Tglinkuser + "','" + note.Tdate + "','" + note.Tdidate + "','" + note.Tcontent + "','" + note.Tdiopen + "','" + note.Tdifinish + "','" + note.Treader + "','" + note.Ttype + "')"; return SqlHelper.ExecuteNonQuery(DataBll.conString.constr, CommandType.Text, sql); }
public static DataSet getCusnoteinfoun(string mark, int pi, int ps, custtransEntity custinfo) { string tablename = " custom_tranction "; string sortfld = " id "; string selecfld = " *"; string PrimaryKey = "id"; int pageindex = pi; int pagesize = ps; int sortType = 1; string strWhere = ""; strWhere = " tdifinish='ĩ���'"; string strM = "id"; return conString.GetcommdataSource(tablename, PrimaryKey, sortfld, pagesize, pageindex, sortType, strWhere, strM, selecfld); }
/// <summary> /// /// </summary> /// <param name="mark">begin �����ʼ��</param> /// <param name="pi"></param> /// <param name="ps"></param> /// <param name="custinfo"></param> /// <returns></returns> public static DataSet getCusnoteinfo(string mark, int pi, int ps, custtransEntity custinfo) { string tablename = " custom_tranction "; string sortfld = " id "; string selecfld = " *"; string PrimaryKey = "id"; int pageindex = pi; int pagesize = ps; int sortType = 1; string strWhere = ""; if (mark == "begin") { strWhere = ""; } else { strWhere = " ttitle like '" + custinfo.Ttitle + "%' and convert(datetime,tdate) >= convert(datetime, '" + custinfo.Btime + "') and convert(datetime,tdate) <= convert(datetime,'" + custinfo.Etime + "') "; } string strM = "id"; return conString.GetcommdataSource(tablename, PrimaryKey, sortfld, pagesize, pageindex, sortType, strWhere, strM, selecfld); }