设计意义:

渠道活动的方式方法多种多样。不过,大至可分为销售型促销与市场型促销(一般来说,销售型促销以完成销售额为唯一目的,以奖励返点为唯一手段,以增大经销商库存为最终结果,短期行为明显。而市场型促销以完成销售额为最终目的—不是唯一目的,以市场的管理工作、市场基础投入、培训导购、终端建设、卖场活性化、现场促销、市场研究等为手段,以市场的良性建康发展为结果。

需求:

1.基本信息:
         活动名称,所属渠道,活动时间,活动地点,活动负责人,活动描述,状态。
2.相关业务:
        活动信息记录,活动信息查询,活动信息修改(改变状态)。

存储过程的封装:

CREATE PROCEDURE BioErpCrmChannelActivity_ADD
@ActiveName nvarchar(100),
@ChannelID int,
@ActivityTime datetime,
@ActivityAddress nvarchar(100),
@Principal nvarchar(10),
@ActivityDesc nvarchar(4000)
AS
INSERT INTO [BioErpCrmChannelActivity](
[ActiveName],[ChannelID],[ActivityTime],[ActivityAddress],[Principal],[ActivityDesc]
)VALUES(
@ActiveName,@ChannelID,@ActivityTime,@ActivityAddress,@Principal,@ActivityDesc
)
CREATE PROCEDURE BioErpCrmChannelActivity_Update
@ActivityID int,
@ActiveName nvarchar(100),
@ChannelID int,
@ActivityTime datetime,
@ActivityAddress nvarchar(100),
@Principal nvarchar(10),
@ActivityDesc nvarchar(4000),
@DeleteState bit
AS
UPDATE [BioErpCrmChannelActivity] SET
[ActiveName] = @ActiveName,[ChannelID] = @ChannelID,[ActivityTime] = @ActivityTime,[ActivityAddress] = @ActivityAddress,[Principal] = @Principal,[ActivityDesc] = @ActivityDesc,[DeleteState] = @DeleteState
WHERE ActivityID=@ActivityID

创建活动编号返回活动的视图:

CREATE VIEW dbo.View_CRMChannelActivity
AS
SELECT dbo.BioErpCrmManageChannel.ChannelName, dbo.BioErpCrmChannelActivity.*
FROM dbo.BioErpCrmChannelActivity INNER JOIN
dbo.BioErpCrmManageChannel ON dbo.BioErpCrmChannelActivity.ChannelID = dbo.BioErpCrmManageChannel.ChannelID

BLL层:

       /// <summary>
/// 添加一条活动信息
/// </summary>
/// <param name="active"></param>
/// <returns></returns>
public int ChannelActiveAdd(BioErpCrmChannelActivity active)
{ SqlParameter[] pars = new SqlParameter[]{
new SqlParameter("@ChannelID",active.ChannelID),
new SqlParameter("@ActiveName",active.ActiveName),
new SqlParameter("@ActivityTime",active.ActivityTime),
new SqlParameter("@ActivityAddress",active.ActivityAddress),
new SqlParameter("@Principal",active.Principal),
new SqlParameter("@ActivityDesc",active.ActivityDesc),
}; return DAL.DataBaseHelper.ExcuteSqlReturnInt("BioErpCrmChannelActivity_ADD",CommandType.StoredProcedure,pars); } /// <summary>
/// 修改一条活动信息
/// </summary>
/// <param name="active"></param>
/// <returns></returns>
public int ChannelActiveUpdate(BioErpCrmChannelActivity active)
{ SqlParameter[] pars = new SqlParameter[]{
new SqlParameter("@ActivityID",active.ActivityID),
new SqlParameter("@ChannelID",active.ChannelID),
new SqlParameter("@ActiveName",active.ActiveName),
new SqlParameter("@ActivityTime",active.ActivityTime),
new SqlParameter("@ActivityAddress",active.ActivityAddress),
new SqlParameter("@Principal",active.Principal),
new SqlParameter("@ActivityDesc",active.ActivityDesc),
}; return DAL.DataBaseHelper.ExcuteSqlReturnInt("BioErpCrmChannelActivity_Update", CommandType.StoredProcedure, pars); } /// <summary>
/// 根据活动编号返回活动的视图对象
/// </summary>
/// <param name="id">id</param>
/// <returns>ViewCRMChannelActivity</returns>
public ViewCRMChannelActivity getViewActiveityByActivityID(string id)
{
SqlDataReader reader= SqlComm.GetDataReaderByCondition("View_CRMChannelActivity", "*", " id=" + id);
ViewCRMChannelActivity active = null;
while (reader.Read())
{
active = new ViewCRMChannelActivity()
{
ActiveName = reader["ActiveName"].ToString(),
ActivityAddress = reader["ActivityAddress"].ToString(),
ActivityDesc = reader["ActivityDesc"].ToString(),
ActivityID =int.Parse( reader["ActivityID"].ToString()),
ActivityTime = Convert.ToDateTime(reader["ActivityTime"].ToString()),
ChannelID = int.Parse(reader["ChannelID"].ToString()),
ChannelName = reader["ChannelName"].ToString(),
DeleteState =Convert.ToBoolean( reader["DeleteState"].ToString()),
Principal = reader["Principal"].ToString()
};
}
reader.Close();
return active;
}

添加的前端:

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

<!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/ChannelChoose.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/jquery.metadata.js" type="text/javascript"></script>
<script src="../../Scripts/ValidateMessage_ZW.js" type="text/javascript"></script> <script type="text/javascript">
$(document).ready(function () {
$("#form1").validate();
}); </script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table class="maintable">
<tr>
<td colspan="2" class="titlebar"><span>活动信息记录</span></td>
</tr>
<tr>
<td>活动名称</td><td><asp:TextBox ID="txtName" runat="server" CssClass="required"></asp:TextBox></td>
</tr> <tr>
<td>
所属渠道
</td>
<td >
<asp:TextBox ID="txtSuperChannelID" CssClass="{required:true,number:true, min:1}" runat="server"></asp:TextBox><input type="button" value="选择" style=" width:100px;" onclick="showChannel()" />
</td>
</tr>
<tr>
<td>
活动负责人</td>
<td>
<asp:TextBox ID="txtPrincipal" runat="server" CssClass="required"></asp:TextBox>
</td>
</tr>
<tr>
<td>活动时间</td>
<td>
<asp:TextBox ID="txtTime" runat="server" CssClass="required"></asp:TextBox>
</td>
</tr>
<tr>
<td>活动地点</td>
<td>
<asp:TextBox ID="txtAddress" runat="server" CssClass="required"></asp:TextBox>
</td>
</tr>
<tr>
<td>
活动描述</td>
<td >
<asp:TextBox ID="txtActivityDesc" TextMode="MultiLine" Rows="5" runat="server"
Width="380px"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="2" class="bottomtd"> <asp:Button ID="btnSubmit" runat="server" Text="活动信息记录"
onclick="btnSubmit_Click" /> <asp:Button ID="btnReturn" runat="server" Text="返回列表" UseSubmitBehavior="false" onclick="btnReturn_Click"
/>
</td>
</tr> </table>
<br />
</div>
</form>
</body>
</html>

添加的后端代码:

 protected void btnSubmit_Click(object sender, EventArgs e)
{ BioErpCrmChannelActivity activity = new BioErpCrmChannelActivity()
{
ActiveName = this.txtName.Text,
Principal = this.txtPrincipal.Text,
ActivityAddress = this.txtAddress.Text,
ActivityTime = Convert.ToDateTime(this.txtTime.Text.ToString()),
ActivityDesc = this.txtActivityDesc.Text.Trim(),
ChannelID = int.Parse(this.txtSuperChannelID.Text.Trim())
};
ChannelActiveBLL activebll = new ChannelActiveBLL();
if (activebll.ChannelActiveAdd(activity) != 0)
{
Server.Transfer("ChannelAcitiveListShow.aspx");
}
else
{
ClientScript.RegisterStartupScript(this.GetType(), "test", "alert('活动记录提交失败')", true);
}
} protected void btnReturn_Click(object sender, EventArgs e)
{
Server.Transfer("ChannelAcitiveListShow.aspx");
}

前端查询和显示的代码:

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

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

<%@ Register src="../../UserControl/CRMChannelMenuBar.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" />
<link href="../../Scripts/jquery-ui-1.7.custom.css" rel="stylesheet" type="text/css" />
<script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.7.custom.min.js" type="text/javascript"></script>
<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>
<script type="text/javascript">
$().ready(function () {
$("#txtDate").datepicker({dateFormat:'yy-mm-dd'});
});
</script>
</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" Width="80px" runat="server"></asp:TextBox>
</td>
<td class="tdsearch">
<asp:Label ID="Label2" runat="server" Text="渠道名:"></asp:Label>
<asp:TextBox ID="txtCName" Width="80px" runat="server"></asp:TextBox>
</td>
<td class="tdsearch">
<asp:Label ID="Label3" runat="server" Text="活动时间:"></asp:Label>
<asp:TextBox ID="txtDate" Width="80px" runat="server"></asp:TextBox> </td>
<td class="tdsearch">
<asp:Label ID="Label8" runat="server" Text="活动状态:"></asp:Label>
<asp:DropDownList ID="ddlSate" runat="server">
<asp:ListItem Text="未完成" Value="0"></asp:ListItem>
<asp:ListItem Text="已完成" 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="ActivityID">
<Columns>
<asp:TemplateField HeaderText="活动名称" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Eval("ActiveName") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="所属渠道" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# Eval("ChannelName") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="负责人">
<ItemTemplate>
<asp:Label ID="lbpri" runat="server" Text='<%# Eval("Principal") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="活动地点" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="Label7" runat="server" Text='<%# Eval("ActivityAddress") %>'></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='<%# Convert.ToDateTime( Eval("ActivityTime")).ToString("yyyy-MM-dd") %>'></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("ActivityDesc").ToString().Length>10 ?Eval("ActivityDesc").ToString().Substring(0,10)+"…":Eval("ActivityDesc").ToString() %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:HyperLinkField DataNavigateUrlFields="ActivityID" DataNavigateUrlFormatString="ChannelAcitiveDetial.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()
{
string id = Session["Userid"].ToString();
//condition += " and UserID=" + id;
//if (UserLogin.user.RoleId == 6) //市场部经理
//{
// condition += " or UserID !=" + id;
//}
this.AspNetPager1.RecordCount = SqlComm.getDataCountByCondition("dbo.View_CRMChannelActivity", condition);
this.AspNetPager1.PageSize = pagesize;
this.GridView1.DataSource = SqlComm.getDataByPageIndex("dbo.View_CRMChannelActivity", "*", "ActivityID", condition, pageindex, pagesize);
this.GridView1.DataBind();
} protected void AspNetPager1_PageChanged(object sender, EventArgs e)
{
pageindex = this.AspNetPager1.CurrentPageIndex - 1;
getallPageList();
} protected void imgbutnSearch_Click(object sender, ImageClickEventArgs e)
{
pageindex = 0;
condition = "";
if (txtName.Text.Trim() != null && this.txtName.Text.Trim().Length != 0)
{
condition = condition + " and ActiveName like '" + txtName.Text + "%'";
} if (this.txtCName.Text.Trim() != null && this.txtCName.Text.Trim().Length != 0)
{
condition = condition + " and ChannelName like '" + txtCName.Text + "%'";
} if (this.txtDate.Text.Trim() != null && this.txtDate.Text.Trim().Length!=0)
{
condition = condition + " and (ActivityTime >= '" + this.txtDate.Text + "' AND ActivityTime< '" + Convert.ToDateTime(this.txtDate.Text).AddDays(1) + "')";
} condition = condition + " and DeleteState=" + this.ddlSate.SelectedValue.ToString(); getallPageList(); }

活动记录显示:

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

<!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/ChannelChoose.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/jquery.metadata.js" type="text/javascript"></script>
<script src="../../Scripts/ValidateMessage_ZW.js" type="text/javascript"></script> <script type="text/javascript">
$(document).ready(function () {
$("#form1").validate();
}); </script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table class="maintable">
<tr>
<td colspan="2" class="titlebar"><span>活动信息记录</span></td>
</tr>
<tr>
<td>活动名称</td><td><asp:Label ID="txtName" runat="server"></asp:Label></td>
</tr> <tr>
<td>
所属渠道
</td>
<td >
<asp:Label ID="txtSuperChannelID" runat="server"></asp:Label> </td>
</tr>
<tr>
<td>
活动负责人</td>
<td>
<asp:Label ID="txtPrincipal" runat="server" ></asp:Label>
</td>
</tr>
<tr>
<td>活动时间</td>
<td>
<asp:Label ID="txtTime" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td>活动地点</td>
<td>
<asp:Label ID="txtAddress" runat="server" ></asp:Label>
</td>
</tr>
<tr>
<td>
活动描述</td>
<td >
<asp:Label ID="txtActivityDesc" runat="server" ></asp:Label>
</td>
</tr>
<tr>
<td>
活动状态</td>
<td >
<asp:Label ID="ddlSate" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2" class="bottomtd"> <asp:Button ID="btnSubmit" runat="server" Text="编辑"
onclick="btnSubmit_Click" /> <asp:Button ID="btnReturn" runat="server" Text="返回" UseSubmitBehavior="false" onclick="btnReturn_Click"
/>
</td>
</tr> </table>
<br />
</div>
</form>
</body>
</html>

活动记录后台:

    public void pageinfo()
{
if (Request.QueryString["ID"] == null)
{
Response.Redirect("ChannelAcitiveListShow.aspx");
return;
} string id= Request.QueryString["ID"].ToString();
ViewCRMChannelActivity active = new ViewCRMChannelActivity();
ChannelActiveBLL activebll = new ChannelActiveBLL();
active= activebll.getViewActiveityByActivityID(id);
this.txtTime.Text = active.ActivityTime.ToString();
this.txtSuperChannelID.Text = active.ChannelName + "(编号:" + active.ChannelID + ")";
this.txtPrincipal.Text = active.Principal;
this.txtName.Text = active.ActiveName;
this.txtAddress.Text = active.ActivityAddress;
this.txtActivityDesc.Text = active.ActivityDesc;
this.ddlSate.Text =Convert.ToBoolean(active.DeleteState) ? "已完成" : "未完成"; } protected void btnSubmit_Click(object sender, EventArgs e)
{ Server.Transfer("ChannelAcitiveEidt.aspx?ID="+Request.QueryString["ID"]);
} protected void btnReturn_Click(object sender, EventArgs e)
{
Server.Transfer("ChannelAcitiveListShow.aspx");
}

编辑的前端:

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

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

<%@ Register src="../../UserControl/CRMChannelMenuBar.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" />
<link href="../../Scripts/jquery-ui-1.7.custom.css" rel="stylesheet" type="text/css" />
<script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.7.custom.min.js" type="text/javascript"></script>
<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>
<script type="text/javascript">
$().ready(function () {
$("#txtDate").datepicker({dateFormat:'yy-mm-dd'});
});
</script>
</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" Width="80px" runat="server"></asp:TextBox>
</td>
<td class="tdsearch">
<asp:Label ID="Label2" runat="server" Text="渠道名:"></asp:Label>
<asp:TextBox ID="txtCName" Width="80px" runat="server"></asp:TextBox>
</td>
<td class="tdsearch">
<asp:Label ID="Label3" runat="server" Text="活动时间:"></asp:Label>
<asp:TextBox ID="txtDate" Width="80px" runat="server"></asp:TextBox> </td>
<td class="tdsearch">
<asp:Label ID="Label8" runat="server" Text="活动状态:"></asp:Label>
<asp:DropDownList ID="ddlSate" runat="server">
<asp:ListItem Text="未完成" Value="0"></asp:ListItem>
<asp:ListItem Text="已完成" 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="ActivityID">
<Columns>
<asp:TemplateField HeaderText="活动名称" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Eval("ActiveName") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="所属渠道" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="Label6" runat="server" Text='<%# Eval("ChannelName") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="负责人">
<ItemTemplate>
<asp:Label ID="lbpri" runat="server" Text='<%# Eval("Principal") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="活动地点" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="Label7" runat="server" Text='<%# Eval("ActivityAddress") %>'></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='<%# Convert.ToDateTime( Eval("ActivityTime")).ToString("yyyy-MM-dd") %>'></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("ActivityDesc").ToString().Length>10 ?Eval("ActivityDesc").ToString().Substring(0,10)+"…":Eval("ActivityDesc").ToString() %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:HyperLinkField DataNavigateUrlFields="ActivityID" DataNavigateUrlFormatString="ChannelAcitiveDetial.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>

后台代码:

    protected void Page_Load(object sender, EventArgs e)
{
Session["Userid"] = "29"; if (Request.QueryString["ID"] == null)
{
Response.Redirect("ChannelAcitiveListShow.aspx");
return;
} if (!IsPostBack)
{
pageinfo();
}
}
public void pageinfo()
{
if (Request.QueryString["ID"] == null)
{
Response.Redirect("ChannelAcitiveListShow.aspx");
return;
} string id = Request.QueryString["ID"].ToString();
ViewCRMChannelActivity active = new ViewCRMChannelActivity();
ChannelActiveBLL activebll = new ChannelActiveBLL();
active = activebll.getViewActiveityByActivityID(id);
this.txtTime.Text = active.ActivityTime.ToString();
this.txtSuperChannelID.Text = active.ChannelID.ToString();
this.txtPrincipal.Text = active.Principal;
this.txtName.Text = active.ActiveName;
this.txtAddress.Text = active.ActivityAddress;
this.txtActivityDesc.Text = active.ActivityDesc;
this.ddlSate.SelectedValue = Convert.ToBoolean(active.DeleteState) ? "1" : "0";
} protected void btnSubmit_Click(object sender, EventArgs e)
{ string ID= Request.QueryString["ID"].ToString();
BioErpCrmChannelActivity activity = new BioErpCrmChannelActivity()
{
ActivityID=int.Parse(ID),
ActiveName = this.txtName.Text,
Principal = this.txtPrincipal.Text,
ActivityAddress = this.txtAddress.Text,
ActivityTime = Convert.ToDateTime(this.txtTime.Text.ToString()),
ActivityDesc = this.txtActivityDesc.Text.Trim(),
ChannelID = int.Parse(this.txtSuperChannelID.Text.Trim()),
DeleteState=ddlSate.SelectedValue.ToString()=="0"?false :true };
ChannelActiveBLL activebll = new ChannelActiveBLL();
if (activebll.ChannelActiveUpdate(activity) != 0)
{
Server.Transfer("ChannelAcitiveListShow.aspx");
}
else
{
ClientScript.RegisterStartupScript(this.GetType(), "test", "alert('活动记录编辑失败')", true);
}
} protected void btnReturn_Click(object sender, EventArgs e)
{
Server.Transfer("ChannelAcitiveListShow.aspx");
}

ERP渠道活动管理(二十六)的更多相关文章

  1. 二十六、Jcreator使用初步

    摘自http://blog.csdn.net/liujun13579/article/details/7751464 二十六.Jcreator使用初步 Jcreator是一个小巧灵活的Java开发工具 ...

  2. VMware vSphere 服务器虚拟化之二十六 桌面虚拟化之View Persona Management

    VMware vSphere 服务器虚拟化之二十六 桌面虚拟化之View Persona Management 实验失败告终,启动VMware View Persona Management服务报10 ...

  3. 二十六个月Android学习工作总结【转】

    原文:二十六个月Android学习工作总结 1.客户端的功能逻辑不难,UI界面也不难,但写UI花的时间是写功能逻辑的两倍.     2.写代码前的思考过程非常重要,即使在简单的功能,也需要在本子上把该 ...

  4. Bootstrap <基础二十六>进度条

    Bootstrap 进度条.在本教程中,你将看到如何使用 Bootstrap 创建加载.重定向或动作状态的进度条. Bootstrap 进度条使用 CSS3 过渡和动画来获得该效果.Internet ...

  5. Web 前端开发人员和设计师必读精华文章【系列二十六】

    <Web 前端开发精华文章推荐>2014年第5期(总第26期)和大家见面了.梦想天空博客关注 前端开发 技术,分享各类能够提升网站用户体验的优秀 jQuery 插件,展示前沿的 HTML5 ...

  6. 二十六:Struts2 和 spring整合

    二十六:Struts2 和 spring整合 将项目名称为day29_02_struts2Spring下的scr目录下的Struts.xml文件拷贝到新项目的scr目录下 在新项目的WebRoot-- ...

  7. WCF技术剖析之二十六:如何导出WCF服务的元数据(Metadata)[扩展篇]

    原文:WCF技术剖析之二十六:如何导出WCF服务的元数据(Metadata)[扩展篇] 通过<实现篇>对WSDL元素和终结点三要素的之间的匹配关系的介绍,我们知道了WSDL的Binding ...

  8. WCF技术剖析之二十六:如何导出WCF服务的元数据(Metadata)[实现篇]

    原文:WCF技术剖析之二十六:如何导出WCF服务的元数据(Metadata)[实现篇] 元数据的导出就是实现从ServiceEndpoint对象向MetadataSet对象转换的过程,在WCF元数据框 ...

  9. 第一百二十六节,JavaScript,XPath操作xml节点

    第一百二十六节,JavaScript,XPath操作xml节点 学习要点: 1.IE中的XPath 2.W3C中的XPath 3.XPath跨浏览器兼容 XPath是一种节点查找手段,对比之前使用标准 ...

随机推荐

  1. 【设计模式】—— 适配器模式Adapter

    前言:[模式总览]——————————by xingoo 模式意图 如果已经有了一种类,而需要调用的接口却并不能通过这个类实现.因此,把这个现有的类,经过适配,转换成支持接口的类. 换句话说,就是把一 ...

  2. CentOS7下安装Scrapy

    更新yum[root@localhost ~]# yum -y update1安装gcc及扩展包[root@localhost ~]# yum install gcc libffi-devel pyt ...

  3. c# 行转列

    将下面表(1)格式的数据转换为表(2)格式的数据.很明显,这是一个行转列的要求,本想在数据库中行转列,因为在数据库中行转列是比较简单的,方法可以参考本站SQLServer中(行列转换)行转列及列转行且 ...

  4. 【刷题】BZOJ 3512 DZY Loves Math IV

    Description 给定n,m,求 模10^9+7的值. Input 仅一行,两个整数n,m. Output 仅一行答案. Sample Input 100000 1000000000 Sampl ...

  5. 洛谷 P2527 [SHOI2001]Panda的烦恼 解题报告

    P2527 [SHOI2001]Panda的烦恼 题目描述 panda是个数学怪人,他非常喜欢研究跟别人相反的事情.最近他正在研究筛法,众所周知,对一个范围内的整数,经过筛法处理以后,剩下的全部都是质 ...

  6. POJ 2387 Til the Cows Come Home (图论,最短路径)

    POJ 2387 Til the Cows Come Home (图论,最短路径) Description Bessie is out in the field and wants to get ba ...

  7. oracle数据库连接池查看

    select username , count(*), machine from v$session where username is not null group by username, mac ...

  8. LInux上返回到切换目录前的目录

    在Linux系统上,切换目录用命令cd (change directory),查看当前目录的命令pwd (print working directory). 例如当前目录为:/home/keysyst ...

  9. 【leetcode】Path Sum2

    Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given su ...

  10. Centos7搭建SS以及加速配置的操作记录

    部署 Shadowsocks之前,对它做了一个简单的了解,下面先介绍下.一道隐形的墙众所周知,天朝局域网通过 GFW (中国防火墙长城:英文名称Great Firewall of China,简写为G ...