Exemple #1
0
    /// <summary>
    /// 确定
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnconfirm_Click(object sender, EventArgs e)
    {
        custinfoEntity cus = new custinfoEntity();
        cus.Pname = this.txtpname.Text;
        cus.Usertel = this.txtusertel.Text;
        cus.Ptel = this.txttel.Text;
        cus.Puser = this.txtlinker.Text;
        cus.Cmust = this.txtmust.Text;
        cus.Rinfo = this.txtrestore.Text;
        cus.Lastlink = this.txtendtime.Text;
        cus.Newmoney = this.txtnewmoney.Text;
        cus.Pfax = this.txtfax.Text;
        cus.Laddress = this.txtaddress.Text;
        cus.Postcode = this.txtpostcode.Text;
        cus.TryCatch = this.droptrycatch.SelectedItem.Text;
        cus.Cliceso = this.dropcsouce.SelectedItem.Text;
        cus.Clicetype = this.dropctyle.SelectedItem.Text;
        cus.Clicevip = this.dropvip.SelectedItem.Text;
        cus.Cstatus = this.dropstatus.SelectedItem.Text;
        cus.Cstyle = this.drophang.SelectedItem.Text;
        cus.Credit = this.dropedit.SelectedItem.Text;
        cus.Psize = this.dropsize.SelectedItem.Text;
        cus.Pzone = this.DropDownList2.SelectedItem.Text;
        cus.Sections = this.dropsction.SelectedItem.Text;
        cus.Seller = this.dropseller.SelectedItem.Text;
        cus.Mark = this.txtmark.Text;
        cus.Srdate = DateTime.Now.ToString();
        cus.Sreader = Session["username"].ToString();//"honey";//session

        if (action == "update")
        {
            action = "";
            cus.Id = Convert.ToInt32(cid);
            int ucount = cusinfoBll.updateCusinfo(cus);
            if (ucount > 0)
            {

                js("客户信息修改成功");

                Response.Redirect("customList.aspx");
            }

        }
        else
        {
            int icount = cusinfoBll.addCusinfo(cus);
            if (icount > 0)
            {
                js("客户信息录入成功");
                Response.Redirect("customList.aspx");
            }

        }
    }
Exemple #2
0
 /// <summary>
 /// ��ÿͻ���Ϣ
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public static custinfoEntity getCustinfobyid(string id)
 {
     custinfoEntity cus = new custinfoEntity();
        string sql = "select * from custom_info where id="+id;
        using (SqlDataReader dr = SqlHelper.ExecuteReader(DataBll.conString.constr,CommandType.Text,sql))
        {
        if (dr.Read())
        {
            cus.Pname = dr["pname"].ToString();
            cus.Puser = dr["puser"].ToString();
            cus.Laddress = dr["laddress"].ToString();
            cus.Lastlink = dr["lastlink"].ToString();
            cus.Mark = dr["mark"].ToString();
            cus.Newmoney = dr["newmoney"].ToString();
            cus.Pfax = dr["pfax"].ToString();
            cus.Pname = dr["pname"].ToString();
            cus.Postcode = dr["postcode"].ToString();
            cus.Psize = dr["psize"].ToString();
            cus.Ptel = dr["ptel"].ToString();
            cus.Pzone = dr["pzone"].ToString();
            cus.Rinfo = dr["rinfo"].ToString();
            cus.Sections = dr["sections"].ToString();
            cus.Seller = dr["seller"].ToString();
            cus.Srdate = dr["srdate"].ToString();
            cus.Sreader = dr["sreader"].ToString();
            cus.TryCatch = dr["trycath"].ToString();
            cus.Cliceso = dr["cliceso"].ToString();
            cus.Clicetype = dr["clicetype"].ToString();
            cus.Clicevip = dr["clicevip"].ToString();
            cus.Cmust = dr["cmust"].ToString();
            cus.Credit = dr["credit"].ToString();
            cus.Cstatus = dr["cstatus"].ToString();
            cus.Cstyle = dr["cstyle"].ToString();
            cus.Usertel = dr["userpho"].ToString();
        }
        }
        return cus;
 }
Exemple #3
0
 /// <summary>
 /// ���¿ͻ���Ϣ
 /// </summary>
 /// <param name="cus"></param>
 /// <returns></returns>
 public static int updateCusinfo(custinfoEntity cus)
 {
     string sql = "update custom_info set pname='"+cus.Pname+"',cstatus='"+cus.Cstatus+"',puser='******',cmust='"+cus.Cmust+"',rinfo='"+cus.Rinfo+"',lastlink='"+cus.Lastlink+"',newmoney='"+cus.Newmoney+"',ptel='"+cus.Ptel+"',pfax='"+cus.Pfax+"',laddress='"+cus.Laddress+"',postcode='"+cus.Postcode+"',trycath='"+cus.TryCatch+"',cliceso='"+cus.Cliceso+"',pzone='"+cus.Pzone+"',clicevip='"+cus.Clicevip+"',cstyle='"+cus.Cstyle+"',psize='"+cus.Psize+"',credit='"+cus.Credit+"',mark='"+cus.Mark+"',seller='"+cus.Seller+"',sections='"+cus.Sections+"',sreader='"+cus.Sreader+"',srdate='"+cus.Srdate+"',clicetype='"+cus.Clicetype+"',userpho='"+cus.Usertel+"' where  id="+cus.Id.ToString();
        return SqlHelper.ExecuteNonQuery(DataBll.conString.constr, CommandType.Text, sql);
 }
