查看和修改是同一个界面:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LinkManUpdate.aspx.cs" Inherits="BioErpWeb.CRMSystem.LinkManUpdate"  %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="../Styles/ERPBaseStyle.css" rel="stylesheet" type="text/css" />
<link href="../Styles/CalenderStyle.css" rel="stylesheet" type="text/css" /> <script src="../JS/CustomerName.js" type="text/javascript"></script>
<script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <script type="text/javascript">
$(document).ready(function () { $("#btnSubmit").click(function () { return true; }); }); </script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<table class="maintable">
<tr>
<td colspan="" class="titlebar">客户<span>联系人信息添加</span></td>
</tr>
<tr>
<td>联系人姓名</td><td><asp:TextBox ID="txtLinkmanName" runat="server" CssClass="required"></asp:TextBox></td>
<td>联系人昵称</td><td><asp:TextBox ID="txtNickname" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td>性别</td><td>
<asp:DropDownList ID="ddlSex" runat="server">
<asp:ListItem Value="">男</asp:ListItem>
<asp:ListItem Value="">女</asp:ListItem>
</asp:DropDownList>
</td>
<td>生日</td><td><asp:TextBox ID="txtBirthday" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td>部门</td><td><asp:TextBox ID="txtDepartment" runat="server"></asp:TextBox></td>
<td>职务</td><td><asp:TextBox ID="txtHeadship" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td>是否是主联系人</td><td>
<asp:DropDownList ID="ddlMainMan" runat="server">
<asp:ListItem Value="">是</asp:ListItem>
<asp:ListItem Value="">否</asp:ListItem>
</asp:DropDownList>
</td>
<td>工作电话</td><td><asp:TextBox ID="txtWorkPhone" runat="server"></asp:TextBox></td>
</tr> <tr>
<td>
个人手机
</td>
<td>
<asp:TextBox ID="txtMobile" runat="server"></asp:TextBox>
</td>
<td>
Email
</td>
<td>
<asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
住址
</td>
<td>
<asp:TextBox ID="txtAddress" runat="server"></asp:TextBox>
</td>
<td>
邮编
</td>
<td>
<asp:TextBox ID="txtPostcode" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
QQ号码
</td>
<td>
<asp:TextBox ID="txtQQ" runat="server"></asp:TextBox>
</td>
<td>
MSN
</td>
<td>
<asp:TextBox ID="txtMsN" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
所属客户
</td>
<td>
<asp:TextBox ID="txtCustomerID" runat="server"></asp:TextBox><input type="button" value="选择客户" style=" width:100px;" onclick="showCustomerDialog()" />
</td>
<td>
家庭电话
</td>
<td >
<asp:TextBox ID="txtHomePhone" runat="server"></asp:TextBox>
</td> </tr>
<tr>
<td>
是否删除</td>
<td>
<asp:DropDownList ID="ddlSate" runat="server">
<asp:ListItem Value="">是</asp:ListItem>
<asp:ListItem Value="" Selected="True">否</asp:ListItem>
</asp:DropDownList>
</td>
<td>
&nbsp;</td>
<td >
&nbsp;</td> </tr>
<tr>
<td colspan="" class="bottomtd"> <asp:Button ID="btnSubmit" runat="server" Text="客户联系人编辑"
onclick="btnSubmit_Click" /> <asp:Button ID="btnReturn" runat="server" Text="返回列表" onclick="btnReturn_Click"
/>
</td>
</tr> </table>
<br />
</div>
</form>
</body>
</html>

