<%@ page language="C#" autoeventwireup="true" inherits="Admin_ProjectNew, App_Web_qxuvifui" enableeventvalidation="false" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>

<!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="../CSS/All.css" rel="stylesheet" type="text/css" />
         <script src="../JS/jquery.min.js" type="text/javascript"></script>
         <script src="../JS/Calendar.js" type="text/javascript"></script>
          <script src="../JS/jquery.MultiFile.pack.js" type="text/javascript"></script>
    <style>
        .division th {
        background:none repeat scroll 0 0 #E2E8EB;
        border-right:1px solid #CCCCCC;
        font-size:10pt;
       
        font-weight:500;
        width:140px;
        text-align:right;
        }
        .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:5;
       }
       .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;

       }
       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>项目需求客户</h5>
       <div class="division">
                <table id="selectCust" border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <th>
                            客户：</th>
                        <td>
                            <asp:DropDownList ID="ddlSelectCust" runat="server" Width="153px">
                            </asp:DropDownList>
                          <!--     <input id="btnInset" class="btn" type="button" value="录入" onclick="$('#InsetCust').show();$('#selectCust').hide();$('#hfIsInsetCust').val(1);" />-->
                          </td>
                    </tr>
                    </table>
   <!--              <table id="InsetCust" style="display:none" border="0" cellpadding="0" cellspacing="0" width="100%">  
                    <tr>
                        <th style="height: 30px">
                            公司(个人)名(*)：</th>
                        <td style="height: 30px">
                            <asp:TextBox ID="txtCustName" runat="server" MaxLength="255" Width="265px"></asp:TextBox><input id="btnSelect" class="btn" type="button" value="选择" onclick="$('#selectCust').show();$('#InsetCust').hide();$('#hfIsInsetCust').val(0);" /></td>
                    </tr>
                    <tr>
                        <th>
                            固定电话：</th>
                        <td>
                            
                                <asp:TextBox ID="txtCustPhone" runat="server" MaxLength="50"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <th>
                            网址：</th>
                        <td>
                            <asp:TextBox ID="txtCustUrl" runat="server" MaxLength="255" Width="312px"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <th>
                            地址：</th>
                        <td>
                            <span class="notice_inline ">
                                <asp:TextBox ID="txtCustAddress" runat="server" MaxLength="255" Width="312px"></asp:TextBox></span></td>
                    </tr>
                    <tr>
                        <th>
                            EMAIL：</th>
                        <td>
                            <asp:TextBox ID="txtCustEMAIL" runat="server" MaxLength="50"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <th>
                            QQ：</th>
                        <td>
                            <asp:TextBox ID="txtCustQQ" runat="server" MaxLength="50"></asp:TextBox></td>
                    </tr>
                </table>  -->
        </div>
        <h5>项目信息</h5>
            <div class="division">
                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <th>
                            项目名称(*)：</th>
                        <td>
                    <asp:TextBox ID="txtPName" runat="server"></asp:TextBox>
                    </td>
                    </tr>
                    <tr>
                        <th style="height: 30px">
                            项目金额(*)：</th>
                        <td style="height: 30px">
                    <asp:TextBox ID="txtAmount" runat="server"></asp:TextBox>元</td>
                    </tr>
                    <tr>
                        <th>
                            项目定金：</th>
                        <td>
                            <asp:TextBox ID="txtPayment" runat="server"></asp:TextBox>元</td>
                    </tr>
                    <tr>
                        <th>
                            开发周期(*)：</th>
                        <td>
                    <asp:TextBox ID="txtbeginDate" runat="server" MaxLength="10" onclick="showDateSelect(this)"></asp:TextBox>—<asp:TextBox ID="txtendDate" runat="server" MaxLength="10" onclick="showDateSelect(this)"></asp:TextBox>
                    </td>
                    </tr>
                    <tr>
                        <th>
                            商品类型：</th>
                        <td>
                            <span class="notice_inline ">
                    <asp:DropDownList ID="ddlPClass" runat="server" Width="153px">
                    </asp:DropDownList></span></td>
                    </tr>
                    <tr>
                        <th>
                            回扣预算：</th>
                        <td>
                    <asp:TextBox ID="txtRebateBudget" runat="server" MaxLength="255"></asp:TextBox>元</td>
                    </tr>
                </table>
            </div>
            <h5>
                服务备忘</h5>
            <div class="division">
                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <th>
                            服务时间：</th>
                        <td>
                            <asp:TextBox ID="txtServiceDate" runat="server" onclick="showDateSelect(this)" ></asp:TextBox>*用于提醒</td>
                    </tr>
                    <tr>
                        <th style="height: 30px">
                            备注：</th>
                        <td style="height: 30px">
                    <asp:TextBox ID="txtServiseBz" runat="server" MaxLength="255" Width="322px"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </div>
            <h5>项目相关信息</h5>
            <div class="division">
                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <th>
                            联系人：</th>
                        <td>
                    <asp:TextBox ID="txtLinkMan" runat="server" MaxLength="255"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <th style="height: 30px">
                            联系人职位：</th>
                        <td style="height: 30px">
                    <asp:TextBox ID="txtLinkManPost" runat="server" MaxLength="255"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <th>
                            其他联系人：</th>
                        <td>
                            <em><font color="red">
                    <asp:TextBox ID="txtOthers" runat="server" MaxLength="255"></asp:TextBox></font></em></td>
                    </tr>
                    <tr>
                        <th>
                            备注：</th>
                        <td>
                            <asp:TextBox ID="txtBeizhu" runat="server" Height="50px" TextMode="MultiLine" Width="441px"></asp:TextBox></td>
                    </tr>
                </table>
            </div>
            <h5>项目人员</h5>
            <div class="division">
                <table border="0" cellpadding="0" cellspacing="0" >
                    <tr>
                        <td>
                        </td>
                        <td>
                            <span class="font1" >业务人员</span></td>
                        <td>
                        </td>
                        <td>
                        </td>
                        <td>
                            <span class="font1">开发人员</span></td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td >
                            <asp:ListBox ID="listSales" runat="server" Height="200px" Width="120px" EnableViewState="False"></asp:ListBox>
                        </td>
                        <td>
                            <input id="Button1" class="btn" type="button" value="添加->" onclick="toggle('listSales','listSelectSalas',0)" />
                            
                            <br />
                            <input id="Button2" class="btn" type="button" value="<-删除" onclick="toggle('listSelectSalas','listSales',0)" /></td>
                        <td>
                            <asp:ListBox ID="listSelectSalas" runat="server" Height="200px" Width="120px" EnableViewState="False"></asp:ListBox>
                        </td>
                        <td >
                            <asp:ListBox ID="listProgrmmer" runat="server" Height="200px" Width="120px" EnableViewState="False"></asp:ListBox>
                        </td>
                        <td>
                            <input id="Button3" class="btn" type="button" value="添加->" onclick="toggle('listProgrmmer','listSelectProgrmmes',1)" />
                            <br />
                            <input id="Button4" class="btn" type="button" value="<-删除" onclick="toggle('listSelectProgrmmes','listProgrmmer',1)" /></td>
                        <td>
                            <asp:ListBox ID="listSelectProgrmmes" runat="server" Height="200px" Width="120px" EnableViewState="False"></asp:ListBox>
                        </td>
                    </tr>
                </table>
            </div>
            <h5>附件上传</h5>
            <div class="division">
                <table border="0" cellpadding="0" cellspacing="0"  width="100%">
                    <tr>
                        <td>
                            选择上传附件 可多文件上传:<asp:FileUpload ID="FileUpload" runat="server" /><br />
                            <div id="T7-list" style="border: 3px solid rgb(153, 153, 153);  padding:10px" >
                                上传附件集合:
                            </div>
                        </td>
                        <td>
                        
                    </tr>
                </table>
            </div>
            <h5>功能需求</h5>
            <div class="division">
                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td>
                            <fckeditorv2:fckeditor id="fckEidter" runat="server" height="300px"></fckeditorv2:fckeditor>
                        </td>
                    </tr>
                </table>
            </div>
            
        </div>
        
        <div style="width:100%; background-color: lightgrey;" align="center">
      
        <asp:Button id="btnSubmit" runat="server"  OnClientClick="return CheckInsert();" Text="提交" CssClass="btn" Width="167px" OnClick="btnSubmit_Click"></asp:Button>
      </div>
        <asp:HiddenField ID="hfIsInsetCust" runat="server" Value="0" />
        <asp:HiddenField ID="hfSelectSales" runat="server" Value="0" />
        <asp:HiddenField ID="hfSelectProgrammes" runat="server" Value="0" />
        <div  onclick="$(this).hide()" id="cuePanel" style="z-index: 101; position: absolute; 
           border:1px solid #E6594E; background-color: #FCEAE8;  padding:7px; display:none;
            color:#E6594E;">
            <span id="operCue"></span>
        </div>


    </form>
    