Exemple #4
0
        public static DataSet getCustominfoun(string mark, int pi, int ps, custinfoEntity custinfo)
        {
            string tablename = " custom_info ";
            string sortfld = " id ";
            string selecfld = " *";
            string PrimaryKey = "id";
            int pageindex = pi;
            int pagesize = ps;
            int sortType = 1;
            string strWhere = "";

            strWhere = "  DateDiff(day,convert(datetime,lastlink),getdate()) >0";

            string strM = "id";
            return conString.GetcommdataSource(tablename, PrimaryKey, sortfld, pagesize, pageindex, sortType, strWhere, strM, selecfld);
        }
Exemple #5
0
        public static DataSet getCustominfos1(string mark, int pi, int ps, custinfoEntity custinfo)
        {
            string tablename = " custom_info ";
            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 = " pname like '" + custinfo.Pname + "%' and pzone like '" + custinfo.Pzone + "%' and cstyle like '" + custinfo.Cstyle + "%' and convert(datetime,lastlink) >= convert(datetime, '" + custinfo.Btime + "') and convert(datetime,lastlink) <= convert(datetime,'" + custinfo.Etime + "') ";

            }
            string strM = "id";
            return conString.GetcommdataSource(tablename, PrimaryKey, sortfld, pagesize, pageindex, sortType, strWhere, strM, selecfld);
        }
Exemple #6
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="mark"></param>
 /// <param name="custinfo"></param>
 /// <returns></returns>
 public static int Getcustinfocountun(string mark, custinfoEntity custinfo)
 {
     string strWhere = "";
     strWhere = "  DateDiff(day,convert(datetime,lastlink),getdate()) >0";
     return conString.Getcommentcount("custom_info", "id", strWhere);
 }
Exemple #7
0
 /// <summary>
 ///  ���ӿͻ���Ϣ
 /// </summary>
 /// <param name="cus"></param>
 /// <returns></returns>
 public static int addCusinfo(custinfoEntity cus)
 {
     string sql = " insert into custom_info (userpho,pname,cstatus,puser,cmust,rinfo,lastlink,newmoney,ptel,pfax,laddress,postcode,trycath,cliceso,pzone,clicevip,cstyle,psize,credit,mark,seller,sections,sreader,srdate,clicetype) values";
        sql += "('" + cus.Usertel + "','" + cus.Pname + "','" + cus.Cstatus + "','" + cus.Puser + "','" + cus.Cmust + "','" + cus.Rinfo + "','" + cus.Lastlink + "','" + cus.Newmoney + "','" + cus.Ptel + "','" + cus.Pfax + "','" + cus.Laddress + "','" + cus.Postcode + "','" + cus.TryCatch + "','" + cus.Cliceso + "','" + cus.Pzone + "','" + cus.Clicevip + "','" + cus.Cstyle + "','" + cus.Psize + "','" + cus.Credit + "','" + cus.Mark + "','" + cus.Seller + "','" + cus.Sections + "','" + cus.Sreader + "','" + cus.Srdate + "','" + cus.Clicetype + "')";
        return SqlHelper.ExecuteNonQuery(DataBll.conString.constr,CommandType.Text,sql);
 }
Exemple #8
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="mark"></param>
        /// <param name="custinfo"></param>
        /// <returns></returns>
        public static int Getcustinfocounts1(string mark, custinfoEntity custinfo)
        {
            string strWhere = "";
            if (mark == "begin")
            {

                    strWhere = "";

            }
            else
            {

                    strWhere = " pname like '" + custinfo.Pname + "%' and pzone like '" + custinfo.Pzone + "%' and cstyle like '" + custinfo.Cstyle + "%' and convert(datetime,lastlink) >= convert(datetime, '" + custinfo.Btime + "') and convert(datetime,lastlink) <= convert(datetime,'" + custinfo.Etime + "') ";

            }
            return conString.Getcommentcount("custom_info", "id", strWhere);
        }
Exemple #9
0
 void bindlikedata(int pi, int ps, custinfoEntity custinfo)
 {
     this.Repeater1.DataSource = cusinfoBll.getCustominfo11("", pi, ps, custinfo);
     this.Repeater1.DataBind();
     int pagecount = cusinfoBll.Getcustinfocount11("", custinfo);
     this.AspNetPager1.PageSize = pageSize;
     this.AspNetPager1.RecordCount = pagecount;
     this.AspNetPager1.CustomInfoHTML = "总:" + AspNetPager1.RecordCount.ToString() + "条,每页:%PageSize%条,当前:%CurrentPageIndex%/%PageCount%";
 }