后台代码:

 public partial class LinkManUpdate : System.Web.UI.Page
{ protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
PageInfoBind();
}
}
static BioCrmLinkmanInfo linkman = new BioCrmLinkmanInfo();
protected void PageInfoBind()
{
if (Request.QueryString["ID"] == null)
{
Response.Redirect("LinkManListShow.aspx");
return;
} string id = Request.QueryString["ID"].ToString();
LinkManInfoBLL linkbll = new LinkManInfoBLL();
linkman = linkbll.getLinkManByID(id);
this.txtLinkmanName.Text=linkman.LinkmanName; this.txtAddress.Text=linkman.Address;
this.txtBirthday.Text=linkman.Birthday.ToString();
this.txtWorkPhone.Text=linkman.WorkPhone; this.ddlSex.SelectedValue =Convert.ToBoolean(linkman.Sex)?"1":"0";
this.txtDepartment.Text=linkman.Department;
this.txtEmail.Text=linkman.Email;
this.txtQQ.Text=linkman.QQ;
this.txtMsN.Text=linkman.MSN;
this.txtHeadship.Text=linkman.Headship;
this.txtHomePhone.Text = linkman.HomePhone;
this.txtMobile.Text=linkman.Mobile;
this.txtPostcode.Text=linkman.Postcode;
this.txtNickname.Text=linkman.Nickname;
this.ddlMainMan.SelectedValue=linkman.Nickname;
this.txtCustomerID.Text = linkman.CustomerID.ToString(); } protected void btnSubmit_Click(object sender, EventArgs e)
{
BioCrmLinkmanInfo linkman = new BioCrmLinkmanInfo()
{
LinkmanID=int.Parse(Request.QueryString["ID"].ToString()),
LinkmanName = this.txtLinkmanName.Text,
Address = this.txtAddress.Text,
Birthday = Convert.ToDateTime(this.txtBirthday.Text),
WorkPhone = this.txtWorkPhone.Text,
Sex = this.ddlSex.SelectedValue == "0" ? false : true,
Department = this.txtDepartment.Text,
Email = this.txtEmail.Text,
QQ = this.txtQQ.Text,
MSN = this.txtMsN.Text,
Headship = this.txtHeadship.Text,
HomePhone = this.txtHeadship.Text,
Mobile = this.txtMobile.Text,
Postcode = this.txtPostcode.Text,
Nickname = this.txtNickname.Text,
IsMain = this.ddlMainMan.SelectedValue == "1" ? true : false,
CustomerID = int.Parse(this.txtCustomerID.Text),
DeleteState=this.ddlSate.SelectedValue=="1"?true:false
}; LinkManInfoBLL linkbll = new LinkManInfoBLL();
if (linkbll.LinkmanInfoUpdate(linkman) != 0)
{
Response.Redirect("LinkManListShow.aspx");
} } protected void btnReturn_Click(object sender, EventArgs e)
{
Server.Transfer("CustomerListShow.aspx");
} }

jQuery验证的扩展方法:

jQuery.extend(
jQuery.validator.messages, {
required: "必选字段",
remote: "请修正该字段",
email: "请输入正确格式的电子邮件",
url: "请输入合法的网址",
date: "请输入合法的日期",
dateISO: "请输入合法的日期 (ISO).",
number: "请输入合法的数字",
digits: "只能输入整数",
creditcard: "请输入合法的信用卡号",
equalTo: "请再次输入相同的值",
accept: "请输入拥有合法后缀名的字符串",
maxlength: $.validator.format("请输入一个长度最多是 {0} 的字符串"),
minlength: $.validator.format("请输入一个长度最少是 {0} 的字符串"),
rangelength: $.validator.format("请输入一个长度介于 {0} 和 {1} 之间的字符串"),
range: $.validator.format("请输入一个介于 {0} 和 {1} 之间的值"),
max: $.validator.format("请输入一个最大为 {0} 的值"),
min: $.validator.format("请输入一个最小为 {0} 的值")
});

客户联系人添加:

添加的存储过程:
ALTER PROCEDURE [dbo].[BioCrmContactRecord_ADD]
@Note nvarchar(1000),
@ContactTime datetime,
@CustomerID int,
@LinkmanID int,
@Type nvarchar(50),
@Method nvarchar(100),
@NoteTime datetime,
@UserID int
AS
INSERT INTO [BioCrmContactRecord](
[Note],[ContactTime],[CustomerID],[LinkmanID],[Type],[Method],[NoteTime],[UserID]
)VALUES(
@Note,@ContactTime,@CustomerID,@LinkmanID,@Type,@Method,@NoteTime,@UserID
)

客户关系管理系统——联系记录管理

修改的存储过程:

