ERP渠道管理添加验证和查询(二)

添加联系人的后台代码:

 protected void btnSubmit_Click(object sender, EventArgs e)
        {
            BioErpCrmManageChannel channel = new BioErpCrmManageChannel()
            {
                ChannelName = this.txtChannelName.Text,
                AccountName = this.txtBank.Text,
                Accounts = this.txtAccounts.Text,
                Address = this.txtAddress.Text,
                Areal = this.ddlArea.SelectedItem.Text,
                ChannelLevel = this.ddlLevel.Text,
                ChannelSize = this.ddlChannelSize.SelectedItem.Text,
                ChannelType = this.ddlType.Text,
                City = this.ddlCity.SelectedItem.Text,
                Province = this.ddlProvince.SelectedItem.Text,
                CoreOperttion = this.txtCoreOperttion.Text,
                Tel1 = this.txtTel1.Text,
                Tel2 = this.txtTel2.Text,
                TaxNumber = this.txtTaxNumber.Text,
                CoSummary = this.txtCoSummary.Text,
                Email = this.txtEmail.Text,
                Fax = this.txtFax.Text,
                NetAddress = this.txtNextTime.Text,
                Vocation = this.ddlVocation.SelectedItem.Text,
                SuperiorChannel = this.txtSuperChannelID.Text == "" ? 0 : int.Parse(this.txtSuperChannelID.Text),
                UserID = int.Parse(this.txtUserName.Text),
                NextContactTime = Convert.ToDateTime(this.txtNextTime.Text),
                Status = this.ddlState.SelectedItem.Text,
                CreditStanding = this.txtCredit.Text,
                EnrollTime = Convert.ToDateTime(this.txtRegisterTime.Text)
            };
            BioErpCrmManageChannelBLL channelbll = new BioErpCrmManageChannelBLL();
            BioErpCrmChannelLinkManBLL linkmanbll = new BioErpCrmChannelLinkManBLL();
            int channelid = channelbll.BioErpCrmManageChannelAdd(channel);
            //渠道基本信息添加成功,才能添加联系人基本信息
            if (channelid != 0)
            {
                string linkman = Request["txtLinkMan1"].ToString();
                string ddlSex = Request["ddlSex1"].ToString();
                string Birthday = Request["txtBirthday1"].ToString();
                string MainLink = Request["ddlMainLink1"].ToString();
                string OfficePhone = Request["txtOfficePhone"].ToString();
                string Mobile = Request["txtOfficePhone"].ToString();
                string Email = Request["txtEmail11"].ToString();
                string Address = Request["txtAddress1"].ToString();
                string QQ = Request["txtQQ1"].ToString();
                string Remark = Request["txtRemark1"].ToString();

                string[] linkmans = linkman.Split(‘,‘);
                string[] ddlSexs = ddlSex.Split(‘,‘);
                string[] Birthdays = Birthday.Split(‘,‘);
                string[] MainLinks = MainLink.Split(‘,‘);
                string[] OfficePhones = OfficePhone.Split(‘,‘);
                string[] Mobiles = Mobile.Split(‘,‘);
                string[] Emails = Email.Split(‘,‘);
                string[] Addresses = Address.Split(‘,‘);
                string[] QQs = QQ.Split(‘,‘);
                string[] Remarks = Remark.Split(‘,‘);

                BioErpCrmChannelLinkMan linkmanobj = null;
                for (int i = 0; i < linkmans.Length; i++)
                {
                    linkmanobj = new BioErpCrmChannelLinkMan()
                    {
                        LinkmanName = linkmans[i],
                        Address = Addresses[i],
                        Email = Emails[i],
                        Remark = Remarks[i],
                        Sex = ddlSexs[i] == "0" ? false : true,
                        QQ = QQs[i].ToString(),
                        OfficialPhone = OfficePhones[i],
                        MobilePhone = Mobiles[i],
                        Birthday = Convert.ToDateTime(Birthdays[i]),
                        ChannelID = channelid,
                        IsMainLinkman = MainLinks[i] == "0" ? false : true
                    };
                    linkmanbll.BioErpCrmChannelLinkManADD(linkmanobj);
                }
            }
        }

添加的时候字符串的验证:

1.验证的js代码:

