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

<%@ 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. Populating Next Right Pointers in Each Node II [Leetcode]

    Problem Description http://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/ ...

  2. ABAP简单表维护的制作

    为了知识的积累,特作了个简单的表维护. 因为自己之前做dynpro程序的时候建了一个Tree node的表,所以就不在此重复.(在表的交付和维护页签中标的属性要是‘允许标准表维护的’) 直接Alt+U ...

  3. 项目三(集团官网)——总结(1) cookie

    最近十几天一直在忙着做集团官方网站的工作,从刚开始紧张的筹备一直到现在初步成型,今天才有时间特地来记录一下自己在这个项目中的收获. 先来说一说今天遇到的问题吧:关于cookie~ 事情起因是这样的:在 ...

  4. extjs DateField 的值用getValue()方法获取后是一大堆字符串,类似Tue Dec 07 2010 00:00:00 GMT 0800,这玩意存入数据库实在不好办。。。

    extjs DateField 的值用getValue()方法获取后是一大堆字符串,类似Tue Dec 07 2010 00:00:00 GMT 0800,这玩意存入数据库实在不好办...所以要把它格 ...

  5. 2016年5月19日php,mysql配置

    1.php配置 1. 配置disable_functiondisable_functions = eval,assert,popen,passthru,escapeshellarg,escapeshe ...

  6. EF的Model First

    一,添加ADO.NET实体数据模型(即edmx) 1,添加edmx         新建一个类库项目,项目中添加新项,选择数据/ADO.NET实体数据模型,如下图.   点击添加,实体数据模型向导窗口 ...

  7. SqlServer 慢查询分析优化

    分三步: 记录慢查询的语句到日志文件 1.首先在SSMS,工具菜单下打开Profiler. 2.输入你用户名密码登陆. 3.常规,勾选保存到文件,选择一个文件路径,设置文件大小,这样可以分文件存储日志 ...

  8. linux-网卡故障

    Linux 网络问题解决思路 1.查看 /etc/sysconfig/network-script/ 查看eth0和eth1的配置是否正确 2.查看 /etc/modual.conf 的配置模块是否正 ...

  9. 复利计算4.0单元测试(c语言)

    ——————————复利计算程序单元测试报告—————————— ————————————4.0 单元测试—————————————— ————————————————要求—————————————— ...

  10. 操作系统cmd算法

    实验一  命令解释程序的编写(两周内) 一.目的和要求 1. 实验目的 (1)掌握命令解释程序的原理: (2)*掌握简单的DOS调用方法: (3)掌握C语言编程初步. 2.实验要求 编写类似于DOS, ...