<%--    try
        {
            // Get the HttpFileCollection
            HttpFileCollection hfc = Request.Files;
            for (int i = 0; i < hfc.Count; i++)
            {
                HttpPostedFile hpf = hfc[i];
                if (hpf.ContentLength > 0)
                {
                    hpf.SaveAs(Server.MapPath("MyFiles") + "\\" +
                      System.IO.Path.GetFileName(hpf.FileName));
                    Response.Write("<b>File: </b>" + hpf.FileName + " <b>Size:</b> " +
                        hpf.ContentLength + " <b>Type:</b> " + hpf.ContentType + " Uploaded Successfully <br/>");
                }
            }
        }
        catch (Exception ex)
        {
            
        }
--%>

<script type="text/javascript" > 
$(function(){ 
    $('#FileUpload').MultiFile({
    list: '#T7-list'
    });
});

 function toggle(sourse,target,type){
     var listSourse =$("#"+sourse+" option:selected");
     if(listSourse.size()!=0){
        var listTarget =$("#"+target+"");
        listTarget.append(listSourse.eq(0));
        $("#"+sourse).remove(listSourse.eq(0));
        if(type=="0"){
            var list = $("#listSelectSalas option");
            var select = $("#hfSelectSales");
            select.val("");
            for(var index = 0;index<list.size();index++){
                select.val(select.val()+","+list.eq(index).val());
            }
        }
        else if(type=="1"){
            var list = $("#listSelectProgrmmes option");
            var select = $("#hfSelectProgrammes");
            select.val("");
            for(var index = 0;index<list.size();index++){
                select.val(select.val()+","+list.eq(index).val());
            }
        }
     }
 }
 
 