ALTER PROCEDURE [dbo].[BioCrmContactRecord_Update]
@NoteID int,
@Note nvarchar(1000),
@ContactTime datetime,
@CustomerID int,
@LinkmanID int,
@Type nvarchar(50),
@Method nvarchar(100),
@NoteTime datetime,
@UserID int,
@DeleteState bit
AS
UPDATE [BioCrmContactRecord] SET
[Note] = @Note,[ContactTime] = @ContactTime,[CustomerID] = @CustomerID,[LinkmanID] = @LinkmanID,[Type] = @Type,[Method] = @Method,[NoteTime] = @NoteTime,[UserID] = @UserID,[DeleteState] = @DeleteState
WHERE NoteID=@NoteID

得到实体对象的详细信息存储过程:

ALTER PROCEDURE [dbo].[GetContactRecordByID]
@NoteID int
AS
SELECT
NoteID,Note,ContactTime,CustomerID,LinkmanID,[Type],Method,NoteTime,UserID,DeleteState
FROM [BioCrmContactRecord]
WHERE NoteID=@NoteID

BLL层的代码:

public  class BioCrmContactRecordBLL
{
/// <summary>
/// 添加一条记录信息
/// </summary>
/// <param name="record">记录信息对象</param>
/// <returns>int</returns>
public int BioCrmContactRecord_ADD(BioCrmContactRecord record)
{
SqlParameter[] pars = new SqlParameter[]{
new SqlParameter("@Note",record.Note),
new SqlParameter("@ContactTime",record.ContactTime),
new SqlParameter("@CustomerID",record.CustomerID),
new SqlParameter("@LinkmanID",record.LinkmanID),
new SqlParameter("@Type",record.Type),
new SqlParameter("@Method",record.Method),
new SqlParameter("@NoteTime",record.NoteTime),
new SqlParameter("@UserID",record.UserID)
}; return DataBaseHelper.ExcuteSqlReturnInt("BioCrmContactRecord_ADD", CommandType.StoredProcedure, pars); } /// <summary>
/// 修改record记录对象
/// </summary>
/// <param name="record"></param>
/// <returns>int</returns>
public int BioCrmContactRecord_Update(BioCrmContactRecord record)
{
SqlParameter[] pars = new SqlParameter[]{
new SqlParameter("@NoteID",record.NoteID),
new SqlParameter("@Note",record.Note),
new SqlParameter("@ContactTime",record.ContactTime),
new SqlParameter("@CustomerID",record.CustomerID),
new SqlParameter("@LinkmanID",record.LinkmanID),
new SqlParameter("@Type",record.Type),
new SqlParameter("@Method",record.Method),
new SqlParameter("@NoteTime",record.NoteTime),
new SqlParameter("@UserID",record.UserID)
};
return DataBaseHelper.ExcuteSqlReturnInt("BioCrmContactRecord_Update", CommandType.StoredProcedure, pars); } /// <summary>
/// 根据Id返回record对象
/// </summary>
/// <param name="id">id</param>
/// <returns>BioCrmContactRecord</returns>
public BioCrmContactRecord GetContactRecordByID(int Noteid)
{
SqlParameter[] pars = new SqlParameter[]{
new SqlParameter("@NoteID",Noteid)
}; BioCrmContactRecord record = new BioCrmContactRecord();
DataTable dt= DataBaseHelper.SelectSQLReturnTable("GetContactRecordByID", CommandType.StoredProcedure, pars);
if (dt != null && dt.Rows.Count > 0)
{
//NoteID,Note,ContactTime,CustomerID,LinkmanID,[Type],Method,NoteTime,UserID,DeleteState
record.NoteID = Noteid;
record.Note = dt.Rows[0]["Note"].ToString();
record.NoteTime = Convert.ToDateTime(dt.Rows[0]["NoteTime"].ToString());
record.ContactTime = Convert.ToDateTime(dt.Rows[0]["ContactTime"].ToString());
record.CustomerID = int.Parse(dt.Rows[0]["CustomerID"].ToString());
record.LinkmanID =int.Parse( dt.Rows[0]["LinkmanID"].ToString());
record.Type = dt.Rows[0]["Type"].ToString();
record.Method = dt.Rows[0]["Method"].ToString();
record.UserID =int.Parse( dt.Rows[0]["UserID"].ToString());
record.DeleteState =Convert.ToBoolean(dt.Rows[0]["DeleteState"].ToString());
}
return record; }
}

