ERP联系记录管理(十七)

联系记录管理修改页面:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ContactRecordUpdate.aspx.cs"
Inherits="BioErpWeb.CRMSystem.ContactRecordUpdate" %> <%@ 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>
是否删除</td>
<td colspan="3">
<asp:CheckBox ID="cbDetele" runat="server"/>
</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 ContactRecordUpdate : 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"); }
if (!IsPostBack)
{
pageinfobind();
} }
protected void pageinfobind()
{ if (Request.QueryString["ID"] != null)
{
string recordid = Request.QueryString["ID"].ToString();
BioCrmContactRecordBLL rbll = new BioCrmContactRecordBLL();
BioCrmContactRecord record = new BioCrmContactRecord();
record=rbll.GetContactRecordByID(int.Parse(recordid));
this.txtCustomerID.Text = record.CustomerID.ToString();
//绑定联系人,根据联系人编号
ddlLinkManBind(" LinkmanID=" + record.LinkmanID.ToString());
txtContractTime.Text = record.ContactTime.ToString();
lbNoteTime.Text = record.NoteTime.ToString();
ddlType.SelectedValue = record.Type;
ddlMethod.SelectedValue = record.Method;
txtContent.Text = record.Note;
cbDetele.Checked =Convert.ToBoolean(record.DeleteState);
}
}
/// <summary>
/// 根据条件绑定联系人信息
/// </summary>
/// <param name="condition"></param>
private void ddlLinkManBind(string condition)
{
ddlLinkMan.DataSource = SqlComm.GetDataByCondition("BioCrmLinkmanInfo", "LinkmanID,LinkmanName", condition);
ddlLinkMan.DataTextField = "LinkmanName";
ddlLinkMan.DataValueField = "LinkmanID";
ddlLinkMan.DataBind();
} protected void btnSubmit_Click(object sender, EventArgs e)
{
if (Request.QueryString["ID"] != null)
{
BioCrmContactRecord record = new BioCrmContactRecord();
BioCrmContactRecordBLL rbll = new BioCrmContactRecordBLL(); record.NoteID =int.Parse( Request.QueryString["ID"].ToString());
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());
record.DeleteState = cbDetele.Checked;
if (rbll.BioCrmContactRecord_Update(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("RecordListShow.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"));
}
}
}
}

查询的页面:

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

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<%@ 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>
<script src="../JS/CustomerName.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager> <uc1:CRMMenuBar ID="CRMMenuBar1" runat="server" /> </div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div>
<table class="maintable" style=" width:900px;">
<tr>
<td colspan="5" class="titlebar">
<span>客户联系记录管理</span>
</td>
</tr>
<tr>
<td class="tdsearch">
<asp:Label ID="Label2" runat="server" Text="客户名:"></asp:Label>
<asp:TextBox ID="txtCustomerID" runat="server"></asp:TextBox>
<input ID="Button1" value="选择客户" type="button" Width="60px" onclick="showCustomerDialog()" />
</td>
<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="Label3" runat="server" Text="联系时间"></asp:Label>
<asp:TextBox ID="txtContactTime" runat="server"></asp:TextBox>
<cc1:CalendarExtender ID="CalendarExtender1" TargetControlID="txtContactTime" Format="yyyy-MM-dd" runat="server">
</cc1:CalendarExtender> </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='<%# Convert.ToDateTime(Eval("ContactTime")).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="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> </ContentTemplate>
</asp:UpdatePanel> </form>
</body>
</html>

后台代码:

 public partial class RecordListShow : System.Web.UI.Page
{ public static int pageindex = 0;
public static int pagesize = 10;
public static string condition = ""; protected void Page_Load(object sender, EventArgs e)
{ if (!IsPostBack)
{ getallPageList();
}
} /// <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();
} 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 LinkmanName like '" + txtName.Text + "%'";
} if (this.txtCustomerID.Text.Trim() != null && this.txtCustomerID.Text.Trim().Length != 0)
{
condition = condition + " and CustomerID ='" + this.txtCustomerID.Text + "'";
} if (this.txtContactTime.Text != "")
{
condition = condition + " and ContactTime ='" + this.txtContactTime.Text + "'";
} getallPageList();
} protected void btnNew_Click(object sender, EventArgs e)
{ } protected void imgbtnNew_Click(object sender, ImageClickEventArgs e)
{
Server.Transfer("LinkManAdd.aspx");
}
}