// 字符验证
jQuery.validator.addMethod("stringCheck", function(value, element) {
return this.optional(element) || /^[\u0391-\uFFE5\w]+$/.test(value);
}, "只能包括中文字、英文字母、数字和下划线");
// 中文字两个字节
jQuery.validator.addMethod("byteRangeLength", function(value, element, param) {
var length = value.length;
for(var i = 0; i < value.length; i++){
if(value.charCodeAt(i) > 127){
length++;
}
}
return this.optional(element) || ( length >= param[0] && length <= param[1] );
}, "请确保输入的值在3-15个字节之间(一个中文字算2个字节)");
// 身份证号码验证
jQuery.validator.addMethod("isIdCardNo", function(value, element) {
return this.optional(element) || isIdCardNo(value);
}, "请正确输入您的身份证号码");
// 手机号码验证
jQuery.validator.addMethod("isMobile", function(value, element) {
var length = value.length;
var mobile = /^(((13[0-9]{1})|(15[0-9]{1}))+\d{8})$/;
return this.optional(element) || (length == 11 && mobile.test(value));
}, "请正确填写您的手机号码");
// 电话号码验证
jQuery.validator.addMethod("isTel", function(value, element) {
var tel = /^\d{3,4}-?\d{7,9}$/; //电话号码格式010-12345678
return this.optional(element) || (tel.test(value));
}, "请正确填写您的电话号码");
// 联系电话(手机/电话皆可)验证
jQuery.validator.addMethod("isPhone", function(value,element) {
var length = value.length;
var mobile = /^(((13[0-9]{1})|(15[0-9]{1}))+\d{8})$/;
var tel = /^\d{3,4}-?\d{7,9}$/;
return this.optional(element) || (tel.test(value) || mobile.test(value));
}, "请正确填写您的联系电话");
// 邮政编码验证
jQuery.validator.addMethod("isZipCode", function(value, element) {
var tel = /^[0-9]{6}$/;
return this.optional(element) || (tel.test(value));
}, "请正确填写您的邮政编码");

2.样式代码:

*{
font-size: 96%;
}
label{
width: 10em;
float: left;
}
label.error{
float: none;
color: red;
padding-left: .5em;
vertical-align: top;
}
p{
clear: both;
}
.submit {
margin-left: 12em;
}
em{
font-weight: bold;
padding-right: 1em;
vertical-align: top;
}

显示的信息:

jQuery.extend(
jQuery.validator.messages, {
required: "必选字段",
remote: "请修正该字段",
email: "请输入正确格式的电子邮件",
url: "请输入合法的网址",
date: "请输入合法的日期",
dateISO: "请输入合法的日期 (如:2011-11-02).",
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} 的值")
});

在前端js中调用:

 <script type="text/javascript">
           $(document).ready(function () {

               $("#form1").validate();
               var i = 0;
               jQuery("#btnAddNew").click(function () {
                   i++;
                   tr = ‘‘;
                   tr = tr + ‘ <tr id="tr‘ + i + ‘">‘;
                   tr = tr + ‘  <td><input  name="txtLinkMan1"  MaxLength="10"></input></td>‘;
                   tr = tr + ‘  <td>‘;
                   tr = tr + ‘    <select  name="ddlSex1" > <option Value="0">男</option> <option Value="1">女</option></select>‘;
                   tr = tr + ‘    </td>‘;
                   tr = tr + ‘   <td>‘;
                   tr = tr + ‘    <input  name="txtBirthday1" onfocus="setday(this)" onclick="setday(this)"  MaxLength="20"></input></td>‘;
                   tr = tr + ‘  <td><select  name="ddlMainLink1"> <option Value="1">是</option> <option Value="0">否</option> </select></td>‘;
                   tr = tr + ‘ <td>   <input  name="txtOfficePhone"  MaxLength="20" ></input></td>‘;
                   tr = tr + ‘  <td> <input  name="txtMobile1"  MaxLength="20" ></input></td>‘;
                   tr = tr + ‘  <td> <input name="txtEmail11"  MaxLength="20"></input></td>‘;
                   tr = tr + ‘ <td> <input name="txtAddress1"  MaxLength="50" ></input></td>‘;
                   tr = tr + ‘ <td> <input  name="txtQQ1"  MaxLength="15"></input></td>‘;
                   tr = tr + ‘ <td> <input name="txtRemark1"  MaxLength="200"></input></td>‘;
                   tr = tr + ‘ </tr>‘;

                   $("#caption").before(tr);

               });

               jQuery("#btnDelete").click(function () {
                   $("#tr" + i).remove();
                   i--;
               });

           });

    </script>