添加的前台界面:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ContactRecordAdd.aspx.cs"
Inherits="BioErpWeb.CRMSystem.ContactRecordAdd" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="../Styles/ERPBaseStyle.css" rel="stylesheet" type="text/css" />
<link href="../Styles/CalenderStyle.css" rel="stylesheet" type="text/css" />
<script src="../JS/CustomerName.js" type="text/javascript"></script>
<script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script src="../Scripts/jquery.validate.js" type="text/javascript"></script>
<script src="../Scripts/ValidateMessage_ZW.js" type="text/javascript"></script> <style type="text/css">
.style1
{
height: 22px;
}
</style> <script type="text/javascript">
$().ready(function () {
$("#form1").validate();
});
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<table class="maintable">
<tr>
<td colspan="4" class="titlebar">
客户联系记录添加
</td>
</tr>
<tr>
<td class="style1">
客户编号
</td>
<td class="style1">
<asp:TextBox ID="txtCustomerID" CssClass="required number" runat="server" OnTextChanged="txtCustomerID_TextChanged"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="选择客户" OnClientClick="showCustomerDialog()" />
</td>
<td class="style1">
客户联系人
</td>
<td class="style1">
<asp:DropDownList ID="ddlLinkMan" runat="server">
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
联系时间
</td>
<td>
<asp:TextBox ID="txtContractTime" CssClass="required" runat="server"></asp:TextBox>
<cc1:CalendarExtender ID="CalendarExtender1" TargetControlID="txtContractTime" Format="yyyy-MM-dd" runat="server">
</cc1:CalendarExtender>
</td>
<td>
记录时间
</td>
<td>
<asp:Label ID="lbNoteTime" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td>
联系类别
</td>
<td>
<asp:DropDownList ID="ddlType" runat="server">
<asp:ListItem>人工</asp:ListItem>
<asp:ListItem>自能</asp:ListItem>
</asp:DropDownList>
</td>
<td>
联系方式
</td>
<td>
<asp:DropDownList ID="ddlMethod" runat="server">
<asp:ListItem>电话</asp:ListItem>
<asp:ListItem>短信</asp:ListItem>
<asp:ListItem>Email</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
联系内容
</td>
<td colspan="3">
<asp:TextBox ID="txtContent" Width="552px" Height="101px" CssClass="required" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="4" class="bottomtd">
<asp:Button ID="btnSubmit" runat="server" Text="客户联系记录添加" OnClick="btnSubmit_Click" />
<asp:Button ID="btnReturn" runat="server" Text="返回列表" OnClick="btnReturn_Click" />
</td>
</tr>
</table>
<br />
</div>
</form>
</body>
</html>

