<%@ page language="C#" autoeventwireup="true" inherits="general_Contract_Contract_Oncepay, CrmCommand" %>
<%@ Register TagPrefix="C1WebGrid" Namespace="C1.Web.C1WebGrid" Assembly="C1.Web.C1WebGrid.2" %>


<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>已付款合同信息(包含合同已付款和续费合同已付款)</title>
        <script src="../../Javascript/canlendar.js" type="text/javascript"></script>
                  <script src="../../Javascript/Trim.js" type="text/javascript"></script>
    <script language=javascript type="text/javascript">
    function RLtrim()
    {
       var t1=document.getElementById("Text1").value;
       var t2=document.getElementById("Text2").value;
       if(Trim(t1) && Trim(t2))
       {
         
         return true;
       }
       else
       {
       alert('日期不能为空');
        return false;
       }
    }
    
    </script>
	<style type="text/css">
.style1 {
	border-style: solid;
	border-width: 1px;
}
</style>
</head>
<body class ="bodycolor" leftmargin="0" topmargin="0">
    <form id="form1" runat="server">
     <div>
       
                <div>
                    <div>
                        <table align="center" bgcolor="#000000" border="0" cellspacing="1"
                            class="small" style="width: 800px">
                            <tr>
                                <td class="TableHeader" colspan="4" style="width: 800px">
                                    注意:这只显示(包含合同已付款和续费合同已付款)
                                </td>
                            </tr>
                            <tr>
                                <td class="TableData" colspan="4" >
                                                               
		<table style="width: 790px" cellspacing="0" cellpadding="0">
		<tr>
			<td style="width: 70px">客户名称:</td>
			<td style="width: 126px"><asp:TextBox ID="TxtName" runat="server" CssClass="BigInput"></asp:TextBox>
                                    </td>
			<td style="width: 71px">合同类型:</td>
			<td style="width: 92px"><asp:DropDownList ID="DropDownList1" runat="server">
                                        <asp:ListItem>全部</asp:ListItem>
                                        <asp:ListItem Value="合同已付款">原始合同</asp:ListItem>
                                        <asp:ListItem Value="续费合同已付款">续费合同</asp:ListItem>
                                    </asp:DropDownList>
                                    </td>
			<td style="width: 68px">签约日期:</td>
			<td style="width: 77px">
                                    <input id="Text1" style="border: 1px solid #C0C0C0; width: 80px" type="text" runat=server readonly /></td>
			<td style="width: 11px">
                                    <img src="../../App_Themes/Green/images/Calendar.gif" onclick='popUpCalendar(document.getElementById("Text1"), document.getElementById("Text1"), "yyyy-mm-dd")' border=0 style="width: 20px; height: 23px" /></td>
			<td style="width: 8px">至</td>
			<td style="width: 78px"> 
			<input id="Text2" style="border: 1px solid #C0C0C0; width: 80px" type="text" runat=server readonly /></td>
			<td style="width: 47px">
                                    <img src="../../App_Themes/Green/images/Calendar.gif" onclick='popUpCalendar(document.getElementById("Text2"), document.getElementById("Text2"), "yyyy-mm-dd")' border=0 style="width: 20px; height: 23px" /></td>
			<td>
                                    <asp:Button
                                        ID="Button7" runat="server" CssClass="BigButton" Height="20px" OnClick="Button7_Click"
                                        Text="合同检索" Width="78px"  />
                                </td>
					</tr>
	</table>
	  </td>
                            </tr>
                            <tr>
    	<td  class="TableData" noWrap colspan="4">合同范围:&nbsp;<asp:RadioButton Checked=true  GroupName="rad" ID="Rad1" runat="server" Text="我的合同" OnCheckedChanged="Rad1_CheckedChanged" AutoPostBack="True" /><asp:RadioButton ID="Rad2" GroupName="rad"　Text="下属合同" runat="server" OnCheckedChanged="Rad2_CheckedChanged" AutoPostBack="True" /></td>
    	</tr>
                            <tr>
                                <td class="TableData"  valign="top" colspan="4" style="width: 800px;">
                                   <C1WebGrid:C1WebGrid ID="C1WebGrid1" runat="server" AllowPaging="True" AllowSorting="True"
                                        AutoGenerateColumns="False" CallbackOptions="Sorting,Selection" 
                                        DataKeyField="Cl_ContractId"   OnItemCreated="C1WebGrid1_ItemCreated"
                                        OnPageIndexChanging="C1WebGrid1_PageIndexChanging" OnSortingCommand="C1WebGrid1_SortingCommand"
                                        PageSize="10" SkinID="gridviewSkin" Width="800px" OnItemCommand="C1WebGrid1_ItemCommand">                                        <Columns>
                                           
                                             <C1WebGrid:C1TemplateColumn HeaderText="合同编号" SortExpression="Contract_Num">
                                                    <ItemTemplate>
                                                       
                                                        <a href="#"  onclick="view_menu1(<%#Eval("Cl_ContractId") %>)" style="cursor: hand; height: 9px">
                                                        <%#Eval("Contract_Num") %>
                                                    </a>
                                                    </ItemTemplate>
                                                </C1WebGrid:C1TemplateColumn>
                                                <C1WebGrid:C1BoundColumn DataField="User_Name" HeaderText="签约人" SortExpression="User_Name">
                                            </C1WebGrid:C1BoundColumn>
                                             <C1WebGrid:C1TemplateColumn HeaderText="客户名称" SortExpression="Client_Name">

                <ItemTemplate>
                    <asp:Label    ID="Lkb" Text='<%# Server.HtmlDecode(Eval("Client_Name").ToString()).Length > 10 ? Server.HtmlDecode(Eval("Client_Name").ToString()).Substring(0, 10) + "..." : Server.HtmlDecode(Eval("Client_Name").ToString())%>'  ToolTip='<%#Server.HtmlDecode(Eval("Client_Name").ToString())%>' runat="server"></asp:Label>
 
                					</ItemTemplate>
            </C1WebGrid:C1TemplateColumn>
                                            <C1WebGrid:C1BoundColumn DataField="Product_TotalPrice" DataFormatString="{0:C}"
                                                HeaderText="合同金额" SortExpression="Product_TotalPrice">
                                            </C1WebGrid:C1BoundColumn>
                                            <C1WebGrid:C1TemplateColumn HeaderText="签约日期" SortExpression="Tracd_Time">
                                                <ItemTemplate>
                                                    <%#string.Format("{0:d}",Eval("Tracd_Time"))%>
                                                </ItemTemplate>
                                                <ItemStyle HorizontalAlign="Center" Wrap="True" />
                                                <HeaderStyle HorizontalAlign="Center" />
                                            </C1WebGrid:C1TemplateColumn>
                                            <C1WebGrid:C1BoundColumn DataField="Contract_State" HeaderText="合同状态" SortExpression="Contract_State">
                                            </C1WebGrid:C1BoundColumn>
                                            <C1WebGrid:C1TemplateColumn HeaderText="废除合同"><ItemTemplate><asp:LinkButton Text="废除合同" OnClientClick="javascript:return confirm('您真的要废除合同吗!');" runat=server CommandName="Del" ID="Del"></asp:LinkButton></ItemTemplate></C1WebGrid:C1TemplateColumn>
                                        </Columns>
                                    </C1WebGrid:C1WebGrid>
                                </td>
                            </tr>
                            <tr>
                                <td class="TableData" colspan="4" style="width: 800px; height: 8px">
                                    <table bgcolor="#dddddd" bordercolordark="#ffffff" bordercolorlight="#000000" cellspacing="0" class="style1" height="100%" style="width: 800px">
                                        <tr>
                                <td class="TableData" colspan="4" style="width: 800px; height: 8px">
                                    <table bgcolor="#dddddd" bordercolordark="#ffffff" bordercolorlight="#000000" cellspacing="0" class="style1" height="100%" style="width: 800px">
                                        <tr>
                                            <td width="50%" id="menu_1" onclick='view_menu1(document.getElementById("HidConid").value)' onmouseout="setPointer(this, '#DDDDDD',1)"
                                                onmouseover="setPointer(this, '#B3D1FF',1)" style="cursor: hand; height: 21px"
                                                title="合同基本信息">
                                                <img align="absMiddle" height="20" src="../images/menu/sms.gif" width="20" /><b><font
                                                    color="#000000"> 基本信息</font></b>
                                            </td>
                                            <td width="50%" id="menu_3" onclick='view_menu3(document.getElementById("HidConid").value)' onmouseout="setPointer(this, '#DDDDDD',3)"
                                                onmouseover="setPointer(this, '#B3D1FF',3)" style="cursor: hand; height: 21px"
                                                title="合同审批记录">
                                                <img align="absMiddle" height="20" src="../images/menu/sms.gif" width="20" /><b><font
                                                    color="#000000"> 费用记录</font></b></td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td class="TableData" colspan="4" style="width: 800px">
                                    <iframe id="IFR" runat="server" frameborder="0"  marginheight="0" marginwidth="0"
                                        name="bottom" scrolling="auto" src="ContractJbInfo.aspx" style="width: 800px;
                                        height: 264px" ></iframe>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
           
        <input id="HidConid" runat="server" type="hidden" />
    <script language=javascript type="text/javascript">
      var menu_id=0;