CRM客户管理系统文档管理:

需求:

1.根据相关客户生成相关文档,此模块是用来对客户相关的文档资料进行管理。

2.涉及到的基本信息:文档主题、文件名、文档类型、文档等级、文件大小、扩展名、文件内容、上传人、上传时间、文档说明、关联客户

3.主要功能点:

1、列表显示文档信息

2、添加文档资料

3、修改文档资料

4、删除文档资料

5、查看文档资料

实现的思路:

-- Description:	添加一条文档
-- =============================================
ALTER PROCEDURE [dbo].[BioCrmCorrelationDocument_Add]
--输出参数
@DocumentID int output,
@Subject nvarchar(100),
@Name nvarchar(100),
@Type nvarchar(100),
@DocumentLevel nvarchar(100),
@DocumentSize bigint,
@ExetendName nvarchar(20),
@Content image,
@UserID int,
-- @UploadTime datetime,
@Remark nvarchar(200)
AS
BEGIN
--为on是只返回受影响的行数
SET NOCOUNT ON;
INSERT BioCrmCorrelationDocument
(
Subject,
[Name],
[Type],
DocumentLevel,
DocumentSize,
ExetendName,
[Content],
UserID,
Remark
)
VALUES
(
@Subject,
@Name,
@Type,
@DocumentLevel,
@DocumentSize,
@ExetendName,
@Content,
@UserID,
@Remark
)
--表示列的值
SET @DocumentID=@@IDENTITY
END

修改文档:

Description:	修改文档信息
-- =============================================
ALTER PROCEDURE [dbo].[BioCrmSPCorrelationDocument_Update]
(
@DocumentID int,
@Subject nvarchar(100),
@Name nvarchar(100),
@Type nvarchar(100),
@DocumentLevel nvarchar(100),
@DocumentSize bigint,
@ExetendName nvarchar(20),
@Content image,
@UserID nvarchar(20),
@UploadTime datetime,
@Remark nvarchar(200) )
AS
BEGIN SET NOCOUNT ON;
UPDATE BioCrmCorrelationDocument
SET
Subject = @Subject,
[Name] = @Name,
[Type] = @Type,
DocumentLevel =@DocumentLevel,
DocumentSize = @DocumentSize,
ExetendName = @ExetendName,
[Content] = @Content,
UserID = @UserID,
UploadTime = @UploadTime,
Remark = @Remark
WHERE
DocumentID=@DocumentID
END

添加一条文档客户关系的信息:

ALTER PROCEDURE [dbo].[BioCrmCustomerDocument_ADD]
@CustomerID int,
@DocumentID int,
@DeleteState bit
AS
INSERT INTO [BioCrmCustomerDocument](
[CustomerID],[DocumentID],[DeleteState]
)VALUES(
@CustomerID,@DocumentID,@DeleteState
)

修改一条文档客户关系的信息:

ALTER PROCEDURE [dbo].[BioCrmCustomerDocument_Update]
@CustomerDocumentID int,
@CustomerID int,
@DocumentID int,
@DeleteState bit
AS
UPDATE [BioCrmCustomerDocument] SET
[CustomerID] = @CustomerID,[DocumentID] = @DocumentID,[DeleteState] = @DeleteState
WHERE CustomerDocumentID=@CustomerDocumentID