function isInt(sText){
      var reg =/^\d*$/;
      return sText.match(reg);
}
function isDate(sText){
        var reg =/^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-9]\d)\d{2})-0?2-(0?[1-9]|1\d|2[0-8]))|(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29))$/;
        return sText.match(reg);
}

function showDateSelect(txt){ 
            new Calendar('<%=DateTime.Now.Year-10 %>', '<%=DateTime.Now.Year+10%>', 0,'yyyy-MM-dd').show(txt);
}



function cue(obj,txt){
       var Y = obj.offset().top;
       var X = obj.offset().left;
       var p = $("#cuePanel");

       p.css("top",Y);
       p.css("left",X);
       $("#operCue").text(txt);
       p .show();
}
function isEmpty(obj){
     var input= $("#"+obj+"");
     if($.trim(input.val())==""){
            input.get(0).focus();
            cue(input,"请填写！");
            return true;
     }
     return false;
}
function isIValid(obj){
    var input= $("#"+obj+"");
    if(!isInt($.trim(input.val()))){
        input.get(0).focus();
        cue(input,"输入无效！");return true;
    }
    return false;
}
function CheckInsert(){
       
       if($('#hfIsInsetCust').val()=="1"){
            if(isEmpty("txtCustName"))return false;
       }else{
            var cn =$("#ddlSelectCust option:selected");
            if(cn.eq(0).val()=="0"){
               $("#ddlSelectCust").get(0).focus();
               cue(cn,"请选择！");return false;
            }
       }
       if(isEmpty("txtPName"))return false;
       if(isEmpty("txtAmount"))return false;
       if(isIValid("txtAmount"))return false;
       if(isIValid("txtPayment"))return false;
       if(isEmpty("txtbeginDate"))return false;
       if(isEmpty("txtendDate"))return false;
       if(isIValid("txtbudget"))return false;
       if(isIValid("txtRebateBudgeti"))return false;
       return true;
    
}</script>
</body>
</html>
