public static int getCommcountun(string mark, contsellEntity custinfo) { string strWhere = ""; strWhere = "[check]='0' "; return conString.Getcommentcount("contract_sell", "id", strWhere); }
public static int getCommcountvd(string mark, contsellEntity custinfo) { string strWhere = ""; strWhere = " vdcmark='���' and datediff(d,btime,getdate()) > 365 "; return conString.Getcommentcount("contract_sell", "id", strWhere); }
void bindlikedata(int pi, int ps, contsellEntity custinfo) { this.Repeater1.DataSource = cusinfoBll.getCustominfos("", pi, ps, custinfo); this.Repeater1.DataBind(); int pagecount = cusinfoBll.Getcustinfocounts("", custinfo); this.AspNetPager1.PageSize = pageSize; this.AspNetPager1.RecordCount = pagecount; this.AspNetPager1.CustomInfoHTML = "总:" + AspNetPager1.RecordCount.ToString() + "条,每页:%PageSize%条,当前:%CurrentPageIndex%/%PageCount%"; }
public static int getCommcount(string mark, contsellEntity custinfo) { string strWhere = ""; if (mark == "begin") { strWhere = ""; } else { strWhere = " cname like '" + custinfo.Cname + "%' and convert(datetime,cdate) >= convert(datetime, '" + custinfo.Bbtime + "') and convert(datetime,cdate) <= convert(datetime,'" + custinfo.Eetime + "') and ccname like '" + custinfo.Ccname + "%' and cstuta like '" + custinfo.Cstuta + "%' and vdcmark like '" + custinfo.Vdcmark + "%'"; } return conString.Getcommentcount("contract_sell", "id", strWhere); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["id"])) { this.txtcid.Text = Request.QueryString["id"].ToString(); cid = Request.QueryString["id"]; oper = consellBll.getcusnoteInfo(cid); list = consellBll.getcusWorkinfo(cid); if (oper.Check == "1") { mess = "<img src=\"../images/stamp_yishenhe.gif\">"; } else { mess = ""; } } } }
protected void Button1_Click(object sender, EventArgs e) { contsellEntity self = new contsellEntity(); self.Ccode = this.txtccode.Text; self.Cname = this.txtcname.Text; self.Ccname = this.txtccname.Text; self.Cdate = this.txtcdate.Text; self.Spokesman = this.txtspokesman.Text; self.Saddress = this.txtsaddress.Text; self.Stel = this.txtstel.Text; self.Selfman = this.txtselfman.Text; self.Btime = this.txtbtime.Text; self.Etime = this.txtetime.Text; self.Cmark = this.txtcmark.Text; self.Cmoney = this.txtcmoney.Text; self.Umoney = this.txtumoney.Text; self.Omoney = this.txtomoney.Text; self.Cstuta = this.dropcstuta.SelectedItem.Text; self.Coper = this.dropcoper.SelectedItem.Text; //self.Coper = this.txtcoper.Text; self.Csection = this.dropcsection.SelectedItem.Text; self.Vdcmark = this.dropvdcmark.SelectedItem.Text; self.Vindicator = this.txtvindicator.Text; self.Cnoteer = Session["username"].ToString();//"honey";//session self.Cnotedate = DateTime.Now.ToString(); self.Cprovalue = this.txtcprovalue.Text; if (dropvdcmark.SelectedItem.Text == "已查收" ) { if (chvid != "已查收")//用于防止进入时状态就是已查收 此时就不用更改时间 self.Vdate = DateTime.Now.ToString(); } else { self.Vdate = ""; } self.Mark = this.txtmark.Text; if (Request.QueryString["action"] == "update") { self.Id = cid; //修改相关项目信息 //int ic = consellBll.insertCusnote(self); string mid = cid; conworkEntity work = new conworkEntity(); XmlDocument xdoc = new XmlDocument(); xdoc.Load(Server.MapPath("work.xml")); XmlNodeList ch = xdoc.GetElementsByTagName("DataSet1").Item(0).ChildNodes; DataSet ds = new DataSet(); bool check = false;//用于控制没有表的节点 if (ch.Count > 0) { check = true; } if (check) { ds.ReadXml(Server.MapPath("work.xml")); int icount = ds.Tables[0].Rows.Count; for (int i = 0; i < icount; i++) { work.Cid = mid; work.Conmark = ds.Tables[0].Rows[i]["mark"].ToString(); work.Conmoney = ds.Tables[0].Rows[i]["cmoney"].ToString(); work.Conname = ds.Tables[0].Rows[i]["cname"].ToString(); int cou = consellBll.insertCusnotew(work); } } int ids = consellBll.updateCusnote(self); if (ids > 0) { if (check) { ds.Tables[0].Rows.Clear(); ds.WriteXml(Server.MapPath("work.xml")); } js("更新成功!"); action = ""; } } else { DataSet ds = new DataSet(); ds.ReadXml(Server.MapPath("work.xml")); int icount = ds.Tables[0].Rows.Count; int ic = consellBll.insertCusnote(self); string mid = consellBll.getMaxid(); conworkEntity work = new conworkEntity(); for (int i = 0; i < icount; i++) { work.Cid = mid; work.Conmark = ds.Tables[0].Rows[i]["mark"].ToString(); work.Conmoney = ds.Tables[0].Rows[i]["cmoney"].ToString(); work.Conname = ds.Tables[0].Rows[i]["cname"].ToString(); int cou = consellBll.insertCusnotew(work); } if (ic > 0) { ds.Tables[0].Rows.Clear(); ds.WriteXml(Server.MapPath("work.xml")); js("录入成功!"); } } Response.Redirect("consellList.aspx"); }
public static DataSet getCustominfos(string mark, int pi, int ps, contsellEntity custinfo) { string tablename = " contract_sell "; 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 = " cname like '" + custinfo.Cname + "%' "; } string strM = "id"; return conString.GetcommdataSource(tablename, PrimaryKey, sortfld, pagesize, pageindex, sortType, strWhere, strM, selecfld); }
/// <summary> /// /// </summary> /// <param name="mark"></param> /// <param name="custinfo"></param> /// <returns></returns> public static int Getcustinfocounts(string mark, contsellEntity custinfo) { string strWhere = ""; if (mark == "begin") { strWhere = ""; } else { strWhere = " cname like '" + custinfo.Cname + "%' "; } return conString.Getcommentcount("contract_sell", "id", strWhere); }
/// <summary> /// ��ü�¼��Ϣ�� /// </summary> /// <param name="id"></param> /// <returns></returns> public static contsellEntity getcusnoteInfo(string id) { contsellEntity note = new contsellEntity(); string sql = "select * from contract_sell where id=" + id; using (SqlDataReader dr = SqlHelper.ExecuteReader(DataBll.conString.constr, CommandType.Text, sql)) { if (dr.Read()) { note.Ccode = dr["ccode"].ToString(); note.Cname = dr["cname"].ToString(); note.Ccname = dr["ccname"].ToString(); note.Cdate = dr["cdate"].ToString(); note.Spokesman = dr["spokesman"].ToString(); note.Saddress = dr["saddress"].ToString(); note.Stel = dr["stel"].ToString(); note.Selfman = dr["selfman"].ToString(); note.Btime = dr["btime"].ToString(); note.Etime = dr["etime"].ToString(); note.Cmark = dr["cmark"].ToString(); note.Cmoney = dr["cmoney"].ToString(); note.Omoney = dr["omoney"].ToString(); note.Umoney = dr["umoney"].ToString(); note.Cstuta = dr["cstuta"].ToString(); note.Coper = dr["coper"].ToString(); note.Csection = dr["csection"].ToString(); note.Check = dr["check"].ToString(); note.Cnoteer = dr["cnoteer"].ToString(); note.Cnotedate = dr["cnotedate"].ToString(); note.Checker = dr["checker"].ToString(); note.Chdate = dr["chdate"].ToString(); note.Mark = dr["mark"].ToString(); note.Vdcmark = dr["vdcmark"].ToString(); note.Vindicator = dr["vindicator"].ToString(); note.Vdate = dr["vdate"].ToString(); note.Cprovalue = dr["cprovalue"].ToString(); } } return note; }
/// <summary> /// �������� /// </summary> /// <param name="note"></param> /// <returns></returns> public static int updateCusnote(contsellEntity note) { string sql = "update contract_sell set cname='" + note.Cname + "',ccname='" + note.Ccname + "',cdate='" + note.Cdate + "',spokesman='" + note.Spokesman + "',saddress='" + note.Saddress + "',stel='" + note.Stel + "',selfman='" + note.Selfman + "',btime='" + note.Btime + "',etime='" + note.Etime + "',cmark='" + note.Cmark + "',cmoney='" + note.Cmoney + "',omoney='" + note.Omoney + "',umoney='" + note.Umoney + "',cstuta='" + note.Cstuta + "',coper='" + note.Coper + "',csection='" + note.Csection + "',cnoteer='" + note.Cnoteer + "',cnotedate='" + note.Cnotedate + "',checker='" + note.Checker + "',chdate='" + note.Chdate + "',mark='" + note.Mark + "',Vdcmark='" + note.Vdcmark + "',Vindicator='" + note.Vindicator + "',vdate='"+note.Vdate+"',cprovalue='"+note.Cprovalue+"',ccode='"+note.Ccode+"' 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(contsellEntity note) { string sql = "insert into contract_sell ( cname,ccname,cdate,spokesman,saddress,stel,selfman,btime,etime,cmark,cmoney,cstuta,coper,csection,cnoteer,cnotedate,mark,omoney,umoney,Vindicator,Vdcmark,vdate,ccode,cprovalue) values"; sql += "('" + note.Cname + "','" + note.Ccname + "','" + note.Cdate + "','" + note.Spokesman + "','" + note.Saddress + "','" + note.Stel + "','" + note.Selfman + "','" + note.Btime + "','" + note.Etime + "','" + note.Cmark + "','" + note.Cmoney + "','" + note.Cstuta + "','" + note.Coper + "','" + note.Csection + "','" + note.Cnoteer + "','" + note.Cnotedate + "','" + note.Mark + "','"+note.Omoney+"','"+note.Umoney+"','"+note.Vindicator+"','"+note.Vdcmark+"','"+note.Vdate+"','"+note.Ccode+"','"+note.Cprovalue+"')"; return SqlHelper.ExecuteNonQuery(DataBll.conString.constr, CommandType.Text, sql); }
public static DataSet getCusnoteinfovd(string mark, int pi, int ps, contsellEntity custinfo) { string tablename = " contract_sell "; string sortfld = " id "; string selecfld = " *"; string PrimaryKey = "id"; int pageindex = pi; int pagesize = ps; int sortType = 1; string strWhere = ""; strWhere = " vdcmark='���' and datediff(d,btime,getdate()) > 365 "; string strM = "id"; return conString.GetcommdataSource(tablename, PrimaryKey, sortfld, pagesize, pageindex, sortType, strWhere, strM, selecfld); }
public static DataSet getCusnoteinfoun(string mark, int pi, int ps, contsellEntity custinfo) { string tablename = " contract_sell "; string sortfld = " id "; string selecfld = " *"; string PrimaryKey = "id"; int pageindex = pi; int pagesize = ps; int sortType = 1; string strWhere = ""; strWhere = "[check]='0' "; string strM = "id"; return conString.GetcommdataSource(tablename, PrimaryKey, sortfld, pagesize, pageindex, sortType, strWhere, strM, selecfld); }
public static DataSet getCusnoteinfo(string mark, int pi, int ps, contsellEntity custinfo) { string tablename = " contract_sell "; 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 = " cname like '" + custinfo.Cname + "%' and convert(datetime,cdate) >= convert(datetime, '" + custinfo.Bbtime + "') and convert(datetime,cdate) <= convert(datetime,'" + custinfo.Eetime + "') and ccname like '" + custinfo.Ccname + "%' and cstuta like '"+custinfo.Cstuta+"%' and vdcmark like '"+custinfo.Vdcmark+"%'"; } string strM = "id"; return conString.GetcommdataSource(tablename, PrimaryKey, sortfld, pagesize, pageindex, sortType, strWhere, strM, selecfld); }
protected void btnt_Click(object sender, EventArgs e) { mess = "<img src=\"../images/stamp_yishenhe.gif\">"; consellBll.updatecheck(cid,"1"); oper = consellBll.getcusnoteInfo(cid); }
protected void btnf_Click(object sender, EventArgs e) { mess = ""; consellBll.updatecheck(cid, "0"); oper = consellBll.getcusnoteInfo(cid); }