function setPointer(theRow, thePointerColor,menu_id_over)
{
  if(menu_id!=menu_id_over)
  {
	if(thePointerColor == "#B3D1FF")
		theRow.className="menu_active";
	else
		theRow.className="menu_comon";
   }
}

function view_menu1(Conid)
{
  document.getElementById("HidConid").value=Conid;
  menu_id=1;
  if(menu_id!=0)
      bottom.location="ContractJbInfo.aspx?ConTrId="+document.getElementById("HidConid").value;
   menu_id=1;
   menu_1.className="menu_active";
   menu_3.className="menu_comon";
  
  
}



function view_menu3(Conid)
{
   document.getElementById("HidConid").value=Conid;
   bottom.location="PayRecord.aspx?ConTrId="+Conid;
   menu_id=3;
   menu_1.className="menu_comon";
 
   menu_3.className="menu_active";
 
}
function view_menu4(Conid)
{
   document.getElementById("HidConid").value=Conid;
   bottom.location="ContractEdit.aspx?ConTrId="+Conid;
   menu_id=4;
   menu_1.className="menu_comon";
  
   menu_3.className="menu_comon";
   menu_4.className="menu_active";
   
}
function CheckOk(formName,chkName,str)
{
    var i=0;
    var pronameid;
    var objForm = document.forms[formName];
    var objLen = objForm.length;
    for (var iCount = 0; iCount < objLen; iCount++)
    {
		if (objForm.elements[iCount].type == "checkbox")
		{
		     
		     if((objForm.elements[iCount].name.indexOf(chkName)>-1))
		     {
		          if( objForm.elements[iCount].checked )
		          {
		             i=i+1;
		             pronameid=objForm.elements[iCount].value;
		          }

			 }
		}
		
    }
    if(i>0)
    {
        if(str != "")
        {
            if(i>1)
            {
              alert('只允许选择一条记录！');
            }
            else if(i == 1)
            {
              var url=str+"?ConTrId="+pronameid;
              var dd=window.showModalDialog(url,"水平","dialogWidth=785px;dialogHeight=650px");
            }
        }
        else
        {　
             return true;
        }
    }
    else
    {
     alert('必须选择一条记录！');
     return false;
    }
}
    </script>
    </div>
    </form>
</body>
</html>
