<%@ Page Language="C#" AutoEventWireup="true" debug="true" Inherits="WinLibClass.Form.Admin.FirmCompany.Update"  CodePage="65001" %>


<script type="text/javascript"> 
jQuery(document).ready(function(){jQuery("#BtnSubmit").click(function(){SaveSub();});});
function SaveSub(){
	var pass= checkform();
	if(pass){
			var queryString = $('#form_add').serialize()
			jQuery.ajax({
				async:false,
				type: "POST",
				url:"Update.aspx?IsAdd=20",
				data:queryString,
				cache: false,
				success: function(msg){
						if(msg=='1'){ 
							Alert('<%=(Id>0)?"修改":"添加" %>成功!',1,function(){Common.Refresh();});
							//Common.Refresh();
							
						}else{
							if(msg.indexOf("您的权限不足")<0){msg = "<%=(Id>0)?"修改":"添加" %>失败,请检查各项输入是否正确或网络连接状态.";	}
							AlertErr(msg,2);
						}
				},
				error:function(msg){AlertErr('写入数据库异常',2);}
			});		
		}
		//else{AlertErr('出错啦:连接异常,操作失败。',2);}

	return false;
}


function funSucc(id,msg){}
function funFail(id,msg){Common.ShowTipFaceSmile(false,msg,3);}
function checkform(){
    var ok = jQuery.checkForm2({
        ctrls: [   
		{id: "CompanyName",type:"mustRegular", par:/[\w\u4e00-\u9fa5]{2,50}$/,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"名称字数:2~50字");}}
		,{id: "CompanyAddress",type:"mustRegular", par:/[\w\u4e00-\u9fa5]{2,200}$/,funSuccess: function(ctr){ funSucc(ctr.id,"");},funFailed:function(ctr){funFail(ctr.id,"地址字数:2~200字");}}
            ],
        success: function(){ //验证通过mustEqualTo
            },
        failed: function(msg){  //Alert("验证失败");
            }
        });
	return ok;	

}
</script> 


<style>
input{width:400px;height:20px;}
</style>


<div style="height:auto;border:0px;width:500px;overflow:hidden;">
	<form id="form_add">
<div class="TableUpdateDiv"  style="width:96%;">
<div style="width:98%;">
	<table class="TableUpdate" style="text-align:left;">
	
	<tr >
	<td >公司名称:
	<INPUT TYPE="text" NAME="CompanyName" id="CompanyName" value="<%=DataInfo.CompanyName%>" /> </td>
	</tr>	
	
	<tr >
	<td >公司地址:<br />
	<textarea  NAME="CompanyAddress" id="CompanyAddress" style="width:400px;height:100px;margin-left:60px;margin-top:-20px;"><%=DataInfo.CompanyAddress%></textarea> </td>
	</tr>
	<tr >
	<td >联系电话:
	<INPUT TYPE="text" NAME="CompanyMobile" id="CompanyMobile" value="<%=DataInfo.CompanyMobile%>" /> </td>
	</tr>

	<tr >
	<td >排　　序:
	<INPUT TYPE="text" NAME="OrderId" id="OrderId" value="<%=DataInfo.OrderId%>" style="width:50px" />（倒序）
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	</td>
	</tr>

	<tr >
	<td >是否启用:
		<SELECT NAME="IsChecked" id="IsChecked">
		<option value="0" <%=DataInfo.IsChecked==0?"selected":""%>  >未启用</option>
		<option value="1" <%=DataInfo.IsChecked==1?"selected":""%>  >已启用</option>
		</SELECT>
		</td>
	</tr>

	<tr>
	<td>上次更新: 
		<INPUT TYPE="text" NAME="LastTIme" id="LastTIme" class="InputReadonly" value="<%=DataInfo.LastTIme.ToString("yyyy-MM-dd HH:mm:ss")%>" readonly /> 
	</td>
	</tr>


	<tr style="display:none">
	<td >
		<INPUT TYPE="hidden" NAME="CompanyId" id="CompanyId" value="<%=DataInfo.CompanyId%>" readonly /> 
		<INPUT TYPE="hidden" NAME="ID" id="ID" value="<%=DataInfo.ID%>" readonly /> 
		<INPUT TYPE="hidden1" NAME="CompanyLogo" id="CompanyLogo" value="<%=DataInfo.CompanyLogo%>" readonly /> 
		<INPUT TYPE="hidden" NAME="CreateTime" id="CreateTime" value="<%=DataInfo.CreateTime%>" readonly /> 
		<INPUT TYPE="hidden" NAME="Remark" id="Remark" value="<%=DataInfo.Remark%>" readonly /> 
	</td>
	</tr>		
	</table>

	</div>
</div>	


	
</form>
	
</div>


