ERP渠道活动管理(二十五)
Posted 石
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ERP渠道活动管理(二十五)相关的知识,希望对你有一定的参考价值。
设计意义:
渠道活动的方式方法多种多样。不过,大至可分为销售型促销与市场型促销(一般来说,销售型促销以完成销售额为唯一目的,以奖励返点为唯一手段,以增大经销商库存为最终结果,短期行为明显。而市场型促销以完成销售额为最终目的—不是唯一目的,以市场的管理工作、市场基础投入、培训导购、终端建设、卖场活性化、现场促销、市场研究等为手段,以市场的良性建康发展为结果。
需求:
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 [email protected]
创建活动编号返回活动的视图:
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>
以上是关于ERP渠道活动管理(二十五)的主要内容,如果未能解决你的问题,请参考以下文章
Spring Boot + Spring Cloud 实现权限管理系统 后端篇(二十五):Spring Security 版本