BLL层:

 public class BioCrmCustomerDocumentBLL
{
/// <summary>
/// 增加一条数据
/// </summary>
public int BioCrmCustomerDocumentAdd(BioCrmCustomerDocument model)
{
SqlParameter[] parameters = {
new SqlParameter("@CustomerID", SqlDbType.Int,4),
new SqlParameter("@DocumentID", SqlDbType.Int,4),
new SqlParameter("@DeleteState", SqlDbType.Bit,1)};
parameters[0].Value = model.CustomerID;
parameters[1].Value = model.DocumentID;
parameters[2].Value = model.DeleteState; return DataBaseHelper.ExcuteSqlReturnInt("BioCrmCustomerDocument_ADD", CommandType.StoredProcedure, parameters); }
/// <summary>
/// 修改一条数据
/// </summary>
public int BioCrmCustomerDocumentUpdate(BioCrmCustomerDocument model)
{
SqlParameter[] parameters = {
new SqlParameter("@CustomerDocumentID",SqlDbType.Int,4),
new SqlParameter("@CustomerID", SqlDbType.Int,4),
new SqlParameter("@DocumentID", SqlDbType.Int,4),
new SqlParameter("@DeleteState", SqlDbType.Bit,1)};
parameters[0].Value = model.CustomerID;
parameters[1].Value = model.CustomerID;
parameters[2].Value = model.DocumentID;
parameters[3].Value = model.DeleteState; return DataBaseHelper.ExcuteSqlReturnInt("BioCrmCustomerDocument_Update", CommandType.StoredProcedure, parameters); }
}
}

客户文档信息:

 public  class BioCrmCorrelationDocumentBLL
{ /// <summary>
/// 添加一个文档对象,并且返回当前文档对象的编号
/// </summary>
/// <param name="document">document</param>
/// <returns>int</returns>
public int BioCrmCorrelationDocumentAdd(BioCrmCorrelationDocument document)
{
SqlParameter[] pars = new SqlParameter[]{
new SqlParameter("@DocumentID",SqlDbType.Int),
new SqlParameter("@Subject",document.Subject),
new SqlParameter("@Name",document.Name),
new SqlParameter("@Type",document.Type),
new SqlParameter("@DocumentLevel",document.DocumentLevel),
new SqlParameter("@DocumentSize",document.DocumentSize),
new SqlParameter("@ExetendName",document.ExetendName),
new SqlParameter("@Content",document.Content),
new SqlParameter("@UserID",document.UserID),
new SqlParameter("@Remark",document.Remark)
}; pars[0].Direction = ParameterDirection.Output; int count= DataBaseHelper.ExcuteSqlReturnInt("BioCrmCorrelationDocument_Add", CommandType.StoredProcedure, pars);
if (count != 0)
{
return int.Parse(pars[0].Value.ToString());
}
else
{
return 0;
} } /// <summary>
/// 修改一个文档对象
/// </summary>
/// <param name="document">document</param>
/// <returns>int</returns>
public int BioCrmCorrelationDocumentUpdate(BioCrmCorrelationDocument document)
{
SqlParameter[] pars = new SqlParameter[]{
new SqlParameter("@DocumentID",document.DocumentID),
new SqlParameter("@Subject",document.Subject),
new SqlParameter("@Name",document.Name),
new SqlParameter("@Type",document.Type),
new SqlParameter("@DocumentLevel",document.DocumentLevel),
new SqlParameter("@DocumentSize",document.DocumentSize),
new SqlParameter("@ExetendName",document.ExetendName),
new SqlParameter("@Content",document.Content),
new SqlParameter("@UserID",document.UserID),
new SqlParameter("@Remark",document.Remark)
}; int count = DataBaseHelper.ExcuteSqlReturnInt("BioCrmSPCorrelationDocument_Update", CommandType.StoredProcedure, pars);
return count; }
}

添加的页面:

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

<!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 src="../Scripts/jquery.validate.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="txtsubJect" runat="server" CssClass="required"></asp:TextBox></td>
</tr>
<tr>
<td>
文档等级</td>
<td>
<asp:DropDownList ID="ddlLevel" runat="server">
<asp:ListItem Selected="True">一般文件</asp:ListItem>
<asp:ListItem>重要文件</asp:ListItem>
<asp:ListItem>非常重要文件</asp:ListItem>
<asp:ListItem>特别重要</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
文档选择</td>
<td>
<asp:FileUpload ID="FileUpload1" runat="server" />
</td>
</tr>
<tr>
<td>
所属客户
</td>
<td >
<asp:TextBox ID="txtCustomerID" runat="server"></asp:TextBox><input type="button" value="选择客户" style=" width:100px;" onclick="showCustomerDialog()" />
</td>
</tr>
<tr>
<td>
说明</td>
<td >
<asp:TextBox ID="txtRemark" 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="返回列表" onclick="btnReturn_Click"
/> </td>
</tr> </table>
<br />
</div>
</form>
</body>
</html>