添加的后台代码:

 public partial class ContactRecordAdd : System.Web.UI.Page
{ protected void Page_Load(object sender, EventArgs e)
{
this.lbNoteTime.Text = DateTime.Now.ToShortDateString();
Session["Userid"] = "29";
if (Session["Userid"] == null)
{
Response.Redirect("~/Web/Desk.aspx");
} } protected void btnSubmit_Click(object sender, EventArgs e)
{
BioCrmContactRecord record = new BioCrmContactRecord();
BioCrmContactRecordBLL rbll = new BioCrmContactRecordBLL();
record.CustomerID = int.Parse(this.txtCustomerID.Text.Trim());
if (ddlLinkMan.SelectedValue == null || ddlLinkMan.SelectedValue == "0")
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "test", "alert('此客户没有联系人,请先添加联系人');", true);
return;
}
record.LinkmanID = int.Parse(ddlLinkMan.SelectedValue.ToString());
record.ContactTime = Convert.ToDateTime(this.txtContractTime.Text);
record.NoteTime = Convert.ToDateTime(this.lbNoteTime.Text.Trim());
record.Type = this.ddlType.SelectedValue.ToString();
record.Method = this.ddlMethod.SelectedValue;
record.Note = this.txtContent.Text;
record.UserID = int.Parse(Session["Userid"].ToString());
if (rbll.BioCrmContactRecord_ADD(record) != 0)
{
Response.Redirect("RecordListShow.aspx");
}
else
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "test", "alert('添加失败');", true);
} } protected void btnReturn_Click(object sender, EventArgs e)
{
Server.Transfer("CustomerListShow.aspx");
} protected void txtCustomerID_TextChanged(object sender, EventArgs e)
{
if(txtCustomerID.Text.Trim()!="" && txtCustomerID.Text.Trim().Length!=0&&txtCustomerID.Text.Trim()!="请选择")
{
string id=this.txtCustomerID.Text;
System.Data.DataTable dt = SqlComm.GetDataByCondition("BioCrmLinkmanInfo", "LinkmanID,LinkmanName", "CustomerID=" + id).Tables[0];
if (dt.Rows.Count > 0)
{
this.ddlLinkMan.DataSource = dt;
this.ddlLinkMan.DataTextField = "LinkmanName";
this.ddlLinkMan.DataValueField = "LinkmanID";
this.ddlLinkMan.DataBind();
}
else
{
this.ddlLinkMan.Items.Clear();
this.ddlLinkMan.Items.Add(new ListItem("--请选择--", "0"));
} } } }

绑定相关的客户信息:

自定义视图:

SELECT   dbo.UserManager.UserName, dbo.BioCrmContactRecord.NoteID, dbo.BioCrmContactRecord.Note,
dbo.BioCrmContactRecord.ContactTime, dbo.BioCrmContactRecord.CustomerID, dbo.BioCrmContactRecord.LinkmanID,
dbo.BioCrmContactRecord.Type, dbo.BioCrmContactRecord.Method, dbo.BioCrmContactRecord.NoteTime,
dbo.BioCrmContactRecord.UserID, dbo.BioCrmContactRecord.DeleteState, dbo.BioCrmLinkmanInfo.LinkmanName,
dbo.BioCrmCustomer.CustomerName
FROM dbo.BioCrmContactRecord INNER JOIN
dbo.BioCrmCustomer ON dbo.BioCrmContactRecord.CustomerID = dbo.BioCrmCustomer.CustomerID INNER JOIN
dbo.BioCrmLinkmanInfo ON dbo.BioCrmContactRecord.LinkmanID = dbo.BioCrmLinkmanInfo.LinkmanID INNER JOIN
dbo.UserManager ON dbo.BioCrmContactRecord.UserID = dbo.UserManager.UserId

绑定查询的结果页面:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RecordListShow.aspx.cs" Inherits="BioErpWeb.CRMSystem.RecordListShow" %>

<%@ Register assembly="AspNetPager" namespace="Wuqi.Webdiyer" tagprefix="webdiyer" %>

