Beispiel #1
0
 /// <summary>
 /// ��ü�¼��Ϣ��
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public static selfgaoEntity getcusnoteInfo(string id)
 {
     selfgaoEntity note = new selfgaoEntity();
     string sql = "select * from self_gao where id=" + id;
     using (SqlDataReader dr = SqlHelper.ExecuteReader(DataBll.conString.constr, CommandType.Text, sql))
     {
         if (dr.Read())
         {
             note.Gdate = dr["gdate"].ToString();
             note.Gwhys = dr["gwhys"].ToString();
             note.Gtitle = dr["gtitle"].ToString();
             note.Gpalne = dr["gpalne"].ToString();
             note.Gcname = dr["gcname"].ToString();
             note.Glinkuser = dr["glinkuser"].ToString();
             note.Glinktel = dr["glinktel"].ToString();
             note.Goper = dr["goper"].ToString();
             note.Gscetion = dr["gscetion"].ToString();
             note.Goperdate = dr["goperdate"].ToString();
             note.Gcontent = dr["gcontent"].ToString();
             note.Gsqi = dr["gsqi"].ToString();
             note.Gsqisection = dr["gsqisection"].ToString();
             note.Gsqidate = dr["gsqidate"].ToString();
             note.Gsqistuta = dr["gsqistuta"].ToString();
             note.Gstyle = dr["gstyle"].ToString();
             note.Gclike = dr["gclike"].ToString();
             note.Gthing = dr["gthing"].ToString();
             note.Gmark = dr["gmark"].ToString();
             note.Sreader = dr["sreader"].ToString();
             note.Sreaddate = dr["sreaddate"].ToString();
         }
     }
     return note;
 }
Beispiel #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!string.IsNullOrEmpty(Request.QueryString["id"]))
         {
             this.txtcid.Text = Request.QueryString["id"].ToString();
             oper = selfgaoBll.getcusnoteInfo(Request.QueryString["id"]);
         }
     }
 }
Beispiel #3
0
 public static int getCommcount(string mark, selfgaoEntity  custinfo)
 {
     string strWhere = "";
     if (mark == "begin")
     {
         strWhere = "";
     }
     else
     {
         strWhere = " gcname like '" + custinfo.Gcname + "%' and   convert(datetime,gdate) >= convert(datetime, '" + custinfo.Btime + "') and convert(datetime,gdate) <= convert(datetime,'" + custinfo.Etime + "')  and gtitle like '" + custinfo.Gtitle + "%'";
     }
     return conString.Getcommentcount("self_gao", "id", strWhere);
 }
Beispiel #4
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        selfgaoEntity self = new selfgaoEntity();
        self.Gdate = this.txtgdate.Text;
        self.Gwhys = this.dropgwhys.SelectedItem.Text;
        self.Gtitle = this.txtgtitle.Text;
        self.Gpalne = this.dropgpalne.SelectedItem.Text;
        self.Gcname = this.txtgcname.Text;
        self.Glinkuser = this.txtglinkuser.Text;
        self.Glinktel = this.txtglinktel.Text;
        self.Goper = this.txtgoper.Text;
        self.Gscetion = this.dropgsqisection.SelectedItem.Text;
        self.Goperdate = this.txtgoperdate.Text;
        self.Gcontent = this.txtgcontent.Text;
        self.Gsqi = this.txtgsqi.Text;
        self.Gsqisection = this.dropgsqisection.SelectedItem.Text;
        self.Gsqidate = this.txtgsqidate.Text;
        self.Gsqistuta = this.dropgsqistuta.SelectedItem.Text;
        self.Gstyle = this.dropgstyle.SelectedItem.Text;
        self.Gclike = this.dropgclike.SelectedItem.Text;
        self.Gthing = this.txtgthing.Text;
        self.Gmark = this.txtgmark.Text;

        self.Sreader = Session["username"].ToString();//"honey";//session
        self.Sreaddate = DateTime.Now.ToString();

        if (Request.QueryString["action"] == "update")
        {
            self.Id = cid;
            int i = selfgaoBll.updateCusnote(self);
            if (i > 0)
            {
                js("更新成功!");
                action = "";
            }
        }
        else
        {
            int i = selfgaoBll.insertCusnote(self);
            if (i > 0)
            {
                js("录入成功!");
            }
        }
        Response.Redirect("selfgaoList.aspx");
    }