验证的时候添加:

 <td>渠道名</td><td><asp:TextBox ID="txtChannelName" CssClass="required" runat="server"></asp:TextBox></td>

查询的代码:

在数据库中定义视图:

CREATE VIEW [dbo].[View_CRMChannelInfo]
AS

SELECT ChannelID, ChannelName,SuperiorChannelID=SuperiorChannel,
SuperiorChannel=ISNULL(dbo.getFatherChannelNamebyFatherID(SuperiorChannel),‘一级渠道‘)
,Tel1,Tel2,Email,Fax,NextContactTime=ISNULL(NextContactTime,‘1970-1-1‘),LinkMans=dbo.GetUserListByChannelID(ChannelID),
UserID,DeleteState,UserName=dbo.getUserNameByUserID(UserID),
Address,ChannelLevel,NetAddress,CreditStanding,EnrollTime= ISNULL(EnrollTime,‘1970-1-1‘),
ChannelSize,Vocation,ChannelType,Status,Areal,Province,City,
TaxNumber,AccountName,Accounts,CoSummary,CoreOperttion

 FROM dbo.BioErpCrmManageChannel

 SELECT CONVERT(nvarchar(10),getdate(),102)

自定义函数的定义:

-- =============================================
-- Description:    根据渠道编号获取渠道联系人姓名
-- =============================================
ALTER FUNCTION [dbo].[GetUserListByChannelID]
(
    @ChannelID int
)
RETURNS  nvarchar(200)
AS
BEGIN

    declare cur cursor for
    SELECT LinkmanName FROM BioErpCrmChannelLinkMan WHERE ChannelID [email protected]
    open cur
    DECLARE @name nvarchar(20)
    DECLARE @names nvarchar(1000)
    SET @names=‘‘
    FETCH next FROM cur INTO @name
    WHILE @@FETCH_STATUS =0
    BEGIN
        SET @[email protected][email protected]+‘,‘
        FETCH next FROM cur INTO @name
    END
    CLOSE cur
     DEALLOCATE cur
     RETURN @names

END

  自定义函数:

-- =============================================
-- Description:根据上级渠道编号查询对应上级渠道名称
-- =============================================
ALTER FUNCTION [dbo].[getFatherChannelNamebyFatherID]
(
	@FatherID int
)
RETURNS nvarchar(20)
AS
BEGIN
	-- Declare the return variable here
	DECLARE @fatherChannelName nvarchar(20)
	-- Add the T-SQL statements to compute the return value here
	SELECT @fatherChannelName=ChannelName FROM dbo.BioErpCrmManageChannel
	WHERE [email protected]
	-- Return the result of the function
    RETURN	@fatherChannelName
END

前端代码:

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

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

<%@ Register src="../../UserControl/CRMChannelMenuBar.ascx" tagname="CRMChannelMenuBar" 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:CRMChannelMenuBar ID="CRMChannelMenuBar1" 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:DropDownList ID="ddlCustomerLevel" runat="server">
                              <asp:ListItem>一级</asp:ListItem>
                              <asp:ListItem>二级</asp:ListItem>
                              <asp:ListItem>三级</asp:ListItem>
                              <asp:ListItem>四级</asp:ListItem>
                          </asp:DropDownList>
              </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:Label ID="Label11" runat="server" Text="省份"></asp:Label>
                           <asp:DropDownList ID="ddlProvince" runat="server" Width="150px">
                                                     </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="ChannelID">
                         <Columns>
                             <asp:TemplateField HeaderText="渠道编号" HeaderStyle-HorizontalAlign="Center">
                                 <ItemTemplate>

                                     <asp:Label ID="Label4" runat="server" Text=‘<%# Eval("ChannelID") %>‘></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("ChannelName") %>‘></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="Label9" runat="server" Text=‘<%# Eval("SuperiorChannel") %>‘></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("LinkMans") %>‘></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("Tel1")+" "+Eval("Tel2") %>‘></asp:Label>
                                 </ItemTemplate>