后台代码:

 public partial class DocumentAdd : System.Web.UI.Page
{ protected void Page_Load(object sender, EventArgs e)
{
Session["Userid"] = "29";
if (!IsPostBack)
{ }
} protected void btnSubmit_Click(object sender, EventArgs e)
{
BioCrmCorrelationDocument document = new BioCrmCorrelationDocument();
document.Subject = this.txtsubJect.Text;
//保证文件的不重复
document.Name =DateTime.Now.ToString("yyyyMMdd hhmmss")+ this.FileUpload1.FileName; document.UserID =int.Parse( Session["Userid"].ToString());
document.Remark = this.txtRemark.Text;
document.DocumentLevel = this.ddlLevel.SelectedValue;
document.Content = this.FileUpload1.FileBytes; //获取文档的长度
document.DocumentSize=this.FileUpload1.FileContent.Length;
//文件的类型
document.Type=this.FileUpload1.PostedFile.ContentType;
//文件的类型
document.ExetendName=System.IO.Path.GetExtension(this.FileUpload1.FileName); //物理文件上传
string filepath = Server.MapPath(@"\Files\CRMFiles\");
//调用共用的上传方法
Comm.FileUpLoad(this.FileUpload1, filepath, document.Name); BioCrmCorrelationDocumentBLL documentbll = new BioCrmCorrelationDocumentBLL();
//文档信息添加 包括文件上传(转换为二进制数组后上传)
int documentid= documentbll.BioCrmCorrelationDocumentAdd(document);
//文档信息添加成功
if (documentid != 0)
{
BioCrmCustomerDocument customerdocument = new BioCrmCustomerDocument();
customerdocument.CustomerID = int.Parse(this.txtCustomerID.Text);
customerdocument.DeleteState = false;
customerdocument.DocumentID = documentid;
BioCrmCustomerDocumentBLL customerdocumentbll = new BioCrmCustomerDocumentBLL();
int count= customerdocumentbll.BioCrmCustomerDocumentAdd(customerdocument);
if (count == 0)
{
SqlComm.DeleteTableByCondition("BioCrmCorrelationDocument", "where DocumentID=" + documentid.ToString());
}
}
} protected void btnReturn_Click(object sender, EventArgs e)
{
Server.Transfer("DocumentListShow.aspx");
} }

创建一个重载的方法:

 /// <summary>
/// 与上面构建一个重载的方法
/// </summary>
/// <param name="fload"></param>
/// <param name="path"></param>
/// <param name="FileName"></param>
/// <returns></returns>
public static string FileUpLoad(FileUpload fload, string path,string FileName)
{
//判断指定路径是否存在此目录,如果没有则创建
if (!System.IO.Directory.Exists(path))
{
System.IO.Directory.CreateDirectory(path);
} int count = 0; string NewFileName = FileName;
//上传文件之前判断指定路径是否已经存在此文件,如果存在,则删除
if (System.IO.File.Exists(path + NewFileName))
{
System.IO.File.Delete(path + NewFileName);
} try
{ fload.SaveAs(path + NewFileName);
}
catch (Exception ex)
{
count++;
} if (count > 0)
{
return "false";
}
else
{
return NewFileName;
}
}

查询创建一个视图:

SELECT   dbo.BioCrmCustomer.CustomerName, dbo.BioCrmCorrelationDocument.DocumentID,
dbo.BioCrmCorrelationDocument.Subject, dbo.BioCrmCorrelationDocument.Name,
dbo.BioCrmCorrelationDocument.Type, dbo.BioCrmCorrelationDocument.DocumentLevel,
dbo.BioCrmCorrelationDocument.DocumentSize, dbo.BioCrmCorrelationDocument.ExetendName,
dbo.BioCrmCorrelationDocument.[Content], dbo.BioCrmCorrelationDocument.UserID,
dbo.BioCrmCorrelationDocument.UploadTime, dbo.BioCrmCorrelationDocument.Remark,
dbo.BioCrmCustomerDocument.CustomerID, dbo.BioCrmCustomerDocument.DeleteState,
dbo.BioCrmCustomerDocument.CustomerDocumentID
FROM dbo.BioCrmCustomerDocument INNER JOIN
dbo.BioCrmCorrelationDocument ON
dbo.BioCrmCustomerDocument.DocumentID = dbo.BioCrmCorrelationDocument.DocumentID INNER JOIN
dbo.BioCrmCustomer ON dbo.BioCrmCustomerDocument.CustomerID = dbo.BioCrmCustomer.CustomerID

视图中表的关联关系:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyQAAAEDCAIAAABLXlf0AAAgAElEQVR4nO2du47duLZomfcHOHRqwEADFeoPduBgw8n2D2wBhkNn7qQ6cybAcQUVGDd2pOQ0cPoH9hessJITVnCAm1yAN6BE8an3g+QaA4RRpZIoVnlxcazJKVLI//k/FAqFQqFQKJSDiri8BRQKhUKhUCgFF2SLQqFQKBQK5cAiJAAAQLm8QOl8/vz56lfZBMgWAACUzMvLy9VNgAN5fn5GtgAAAK5Eydb//t//RymyIFsAAAAXg2yVXZAtAACAi0G2yi7IFgAAwMUgW2UXZAsAAOBikK2yC7IFAABwMUHZeoVsQbYAAADSIiZb//2fG+W0svE/8fPnz6oeZAsAACA5kK0UitywuqzSKWQLAAAgUZCtFIr6j1g3b4hsAQAAJA2ylUKRyBYAAECpIFspFIlsAQAAlMp82RLicbJcbi2ZFolsAQAAlMqVsvXrj/fi4cuv611nj/L0QXz6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E5+wpW+ZOQcM2QDnLlulbTCMCwOEgW5ALWYx/G2VLiGGgTEe29qzzCmI5W75pIVsAcAjIFuRCFuPfFtlSgRa9KTWytRckyAPAxSBbkAtZjH+LZMuMY+lZrYWydWsqUbfDRF9vQ6YYmdOAhi3dmipw1J4zHJEtdWfdvLarrW6HOoyrh2rPn3pEtgDgYpAtyIUsxr+lsqV8yzStFbJlKdYgQPoL4+LhhFtT90etq2xHmytb/ZnKqfo7WDZ2cy87DWQLAC4G2YJcyGL8WyFbQdOSyyJb5g/Ut70YuZda57uxLefk8WnEsEuFvvYS7E8ObiFbAHAxyBbkQhbj39KcrZhp2ad50aBBaVbIVtXcOs9y6zhOti59bPHl5eV5CcgWAOwMsgW5kMX4tyJBPmhazmm3porM71k/Mb6JTyPq+b5AFeY0oqlj+uJVsuXOTp6dZf95OVm82GIgWwDJgWxBLmQx/o10qBfICpn8iy0GsgWQHC/IFmRCFuNfrENd3S5YQ+IvthjIFkByIFuQC1nLFmRKyi+2GMgWQHIgW5AL+coWpZiS1IstBrIFkBzIFuQCskW5vCT1YouBbAEkB7IFuYBsUS4vSb3YYiBbAMmBbEEuIFuUy0tSL7YYyBZAcozI1skPWgNMIpEtyqUlqRdbDGQLIDmCY8MrT6pDqqQvW4sWK4fsSOfFFgPZAkiOmGwBJEvKsrVisXLIjqtfZRMgWwDJwawHJfeSlGwBXA6yBZAcyBYl94JsAZggWwDJgWxRci/IFoAJsgWQHMgWJfeCbAGYIFsAyYFsUXIvyBaACbIFkBw8qQ4FgGwBaJAtgOS48vlpgP24uicBpAKyBQAAAHAgyBYAAADAgSBbAAAAAAfy/wEz8tKG19HpkQAAAABJRU5ErkJggg==" alt="" />

前台显示的界面:

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

<%@ 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="ddlLevel" runat="server">
<asp:ListItem Selected="True">--请选择--</asp:ListItem>
<asp:ListItem>一般文件</asp:ListItem>
<asp:ListItem>重要文件</asp:ListItem>
<asp:ListItem>非常重要文件</asp:ListItem>
<asp:ListItem>特别重要</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="DocumentID">
<Columns>
<asp:TemplateField HeaderText="文档主题" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Eval("Subject") %>'></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("Name") %>'></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("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("DocumentLevel") %>'></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("UploadTime") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField> <asp:HyperLinkField DataNavigateUrlFields="DocumentID"
DataNavigateUrlFormatString="DocumentEditAndDown.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>

后台显示和添加的代码:

  public partial class DocumentListShow : System.Web.UI.Page
{ public static int pageindex = 0;
public static int pagesize = 10;
public static string condition = ""; protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{ getallPageList();
}
} /// <summary>
/// 查询所有联系人信息
/// </summary>
private void getallPageList()
{
this.AspNetPager1.RecordCount = SqlComm.getDataCountByCondition("dbo.View_DoucmentInfo", condition);
this.AspNetPager1.PageSize = pagesize;
this.GridView1.DataSource = SqlComm.getDataByPageIndex("dbo.View_DoucmentInfo", "*", "DocumentID", 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 Subject like '" + txtName.Text + "%'";
} if (this.txtCName.Text.Trim() != null && this.txtCName.Text.Trim().Length != 0)
{
condition = condition + " and CustomerName like '" + txtCName.Text + "%'";
} if (this.ddlLevel.SelectedItem.Text != "--请选择--")
{
condition = condition + " and DocumentLevel ='" + this.ddlLevel.SelectedItem.Text + "'";
} getallPageList(); } protected void imgbtnNew_Click(object sender, ImageClickEventArgs e)
{
Server.Transfer("LinkManAdd.aspx");
} }

下载和修改的界面:

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

<!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="../JS/CheckUserName.js" type="text/javascript"></script>
<script src="../Scripts/jquery-1.4.1.min.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> <script type="text/javascript">
$(document).ready(function () {
$("#form1").validate();
}); </script>
<style type="text/css">
.style1
{
height: 20px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table class="maintable">
<tr>
<td colspan="2" class="titlebar"><span>客户文档信息编辑/下载</span></td>
</tr>
<tr>
<td class="style1">主题</td><td class="style1"><asp:TextBox ID="txtsubJect" runat="server" CssClass="required"></asp:TextBox></td>
</tr>
<tr>
<td class="style1">文件名</td><td class="style1">
<asp:Label ID="lbName" runat="server" Text=""></asp:Label>
</td>
</tr>
<tr>
<td class="style1">文件扩展名</td><td class="style1">
<asp:Label ID="lbExtendName" runat="server" Text=""></asp:Label>
</td>
</tr>
<tr>
<td class="style1">文件大小</td><td class="style1">
<asp:Label ID="lbSize" runat="server" Text=""></asp:Label>
</td>
</tr>
<tr>
<td class="style1">上传用户</td><td class="style1"> <asp:TextBox ID="txtUserName" runat="server"></asp:TextBox><input type="button" value="选择客户" style=" width:100px;" onclick="showDialog()" />
</td>
</tr>
<tr>
<td>
文档等级</td>
<td>
<asp:DropDownList ID="ddlLevel" runat="server">
<asp:ListItem Selected="True">一般文件</asp:ListItem>
<asp:ListItem>重要文件</asp:ListItem>
<asp:ListItem>非常重要文件</asp:ListItem>
<asp:ListItem>特别重要</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
文档选择</td>
<td>
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:LinkButton ID="lbtndown" runat="server">下载此文档</asp:LinkButton>
</td>
</tr>
<tr>
<td>
所属客户
</td>
<td >
<asp:TextBox ID="txtCustomerID" runat="server"></asp:TextBox><input type="button" value="选择客户" style=" width:100px;" onclick="showCustomerDialog()" />
</td>
</tr>
<tr>
<td>
说明</td>
<td >
<asp:TextBox ID="txtRemark" TextMode="MultiLine" Rows="5" runat="server"
Width="380px"></asp:TextBox>
</td>
</tr>
<tr>
<td>
是否删除</td>
<td >
<asp:CheckBox ID="cbDelete" runat="server" />
</td>
</tr>
<tr>
<td colspan="2" class="bottomtd"> <asp:HiddenField ID="hf_CustomerDocumentID" runat="server" /> <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>

文件下载的流程:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAhYAAAD1CAIAAACDaiuBAAASzUlEQVR4nO2cv24cORKHGRoGBAEWFljjglViO5AncOpMjg3D6cLY5LKDEy9O+UQLC/BbCH6PeQQ/hh/B4V0w0qinyaousil2U/V9+AVSD9n8U6z6uWdGDv8DAAAoIiw9AQAA6JW0hbx8vQkA7nn5etM4IQH6Im0hIYTNzQ4h5wqBx3QADSwEIVFYCIAOFoKQKCwEQAcLQUgUFgKgg4UgJAoLAdDBQhAShYUA6GAhCInCQgB0sBCERGEhADpYCEKisBAAHSwEIVFYCIAOFoKQKCwEQAcLQUgUFgKgg4UgJAoLAdDBQhAShYUA6GAhCInCQgB0sBCERGEhADpYCEKisBAAHSwEIVFYCIAOFoKQKCwEQAcLQUgUFgKgg4XUKTRlO1bccc4QDQZ9NMJCAHSwkDqF5oEsJGRiGUJvj0Z71TghAfoCC6lT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bAS2jQRkNSwr4ikyMvehOFKZ1SxK8RMx1KvJWlG6bDCNwEa2JWdrPCSiascbCwlxaU8osZNBCQ1bOF37fJLuLPegW1n9LZ7A3gwkqqkjOXSlMCmVw5gZV1kvTk/lkxfUbIuufxhrdqCiYCkhn0hy/zAzGuE93Yn9ybf++V1bqPqSEqS4qffftdnzKooVDJ7EigD/uWZvJdNL3BHeTgtmwhIatjuhRv/nknuvd3pvUokKWdJmrHEZmHJYn+wkRRDSUyaePSjV04ZBi8ErK+CTS8Um3tQDZoISGrY4yMp1ss3tZEUbmRrjM2S2ICTycI/laNXP9TlNCV7lelvmkcbIKlxZyGJ/Ze8sb3CLIncJyTt0dgaktjsQkq2iizKJNOPjyT7uHIPrUEDSU1bgyT2vd3JvfxrnoPu7n2IPQRwVSTFhpa+UiHa5ABWHsgIe8Mjko9XU1qDJgKSWrXzj1sPzL9Cynlvt7/XTxD/3832BzNLCn9lEo6EmJK1bBRIipW2URAk9ueAWuQA9I0gBC9bOLRkXc2aCEi6Wcvv7S58qzc7tMwsaVhfF3Lph5ZmpOkr8srMHc9sshLolCApN5JmDSTdquX3duOt3vCNGkiCYbghA0kwDDdkIAmG4YYMJMEw3JCBJBiGGzKQBMNwQyai/wGVKlCc9Qtl1wAAAABJRU5ErkJggg==" alt="" />

     /// <summary>
/// 通过id获取视图对象
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public DocumentInfoView getDocumentViewByID(string id)
{
SqlDataReader reader= SqlComm.GetDataReaderByCondition("View_DoucmentInfo", "*", " DocumentID=" + id);
DocumentInfoView documentview = null;
while (reader.Read())
{
documentview = new DocumentInfoView() {
UserID = int.Parse(reader["UserID"].ToString()),
CustomerID = int.Parse(reader["CustomerID"].ToString()),
CustomerName = reader["CustomerName"].ToString(),
DocumentID =int.Parse(reader["DocumentID"].ToString()),
DocumentLevel = reader["DocumentLevel"].ToString(),
DocumentSize=Convert.ToInt64(reader["DocumentSize"].ToString()),
ExetendName=reader["ExetendName"].ToString(),
Name = reader["Name"].ToString(),
Remark = reader["Remark"].ToString(),
Subject = reader["Subject"].ToString(),
Type = reader["Type"].ToString(),
UploadTime=Convert.ToDateTime(reader["UploadTime"].ToString()),
Content=null,
DeleteState =Convert.ToBoolean(reader["DeleteState"].ToString()),
CustomerDocumentID=int.Parse( reader["CustomerDocumentID"].ToString())
};
}
reader.Close();
return documentview;
}

下载和修改的后台代码:

 public partial class DocumentEditAndDown : System.Web.UI.Page
{ protected void Page_Load(object sender, EventArgs e)
{
Session["Userid"] = "29";
if (Request.QueryString["ID"] == null)
{
Response.Redirect("DocumentListShow.aspx");
}
if (!IsPostBack)
{
Pageinfoband();
}
} private void Pageinfoband()
{
if (Request.QueryString["ID"] != null)
{
string id = Request.QueryString["ID"].ToString();
BioCrmCorrelationDocumentBLL dbll = new BioCrmCorrelationDocumentBLL();
DocumentInfoView dv = new DocumentInfoView();
dv=dbll.getDocumentViewByID(id);
this.txtsubJect.Text = dv.Subject;
this.txtRemark.Text = dv.Remark;
this.txtCustomerID.Text = dv.CustomerID.ToString();
this.ddlLevel.SelectedItem.Text = dv.DocumentLevel;
this.cbDelete.Checked = dv.DeleteState; this.lbExtendName.Text = dv.ExetendName;
this.lbName.Text = dv.Name; this.lbSize.Text = dv.DocumentSize.ToString();
this.txtUserName.Text = dv.UserID.ToString();
this.hf_CustomerDocumentID.Value = dv.CustomerDocumentID.ToString(); }
} /// <summary>
/// 保存编辑内容
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSubmit_Click(object sender, EventArgs e)
{
BioCrmCorrelationDocument document = new BioCrmCorrelationDocument();
document.DocumentID =int.Parse( Request.QueryString["ID"].ToString());
document.Subject = this.txtsubJect.Text;
document.Name =DateTime.Now.ToString("yyyyMMdd hhmmss")+ this.FileUpload1.FileName;
document.UserID =int.Parse(Session["Userid"].ToString());
document.Remark = this.txtRemark.Text;
document.DocumentLevel = this.ddlLevel.SelectedValue;
document.Content = this.FileUpload1.FileBytes;
document.DocumentSize=this.FileUpload1.FileContent.Length;
document.Type=this.FileUpload1.PostedFile.ContentType;
document.UploadTime = DateTime.Now;
document.ExetendName=System.IO.Path.GetExtension(this.FileUpload1.FileName);
//物理文件上传
string filepath = Server.MapPath(@"\Files\CRMFiles\");
if (Comm.FileExists(filepath + this.lbName.Text))
{
Comm.FileDelete(filepath + this.lbName.Text);
} Comm.FileUpLoad(this.FileUpload1, filepath, document.Name); BioCrmCorrelationDocumentBLL documentbll = new BioCrmCorrelationDocumentBLL();
//文档信息添加 包括文件上传(转换为二进制数组后上传)
int count= documentbll.BioCrmCorrelationDocumentUpdate(document);
//文档信息添加成功
if (count != 0)
{
BioCrmCustomerDocument customerdocument = new BioCrmCustomerDocument();
customerdocument.CustomerDocumentID = int.Parse(this.hf_CustomerDocumentID.Value);
customerdocument.CustomerID = int.Parse(this.txtCustomerID.Text);
customerdocument.DeleteState =cbDelete.Checked;
customerdocument.DocumentID = document.DocumentID;
BioCrmCustomerDocumentBLL customerdocumentbll = new BioCrmCustomerDocumentBLL();
int count1= customerdocumentbll.BioCrmCustomerDocumentUpdate(customerdocument);
if (count1 == 0)
{
SqlComm.DeleteTableByCondition("BioCrmCorrelationDocument", "where DocumentID=" + document.DocumentID);
}
else
{
Response.Redirect("DocumentListShow.aspx");
}
} } protected void btnReturn_Click(object sender, EventArgs e)
{
Server.Transfer("DocumentListShow.aspx");
} }
}
上一篇:java验证输入是否为三阶幻方


下一篇:Hihocoder1662 : 查找三阶幻方([Offer收割]编程练习赛40)(暴力)