Beispiel #5
0
 void bindlikedata(int pi, int ps, selfgaoEntity custinfo)
 {
     this.Repeater1.DataSource = selfgaoBll.getCusnoteinfo("", pi, ps, custinfo);
     this.Repeater1.DataBind();
     int pagecount = selfgaoBll.getCommcount("", custinfo);
     this.AspNetPager1.PageSize = pageSize;
     this.AspNetPager1.RecordCount = pagecount;
     this.AspNetPager1.CustomInfoHTML = "总:" + AspNetPager1.RecordCount.ToString() + "条,每页:%PageSize%条,当前:%CurrentPageIndex%/%PageCount%";
 }
Beispiel #6
0
 public static DataSet getCusnoteinfo(string mark, int pi, int ps, selfgaoEntity custinfo)
 {
     string tablename = " self_gao  ";
     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 = " gcname like '" + custinfo.Gcname + "%' and   convert(datetime,gdate) >= convert(datetime, '" + custinfo.Btime + "') and convert(datetime,gdate) <= convert(datetime,'" + custinfo.Etime + "')  and gtitle like '" + custinfo.Gtitle + "%'";
     }
     string strM = "id";
     return conString.GetcommdataSource(tablename, PrimaryKey, sortfld, pagesize, pageindex, sortType, strWhere, strM, selecfld);
 }
Beispiel #7
0
 /// <summary>
 /// ��������
 /// </summary>
 /// <param name="note"></param>
 /// <returns></returns>
 public static int updateCusnote(selfgaoEntity note)
 {
     string sql = "update self_gao set gdate='" + note.Gdate + "',gwhys='" + note.Gwhys + "',gtitle='" + note.Gtitle + "',gpalne='" + note.Gpalne + "',gcname='" + note.Gcname + "',glinkuser='******',glinktel='" + note.Glinktel + "',goper='" + note.Goper + "',gscetion='" + note.Gscetion + "',goperdate='" + note.Goperdate + "',gcontent='" + note.Gcontent + "',gsqi='" + note.Gsqi + "',gsqisection='" + note.Gsqisection + "',gsqidate='" + note.Gsqidate + "',gsqistuta='" + note.Gsqistuta + "',gstyle='" + note.Gstyle + "',gclike='" + note.Gclike + "',gthing='" + note.Gthing + "',gmark='" + note.Gmark + "',sreader='" + note.Sreader + "',sreaddate='" + note.Sreaddate + "' where id=" + note.Id.ToString();
     return SqlHelper.ExecuteNonQuery(DataBll.conString.constr, CommandType.Text, sql);
 }
Beispiel #8
0
 /// <summary>
 ///�����¼��Ϣ
 /// </summary>
 /// <param name="note"></param>
 /// <returns></returns>
 public static int insertCusnote(selfgaoEntity note)
 {
     string sql = "insert into self_gao ( gdate,gwhys,gtitle,gpalne,gcname,glinkuser,glinktel,goper,gscetion,goperdate,gcontent,gsqi,gsqisection,gsqidate,gsqistuta,gstyle,gclike,gthing,gmark,sreader,sreaddate) values"; sql += "('" + note.Gdate + "','" + note.Gwhys + "','" + note.Gtitle + "','" + note.Gpalne + "','" + note.Gcname + "','" + note.Glinkuser + "','" + note.Glinktel + "','" + note.Goper + "','" + note.Gscetion + "','" + note.Goperdate + "','" + note.Gcontent + "','" + note.Gsqi + "','" + note.Gsqisection + "','" + note.Gsqidate + "','" + note.Gsqistuta + "','" + note.Gstyle + "','" + note.Gclike + "','" + note.Gthing + "','" + note.Gmark + "','" + note.Sreader + "','" + note.Sreaddate + "')";
     return SqlHelper.ExecuteNonQuery(DataBll.conString.constr, CommandType.Text, sql);
 }