<%@ page language="C#" autoeventwireup="true" inherits="Admin_CustomerNew, App_Web_qxuvifui" %>

<!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 id="Head1" runat="server">
    <title>新增人员</title>
    <link href="../CSS/All.css" rel="stylesheet" type="text/css" />
    <script src="../JS/Calendar.js" type="text/javascript" ></script>
    <link rel="stylesheet" href="../JS/jquery-treeview/jquery.treeview.css" />
	<script src="../JS/jquery.min.js" type="text/javascript"></script>
	<script src="../JS/jquery-treeview/jquery.treeview.js" type="text/javascript"></script>
	<script src="../JS/jquery-treeview/treeview.Select.js" type="text/javascript"></script>
    
    <style>
        .division th {
        background:none repeat scroll 0 0 #E2E8EB;
        border-right:1px solid #CCCCCC;
        font-size:10pt;
        text-align:right;
        font-weight:500;
        width:140px;

        }
        .division {
            background:none repeat scroll 0 0 #FFFFFF;
            border-color:#CCCCCC #BEC6CE #BEC6CE #CCCCCC;
            border-style:solid;
            border-width:1px 2px 2px 1px;
            line-height:150%;
            padding:5px;
            white-space:normal;
            margin:5px;
       }
       .division td, .division th{
            border-color:#FFFFFF #DBE2E7 #DDDDDD #FFFFFF;
            border-left:1px solid #FFFFFF;
            border-right:1px solid #DBE2E7;
            border-style:solid;
            border-width:1px;
            padding:2px;
             margin:1px;
       }
       h5{
        margin:0;
        padding:5px;
        background-color:#E2E8EB;
        font-size:11pt;
       }
       .division .font1{
        font-weight: bold;
        color: #696969
       }
     
    </style>
    
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    
        <h5>
             <asp:Label ID="labOperType" runat="server" Text="新增"></asp:Label>客户信息</h5>
        <div class="division">
            <table id="selectCust" border="0" cellpadding="0" cellspacing="0" width="100%">
                <tr>
                    <th>
                客户名(*)：</th>
                    <td>
                        <asp:TextBox ID="txtCustName" runat="server" MaxLength="255" Width="265px"></asp:TextBox><asp:RequiredFieldValidator ID="rfvCustName" runat="server" ControlToValidate="txtCustName"
                ErrorMessage="必填" ValidationGroup="insert"></asp:RequiredFieldValidator></td>
                </tr>
                <tr>
                    <th>
                客户来源：</th>
                    <td>
                    <asp:DropDownList ID="ddlCustSourse" runat="server" Width="163px">
                    </asp:DropDownList></td>
                </tr>
                <tr>
                    <th>
                客户类型：</th>
                    <td>
                        <asp:DropDownList ID="ddlCustClass" runat="server" Width="163px">
                </asp:DropDownList></td>
                </tr>
                <tr>
                    <th>
                客户等级：</th>
                    <td>
                        <asp:DropDownList ID="ddlCustGrade" runat="server" Width="163px">
            </asp:DropDownList></td>
                </tr>
                <tr>
                    <th>
                行业类型：</th>
                    <td>
                        <span class="notice_inline ">
                            <asp:DropDownList ID="ddlCustIndustry" runat="server" Width="163px">
                </asp:DropDownList></span></td>
                </tr>
                <tr>
                    <th>
                        客户归属：</th>
                    <td>
                        <asp:DropDownList ID="ddlSales" runat="server" Width="163px">
                        </asp:DropDownList></td>
                </tr>
                <tr>
                    <th>
                        联系人：</th>
                    <td>
             <asp:TextBox ID="txtLinkMan" runat="server" MaxLength="50" Width="157px" ></asp:TextBox></td>
                </tr>
                <tr>
                    <th>
                 联系人手机：</th>
                    <td>
             <asp:TextBox ID="txtLinkManPhone" runat="server" MaxLength="50" Width="157px"></asp:TextBox></td>
                </tr>
                <tr>
                    <th>
                电话：</th>
                    <td>
            <asp:TextBox ID="txtCustPhone" runat="server" MaxLength="50" Width="157px"></asp:TextBox></td>
                </tr>
                <tr>
                    <th>
                        网址：</th>
                    <td>
            <asp:TextBox ID="txtCustUrl" runat="server" MaxLength="255" Width="265px">WWW.</asp:TextBox></td>
                </tr>
                <tr>
                    <th>
                        城市：</th>
                    <td>
                        <asp:TextBox ID="txtCity" runat="server"></asp:TextBox>
                        <input id="btnSelect" style="width: 34px" type="button" value="选择" onclick="showCity(this)" />
                        <div id="CitySelectPanel" style="  padding:10px;border-right: silver thin dashed; border-top: silver thin dashed; border-left: silver thin dashed; border-bottom: silver thin dashed;display:none; z-index: 101; left: 332px; position: absolute; top: 365px;background-color: #ffffff; ">
                            <ul id="black" >
                                </ul>	
                        </div>
                    </td>
                </tr>
                <tr>
                    <th>
                        地址：</th>
                    <td>
            <asp:TextBox ID="txtCustAddress" runat="server" MaxLength="255" Width="265px"></asp:TextBox></td>
                </tr>
                <tr>
                    <th>
                阿里旺旺：</th>
                    <td>
            <asp:TextBox id="txtww" runat="server" MaxLength="50" Width="157px"></asp:TextBox></td>
                </tr>
                <tr>
                    <th>
                        EMAIL：</th>
                    <td>
            <asp:TextBox ID="txtCustEMAIL" runat="server" MaxLength="50" Width="157px"></asp:TextBox></td>
                </tr>
                <tr>
                    <th>
                        QQ：</th>
                    <td>
            <asp:TextBox ID="txtCustQQ" runat="server" MaxLength="50" Width="157px"></asp:TextBox></td>
                </tr>
                <tr>
                    <th>
                录入日期：</th>
                    <td>
                        <asp:TextBox ID="txtIDate" runat="server" MaxLength="50"  onclick="showDateSelect(this)" Width="157px" ></asp:TextBox></td>
                </tr>
                <tr>
                    <th>
                备注：</th>
                    <td>
            <asp:TextBox ID="txtBZ" runat="server" Height="74px" TextMode="MultiLine"
                Width="435px"></asp:TextBox></td>
                </tr>
            </table>
        </div>
    </div>
       
   
    <div style="width: 100%; background-color: lightgrey">
            <asp:Button ID="btnSubmit" runat="server" Text="保存"
                ValidationGroup="insert" Width="104px" CssClass="btn"  style=" margin-left:150px" OnClick="btnSubmit_Click"/>
        <asp:Button ID="btnUpdate" runat="server" Text="修改"  style=" margin-left:30px" CssClass="btn" OnClientClick="if(confirm('你确定要修改上一条记录吗？')){return true;}else{return false;}" OnClick="btnUpdate_Click" Width="91px" />
            <asp:Button
                ID="btnback" runat="server" Text="返回"  style=" margin-left:30px" CssClass="btn" Visible="false" OnClick="btnback_Click" Width="89px"/></div>

 </form>
    <script type="text/javascript">
   $(function(){
    if($("#labOperType").text()=="新增")
    $("#txtIDate").val(getFormatDate());
    
  $("#black").treeview({
		        url: "ashx/source.ashx?random="+Math.floor(Math.random()*100000)
        })
   });
   
   function getFormatDate(){
      var myDate = new Date();
      return  myDate.getFullYear()+"-"+(myDate.getMonth()+1<10?"0"+(myDate.getMonth()+1):myDate.getMonth()+1)+"-"+(myDate.getDate()<10?("0"+myDate.getDate()):myDate.getDate());
   }
   
   function showDateSelect(txt){
            new Calendar('<%=DateTime.Now.Year-10 %>', '<%=DateTime.Now.Year+10%>', 0,'yyyy-MM-dd').show(txt);
   }
   
   function showCity(obj){

       if($("#CitySelectPanel").css("display")=="none"){
               var Y = $(obj).offset().top;
               var X = $(obj).offset().left;
               var p = $("#CitySelectPanel");

               p.css("top",Y+$(obj).height());
               p.css("left",X);

               p .show();  
      }else{
            $("#CitySelectPanel").hide();
      }
      
    }
    function SelectCity(obj)
    {
       var sb = new StringBuilder();
       var value = getSelect(obj,sb);
       $('#txtCity').val(value);
       $("#CitySelectPanel").hide();
    }
    
    function getSelect(obj,sb){
        if($("#"+obj+"").size()!=0){  
            sb.Append($("#"+obj+"").attr("text"));
            sb.Append(" ");
            if($("#"+obj+"").attr("parent")!=undefined){  
                getSelect($("#"+obj+"").attr("parent"),sb); 
            }else{
                 return sb.toString();  
            }
        }
        return sb.toString(); 
    }
    
    function StringBuilder()
    {
       this.data=Array("");
    }
    StringBuilder.prototype.Append=function()
    {
       this.data.unshift(arguments[0]);
    }
    StringBuilder.prototype.toString=function()
    {
       return $.trim(this.data.join(""));
    }

   </script>
</body>
</html>