<HeaderStyle HorizontalAlign="Center"></HeaderStyle>

                                 <ItemStyle HorizontalAlign="Center" />
                             </asp:TemplateField>
                             <asp:TemplateField HeaderText="Email" HeaderStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                      <asp:Label ID="Label8" runat="server" Text=‘<%# Eval("Email") %>‘></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("Fax") %>‘></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=‘<%# Convert.ToDateTime(Eval("NextContactTime")).ToString("yyyy/MM/dd") %>‘></asp:Label>
                                 </ItemTemplate>

<HeaderStyle HorizontalAlign="Center"></HeaderStyle>

                                 <ItemStyle HorizontalAlign="Center" />
                             </asp:TemplateField>
                             <asp:HyperLinkField DataNavigateUrlFields="ChannelID"
                                 DataNavigateUrlFormatString="CustomerUpdate.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 static int pageindex = 0;
        public static int pagesize = 10;
        public static string condition = "";

        protected void Page_Load(object sender, EventArgs e)
        {
            //if (UserLogin.user.RoleId != 6 && UserLogin.user.RoleId != 7)
            //{
            //    Response.Write("<script>window.history.back()</script>");
            //     //Response.Redirect("../Web/Desk.aspx");
            //    //Server.Transfer("../Web/Desk.aspx");
            //    return;
            //}
            Session["Userid"] = "29";
            if (!IsPostBack)
            {

                ddlProvinceBind();
                getallCustomerList();
            }
        }

        /// <summary>
        /// 绑定省份
        /// </summary>
        public void ddlProvinceBind()
        {
            this.ddlProvince.DataSource = SqlComm.getProvinceInfoList();
            this.ddlProvince.DataTextField = "ProvinceInfoName";
            this.ddlProvince.DataValueField = "ProvinceInfoID";
            this.ddlProvince.DataBind();
            this.ddlProvince.Items.Add(new ListItem("--请选择省份--", "0"));
            this.ddlProvince.SelectedValue = "0";
        }

        /// <summary>
        /// 查询所有员工信息
        /// </summary>
        private void getallCustomerList()
        {
            //如果是市场部经理,或客服部经理可以查看所有
            if (UserLogin.user.RoleId == 6 || UserLogin.user.RoleId == 7)
            {
                this.AspNetPager1.RecordCount = SqlComm.getDataCountByCondition("dbo.View_CRMChannelInfo", condition);
                this.AspNetPager1.PageSize = pagesize;
                this.GridView1.DataSource = SqlComm.getDataByPageIndex("dbo.View_CRMChannelInfo", "*", "ChannelID", condition, pageindex, pagesize);
                this.GridView1.DataBind();
            }
            else //员工只能看自己的客户信息
            {
                condition = condition + " and userid=" + Session["Userid"].ToString();
                this.AspNetPager1.RecordCount = SqlComm.getDataCountByCondition("dbo.View_CRMChannelInfo", condition);
                this.AspNetPager1.PageSize = pagesize;
                this.GridView1.DataSource = SqlComm.getDataByPageIndex("dbo.View_CRMChannelInfo", "*", "ChannelID", condition, pageindex, pagesize);
                this.GridView1.DataBind();
            }
        }

        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            pageindex = this.AspNetPager1.CurrentPageIndex - 1;
            getallCustomerList();
        }

        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 CustomerName like ‘" + txtName.Text + "%‘";
            }

            if (this.ddlState.SelectedValue == "1")
            {
                condition = condition + " and DeleteState =‘True‘";
            }
            else
            {
                condition = condition + " and DeleteState =‘False‘";
            }

             condition = condition + " and CustomerLevel=‘" + this.ddlCustomerLevel.SelectedItem.Text+"‘ ";

            if (this.ddlProvince.SelectedValue != "0")
            {
                condition = condition +" and Province=‘"+ this.ddlProvince.SelectedItem.Text+"‘";
            }

            getallCustomerList();

        }

        protected void imgbtnNew_Click(object sender, ImageClickEventArgs e)
        {
            Server.Transfer("CustomerAdd.aspx");
        }
时间: 2024-07-31 14:22:30

ERP渠道管理添加验证和查询(二)的相关文章

BOS项目 第8天(权限管理添加、角色管理添加、用户管理添加、shiro权限框架使用ecache缓存)