<%@ Register src="../UserControl/CRMMenuBar.ascx" tagname="CRMMenuBar" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="../Styles/ERPBaseStyle.css" rel="stylesheet" type="text/css" />
<link href="../Styles/AspNetPagerStyle.css" rel="stylesheet" type="text/css" />
<style type="text/css">
td{ text-align:center;}
.tdsearch{ line-height:30px;}
.menubar{ background:url(../Web/images/block_hd_bg.png); height:25px; width:100%;}
.menubar ul{ margin:0px; padding:0px; list-style:none;}
.menubar ul li{ display:inline; line-height:25px;}
.menubar ul li a{display:inline-block; text-align:center; width:100px; color:#0066CC; text-decoration:none;} </style>
</head>
<body>
<form id="form1" runat="server">
<div> <uc1:CRMMenuBar ID="CRMMenuBar1" runat="server" /> </div>
<div>
<table class="maintable" style=" width:900px;">
<tr>
<td colspan="5" class="titlebar">
<span>客户联系记录管理</span>
</td>
</tr>
<tr>
<td class="tdsearch">
<asp:Label ID="Label1" runat="server" Text="联系人姓名:"></asp:Label>
<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
</td>
<td class="tdsearch">
<asp:Label ID="Label2" runat="server" Text="客户名:"></asp:Label>
<asp:TextBox ID="txtCName" runat="server"></asp:TextBox>
</td>
<td class="tdsearch">
<asp:Label ID="Label3" runat="server" Text="是否删除"></asp:Label>
<asp:DropDownList ID="ddlState" runat="server">
<asp:ListItem Value="0">否</asp:ListItem>
<asp:ListItem Value="1">是</asp:ListItem>
</asp:DropDownList>
</td> <td class="tdsearch">
<asp:ImageButton ID="imgbutnSearch" Width="60" Height="22" runat="server"
ImageUrl="~/Web/images/Btnsearch.gif" onclick="imgbutnSearch_Click" /> 
<asp:ImageButton ID="imgbtnNew" runat="server" Width="60" Height="22"
ImageUrl="~/Web/images/btnadd.gif" onclick="imgbtnNew_Click"/>
</td>
</tr>
<tr>
<td colspan="5" class="bottomtd">
<asp:GridView ID="GridView1" Width="100%" runat="server" AutoGenerateColumns="False" DataKeyNames="NoteID">
<Columns>
<asp:TemplateField HeaderText="记录编号" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Eval("NoteID") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="联系人姓名" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="Label5" runat="server" Text='<%# Eval("LinkmanName") %>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="120px" HorizontalAlign="Center" />
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="所属客户(公司)" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# Eval("CustomerName") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="联系时间" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="Label7" runat="server" Text='<%# Eval("ContactTime") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="联系方式" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="Label9" runat="server" Text='<%# Eval("Method") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="操作员工" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="Label10" runat="server" Text='<%#Eval("UserName") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="联系内容" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="Label10" runat="server" Text='<%#Eval("Note").ToString().Length>5?Eval("Note").ToString().Substring(0,5)+"…":Eval("Note").ToString() %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField> <asp:HyperLinkField DataNavigateUrlFields="NoteID"
DataNavigateUrlFormatString="ContactRecordUpdate.aspx?ID={0}" HeaderText="操作"
Text="查看并修改">
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</asp:HyperLinkField>
</Columns>
</asp:GridView>
</td>
</tr>
<tr>
<td colspan="5">
<webdiyer:AspNetPager ID="AspNetPager1" runat="server" CssClass="paginator" CurrentPageButtonClass="cpb"
onpagechanged="AspNetPager1_PageChanged">
</webdiyer:AspNetPager>
</td>
</tr> </table> </div>
</form>
</body>
</html>

后台代码:

   /// <summary>
/// 查询所有联系人信息
/// </summary>
private void getallPageList()
{
this.AspNetPager1.RecordCount = SqlComm.getDataCountByCondition("dbo.View_CRMContactRecordInfo", condition);
this.AspNetPager1.PageSize = pagesize;
this.GridView1.DataSource = SqlComm.getDataByPageIndex("dbo.View_CRMContactRecordInfo", "*", "NoteID", condition, pageindex, pagesize);
this.GridView1.DataBind();
}

ERP联系人查询和修改(十六)的更多相关文章

  1. SolrJ查询条件组合查询实现——(十六)

    带查询条件的实现原理: 查询按钮被包在一个大表单,表单还有三个隐藏域,一个商品筛选,一个 价格,一个排序,每次点击查询时候清空三个隐藏域,就带着一个大条件去查询;点击下面的筛选条件时,给隐藏域的筛选条 ...

  2. FreeSql (十六)分页查询

    IFreeSql fsql = new FreeSql.FreeSqlBuilder() .UseConnectionString(FreeSql.DataType.MySql, "Data ...

  3. FreeSql (二十六)贪婪加载 Include、IncludeMany、Dto、ToList

    贪婪加载顾名思议就是把所有要加载的东西一次性读取. 本节内容为了配合[延时加载]而诞生,贪婪加载和他本该在一起介绍,开发项目的过程中应该双管齐下,才能写出高质量的程序. Dto 映射查询 Select ...

  4. m_Orchestrate learning system---三十六、如何修改插件的样式(比如ueditor)

    m_Orchestrate learning system---三十六.如何修改插件的样式(比如ueditor) 一.总结 一句话总结:所有的js,html插件,修改样式无非是两种,一是直接修改css ...

  5. 第三百六十六节,Python分布式爬虫打造搜索引擎Scrapy精讲—elasticsearch(搜索引擎)的bool组合查询

    第三百六十六节,Python分布式爬虫打造搜索引擎Scrapy精讲—elasticsearch(搜索引擎)的bool组合查询 bool查询说明 filter:[],字段的过滤,不参与打分must:[] ...

  6. [系统安全] 十六.PE文件逆向基础知识(PE解析、PE编辑工具和PE修改)

    [系统安全] 十六.PE文件逆向基础知识(PE解析.PE编辑工具和PE修改) 文章来源:https://masterxsec.github.io/2017/05/02/PE%E6%96%87%E4%B ...

  7. (Linux基础学习)第六章:查询与修改系统的本地化(locale)与键盘布局的设置(locelectl)

    第1节:可查询与修改系统的本地化(locale)与键盘布局的设置[root@centos7 ~]# localectl System Locale: LANG=en_US.UTF-8 VC Keyma ...

  8. ASP.NET MVC深入浅出系列(持续更新) ORM系列之Entity FrameWork详解(持续更新) 第十六节:语法总结(3)(C#6.0和C#7.0新语法) 第三节:深度剖析各类数据结构(Array、List、Queue、Stack)及线程安全问题和yeild关键字 各种通讯连接方式 设计模式篇 第十二节: 总结Quartz.Net几种部署模式(IIS、Exe、服务部署【借

    ASP.NET MVC深入浅出系列(持续更新)   一. ASP.NET体系 从事.Net开发以来,最先接触的Web开发框架是Asp.Net WebForm,该框架高度封装,为了隐藏Http的无状态模 ...

  9. 我的MYSQL学习心得(十六) 优化

    我的MYSQL学习心得(十六) 优化 我的MYSQL学习心得(一) 简单语法 我的MYSQL学习心得(二) 数据类型宽度 我的MYSQL学习心得(三) 查看字段长度 我的MYSQL学习心得(四) 数据 ...

随机推荐

  1. jsp之 ---- 页面重定向和请求转发(笔记之深度说明)

    1.  HttpServletResponse对象的sendRedirect(String location)方法称作重定向. 如果location地址前面加上“/”,则表示  相对于Servlet容 ...

  2. hdu 4405Aeroplane chess(概率DP)

    Aeroplane chess Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  3. Simplify Path [LeetCode]

    Given an absolute path for a file (Unix-style), simplify it. For example,path = "/home/", ...

  4. poj1258 Agri-Net (prim+heap)

    题目链接:poj1258 Agri-Net 这题我上个月做过,是个大水题,今天看见有人用prim+heap做的,就学习了下. #include<cstdio> #include<cs ...

  5. Objective-C:Foundation框架-结构体

    在Foundation中定义了很多常用结构体类型来简化我们的日常开发,这些结构体完全采用Objective-C定义,和我们自己定义的结构体没有任何区别,之所以由框架为我们提供完全是为了简化我们的开发. ...

  6. PHP函数——urlencode() 函数

    urlencode($str)的作用是对字符串$str进行url编码,方便$str作为一个变量传递给下一页,一般情况下$str有两种, 第一种是数组类型,如果想将数组作为url的一个参数,即必须将数组 ...

  7. biztalk中使用WCF-SQL接受传送数据【转】

    接触biztalk时间不长,转载一篇学习教程: http://www.cnblogs.com/chnking/archive/2010/05/09/1731098.html chnking写的. 一. ...

  8. db2权限控制(转)

    转自:http://gocom.primeton.com/blog16274_23254.htm db2权限控制 1. DB2 权限控制数据库安全性计划的以下几方面: 授予用户的权限级别 允许用户运行 ...

  9. 关于python中的编码:unicode, utf-8, gb2312

    计算机早期是只支持ASCII码的,经过long long的发展,出现了这些支持世界上各种语言字符的编码:unicode, utf-8, gb2312. 对于unicode, utf-8, gb2312 ...

  10. POJ 2762 tarjan缩点+并查集+度数

    Going from u to v or from v to u? Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 15494 ...