BOS项目笔记 第8天 今天内容安排: 1.权限管理(初始化.查询.添加) 2.角色管理(添加.查询) 3.用户管理(添加.查询) 4.修改自定义Realm中的授权方法(基于数据库实现) 5.使用ehcache缓存权限数据 6.系统左侧菜单根据登录人的权限动态展示 1. 权限管理 1.1 初始化权限数据 执行sql脚本文件初始化权限数据: 1.2 权限分页查询 第一步:修改页面中datagrid的URL地址,访问FunctionAction的pageQuery的分页查询方法 第二步:创建Func

Windows Azure服务管理请求验证

安全性考虑与设计,Windows Azure的服务请求必须通过安全认证,验证的方式有两种如下: 1.Authenticate using Azure Active Directory(活动目录验证) Secure requests to the management service can be authenticated by creating an Azure AD application and using the Active Directory Authentication Libra

Solr基础理论与维护管理快速上手(含查询参数说明)

1. solr基础 因为 Solr 包装并扩展了 Lucene,所以它们使用很多相同的术语.更重要的是,Solr 创建的索引与 Lucene 搜索引擎库完全兼容.通过对 Solr 进行适当的配置,某些情况下可能需要进行编码,Solr 可以阅读和使用构建到其他 Lucene 应用程序中的索引. 在 Solr 和 Lucene 中,使用一个或多个 Document 来构建索引.Document 包括一个或多个 Field.Field 包括名称.内容以及告诉 Solr 如何处理内容的元数据.例如,Fi

Qt布局管理器的使用(二)

 Qt布局管理器的使用(二) 前面博文(http://blog.csdn.net/u013704336/article/details/38960353)讲解了手动布局的基本思路,今天说下用代码怎样进行一些常用的简单布局. 首先,心中要规划好,自己要实现的模块的分布可以事先在纸上进行大致的绘制,然后心中就有了大致的轮廓. 今天就按照上次讲的,实现那个录入商品信息的布局吧.如下图所示: 仔细观察,就可以发现这个布局的思想.基本都是水平布局,然后再将各自布局进行垂直布局,好了,说了这么多废话,直接上

JqueryMobile为Listview动态添加、删除查询功能

JqueryMobile的版本不同,引用JS的API也不同,因此为Listview动态添加.删除查询功能的代码也不同. 假设Listview控件内容如下: <ul data-role="listview" id="listview"  data-inset="true"> <li><a href="#">Acura</a></li> <li><a h

第20课-数据库开发及ado.net 可空值类型,资料管理器,多条件查询,Case

第20课-数据库开发及ado.net 可空值类型,资料管理器,多条件查询,Case SqlHelper using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Text; namespace _02省市联动 { public static  class SqlHelper { //

Linux之进程管理(2)相关命令之二

Linux之进程管理(2)相关命令之二 进程监控工具命令使用:uptime  top  vmstat  pmap  dstat uptime  命令 uptime - Tell how long the system has been running. 显示当前已经运行的时长及cpu核心处理状态 说明:显示系统当前时间,系统运行时长,以及当前上线人数,系统平均负载(一般按1.5.10分钟的平均负载,一般不会超过1). 选项及用法: uptime  [option] -p, --pretty  :

ASP.NET MVC4 新手入门教程之八 ---8.向模式中添加验证

在这本部分会将验证逻辑添加到Movie模式,和你会确保验证规则执行任何时候用户试图创建或编辑使用该应用程序的一部电影. 保持事物的干练性 ASP.NET MVC 的核心设计信条之一是 DRY(”Don't Repeat Yourself“,不要重复).ASP.NET MVC 鼓励你只有一次,指定的功能或行为,然后让它无处不在应用程序中反映.这减少了需要编写的代码量,并使你写更少错误倾向和易于维护的代码. ASP.NET MVC 和 Entity Framework Code First 中提供的

学习ASP .NET MVC5官方教程总结(十)添加验证

学习ASP .NET MVC5官方教程总结(十)添加验证 在本章中,我们将为Movie模型添加验证逻辑,并确认验证规则在用户试图使用程序创建和编辑电影时有效. ASP.NET MVC 的一个核心原则是DRY(Don't Repeat Yourself - 不做重复的事情).ASP.NET MVC 鼓励你一次性的指定功能或行为,然后应用程序的其它地方通过映射得到它,这样一来就减少了大量的代码,从而减少了出错误的可能性,并且更易于维护. ASP.NET  MVC  和 Entity Framewor