<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<ali:Get ID="Module" Object="Module" Operation="Get(Request.QueryString['Namespace'])" />
<ali:Get ID="Object" Object="Module.Object" Operation="Get(Request.QueryString['Namespace'], Convert.ToInt32(Request.QueryString['ObjectID']))" />
<ali:Get ID="Property" Object="Module.Object.Property" Operation="Get(Request.QueryString['Namespace'], Convert.ToInt32(Request.QueryString['ObjectID']), Convert.ToInt32(Request.QueryString['ID']))" Validate="True" />

<title>编辑属性</title>
<link rel="stylesheet"  href="<%=CommonPath%>jquery/themes/lightness/all.css" >
<ali:Comment><link rel="stylesheet"  href="../../../../S01/CHS/css/common.css" ></ali:Comment>
<link rel="stylesheet" href="<%=CssPath%>common.css" >
<script >
var _page = 'module_object_property_edit',
    _lang = '<%=ContentLang%>',
    _webPath = '<%=WebPath%>',
    _imagePath = '<%=ImagePath%>',
    _id = '<%=Request.QueryString["ID"]%>',
    _namespace = '<%=Request.QueryString["Namespace"]%>',
    _objectID = '<%=Request.QueryString["ObjectID"]%>',
    _sqlDbType = '<%=Property[SqlDbType]%>',
    _oleDbType = '<%=Property[OleDbType]%>',
    _mainFieldID = '<%=Property[MainFieldID]%>',
    _lang_working = '正在操作...',
    _lang_operation_fail = '操作失败！',
    _lang_operation_success = '操作成功！',
    _lang_name_empty = '名称不能空！',
    _lang_max_length_incorrect = '字段大小不正确！',
    _lang_numeric_precision_empty = '精度不正确！',
    _lang_numeric_scale_empty = '小数位数不正确！';
</script>
</head>
<body>
<div class="WhiteHeader">
	<div class="Left"><img src="<%=ImagePath%>close_frame.gif" ></div>
	<div class="Title"><a href="../../list.aspx?Lang=<%=ContentLang%>">模块列表</a> → <a href="../../object/list.aspx?Lang=<%=ContentLang%>&amp;Namespace=<%=Request.QueryString["Namespace"]%>"><span class="<%=ContentLang%>Font"><strong><%=Module[Label]%></strong>模块的对象列表</span></a> → <span class="<%=ContentLang%>Font"><%=Object[Label]%></span></div>
	<div class="Right"></div>
</div>
<div class="Block">
	<ul class="TabMenu">
		<li class="Left"></li>
		<li class="Middle"><a href="../../object/edit.aspx?Lang=<%=ContentLang%>&amp;Namespace=<%=Request.QueryString["Namespace"]%>&amp;ID=<%=Request.QueryString["ObjectID"]%>">编辑</a></li>
		<li class="Right"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="../../object/operation/list.aspx?Lang=<%=ContentLang%>&amp;Namespace=<%=Request.QueryString["Namespace"]%>&amp;ObjectID=<%=Request.QueryString["ObjectID"]%>">操作列表</a></li>
		<li class="Right"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="../../object/operation/add.aspx?Lang=<%=ContentLang%>&amp;Namespace=<%=Request.QueryString["Namespace"]%>&amp;ObjectID=<%=Request.QueryString["ObjectID"]%>">添加操作</a></li>
		<li class="Right"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="../../object/property/list.aspx?Lang=<%=ContentLang%>&amp;Namespace=<%=Request.QueryString["Namespace"]%>&amp;ObjectID=<%=Request.QueryString["ObjectID"]%>">属性列表</a></li>
		<li class="Right"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="../../object/property/add.aspx?Lang=<%=ContentLang%>&amp;Namespace=<%=Request.QueryString["Namespace"]%>&amp;ObjectID=<%=Request.QueryString["ObjectID"]%>">添加属性</a></li>
		<li class="Right"></li>
		<li class="Left Selected"></li>
		<li class="Middle Selected">编辑属性</li>
		<li class="Right Selected"></li>
	</ul>
	<ul class="Title">
		<li class="Left"></li>
		<li class="Middle"></li>
		<li class="Right"></li>
	</ul>
	<form>
		<table border="0" cellpadding="4" cellspacing="1">
			<tbody>
				<tr>
					<th width="140">Guid：</th>
					<td><%=Property[ID]%></td>
				</tr>
				<tr>
					<th>名称：</th>
					<td><input type="text" name="Name" value="<%=Property[Name]%>" size="30" maxlength="50" class="Text" ></td>
				</tr>
				<tr>
					<th>字段名称：</th>
					<td><input type="text" name="FieldName" value="<%=Property[FieldName]%>" size="30" maxlength="50" class="Text" ></td>
				</tr>
				<tr>
					<th>必填字段：</th>
					<td>
						<%If Convert.ToBoolean(Property[IsNullable])%>
							<input type="radio" name="IsNullable" id="IsNullableNo" ><label for="IsNullableNo">是</label>
							<input type="radio" name="IsNullable" id="IsNullableYes" checked="checked" ><label for="IsNullableYes">否</label>
						<%Else%>
							<input type="radio" name="IsNullable" id="IsNullableNo" checked="checked" ><label for="IsNullableNo">是</label>
							<input type="radio" name="IsNullable" id="IsNullableYes" ><label for="IsNullableYes">否</label>
						<%EndIf%>
					</td>
				</tr>
				<tr>
					<th>SqlServer默认值：</th>
					<td><input type="text" name="SqlDbDefault" value="<%=Property[SqlDbDefault]%>" maxlength="50" class="Text" ></td>
				</tr>
				<tr>
					<th>OleDb默认值：</th>
					<td><input type="text" name="OleDbDefault" value="<%=Property[OleDbDefault]%>" maxlength="50" class="Text" ></td>
				</tr>
				<tr>
					<th>SqlServer类型：</th>
					<td>
						<select name="SqlDbType">
							<option value="8">Int</option>
							<option value="12">NVarChar</option>
							<option value="22">VarChar</option>
							<option value="11">NText</option>
							<option value="2">Bit</option>
							<option value="4">DateTime</option>
							<option value="9">Money</option>
							<option value="5">Decimal</option>
							<option value="14">UniqueIdentifier</option>
						</select>
					</td>
				</tr>
				<tr>
					<th>OleDb类型：</th>
					<td>
						<select name="OleDbType">
							<option value="130">WChar</option>
							<option value="200">VarChar</option>
							<option value="202">VarWChar</option>
							<option value="203">LongVarWChar</option>
							<option value="3">Integer</option>
							<option value="11">Boolean</option>
							<option value="7">Date</option>
							<option value="6">Currency</option>
							<option value="131">Numeric</option>
							<option value="72">Guid</option>
						</select>
					</td>
				</tr>
				<tr>
					<th>字段大小：</th>
					<td><input type="text" name="MaxLength" value="<%=Property[MaxLength]%>" size="5" maxlength="10" class="Text" ></td>
				</tr>
				<tr>
					<th>精度：</th>
					<td><input type="text" name="NumericPrecision" value="<%=Property[NumericPrecision]%>" size="5" maxlength="10" class="Text" ></td>
				</tr>
				<tr>
					<th>小数位数：</th>
					<td><input type="text" name="NumericScale" value="<%=Property[NumericScale]%>" size="5" maxlength="10" class="Text" ></td>
				</tr>
				<tr>
					<th>自动编号：</th>
					<td>
						<%If Convert.ToBoolean(Property[IsIdentity])%>
							<input type="radio" name="IsIdentity" id="IsIdentityYes" checked="checked" ><label for="IsIdentityYes">是</label>
							<input type="radio" name="IsIdentity" id="IsIdentityNo" ><label for="IsIdentityNo">否</label>
						<%Else%>
							<input type="radio" name="IsIdentity" id="IsIdentityYes" ><label for="IsIdentityYes">是</label>
							<input type="radio" name="IsIdentity" id="IsIdentityNo" checked="checked" ><label for="IsIdentityNo">否</label>
						<%EndIf%>
					</td>
				</tr>
				<tr>
					<th>多语言字段：</th>
					<td>
						<%If Convert.ToBoolean(Property[MultiLanguage])%>
							<input type="radio" name="MultiLanguage" id="MultiLanguageYes" checked="checked" ><label for="MultiLanguageYes">是</label>
							<input type="radio" name="MultiLanguage" id="MultiLanguageNo" ><label for="MultiLanguageNo">否</label>
						<%Else%>
							<input type="radio" name="MultiLanguage" id="MultiLanguageYes" ><label for="MultiLanguageYes">是</label>
							<input type="radio" name="MultiLanguage" id="MultiLanguageNo" checked="checked" ><label for="MultiLanguageNo">否</label>
						<%EndIf%>
					</td>
				</tr>
				<tr>
					<th>主键：</th>
					<td>
						<%If Convert.ToBoolean(Property[PrimaryKey])%>
							<input type="radio" name="PrimaryKey" id="PrimaryKeyYes" checked="checked" ><label for="PrimaryKeyYes">是</label>
							<input type="radio" name="PrimaryKey" id="PrimaryKeyNo" ><label for="PrimaryKeyNo">否</label>
						<%Else%>
							<input type="radio" name="PrimaryKey" id="PrimaryKeyYes" ><label for="PrimaryKeyYes">是</label>
							<input type="radio" name="PrimaryKey" id="PrimaryKeyNo" checked="checked" ><label for="PrimaryKeyNo">否</label>
						<%EndIf%>
					</td>
				</tr>
				<tr>
					<th>唯一约束：</th>
					<td>
						<%If Convert.ToBoolean(Property[Unique])%>
							<input type="radio" name="Unique" id="UniqueYes" checked="checked" ><label for="UniqueYes">是</label>
							<input type="radio" name="Unique" id="UniqueNo" ><label for="UniqueNo">否</label>
						<%Else%>
							<input type="radio" name="Unique" id="UniqueYes" ><label for="UniqueYes">是</label>
							<input type="radio" name="Unique" id="UniqueNo" checked="checked" ><label for="UniqueNo">否</label>
						<%EndIf%>
					</td>
				</tr>
				<tr>
					<th>可做缺省Meta信息：</th>
					<td>
						<%If Convert.ToBoolean(Property[IsMeta])%>
							<input type="radio" name="IsMeta" id="IsMetaYes" checked="checked" ><label for="IsMetaYes">是</label>
							<input type="radio" name="IsMeta" id="IsMetaNo" ><label for="IsMetaNo">否</label>
						<%Else%>
							<input type="radio" name="IsMeta" id="IsMetaYes" ><label for="IsMetaYes">是</label>
							<input type="radio" name="IsMeta" id="IsMetaNo" checked="checked" ><label for="IsMetaNo">否</label>
						<%EndIf%>
					</td>
				</tr>
				<tr>
					<th>主表：</th>
					<td>
						<select name="MainTableID">
							<option value="00000000-0000-0000-0000-000000000000">未指定</option>
							<ali:Tree Object="Module.Object" Condition="Namespace=Request.QueryString['Namespace']">
								<ali:Control>
									<ali:Space>&nbsp;&nbsp;</ali:Space>
									<ali:Line>│</ali:Line>
									<ali:TopOpen>┌</ali:TopOpen>
									<ali:Top>┌</ali:Top>
									<ali:MiddleOpen>├</ali:MiddleOpen>
									<ali:Middle>├</ali:Middle>
									<ali:BottomOpen>└</ali:BottomOpen>
									<ali:Bottom>└</ali:Bottom>
								</ali:Control>
								<ali:Record>
									<%If Guid.Equals(ID, Property[MainTableID])%>
										<option value="<%=ID%>" selected="selected"><%=Control%><%=Name%></option>
									<%Else%>
										<option value="<%=ID%>"><%=Control%><%=Name%></option>
									<%EndIf%>
									<%=ChildRecords%>
								</ali:Record>
							</ali:Tree>
						</select>
					</td>
				</tr>
				<tr>
					<th>主键：</th>
					<td>
						<select name="MainFieldID">
						</select>
					</td>
				</tr>
				<tr>
					<th>级联更新相关字段：</th>
					<td>
						<%If Convert.ToBoolean(Property[UpdateRule])%>
							<input type="radio" name="UpdateRule" id="UpdateRuleYes" checked="checked" ><label for="UpdateRuleYes">是</label>
							<input type="radio" name="UpdateRule" id="UpdateRuleNo" ><label for="UpdateRuleNo">否</label>
						<%Else%>
							<input type="radio" name="UpdateRule" id="UpdateRuleYes" ><label for="UpdateRuleYes">是</label>
							<input type="radio" name="UpdateRule" id="UpdateRuleNo" checked="checked" ><label for="UpdateRuleNo">否</label>
						<%EndIf%>
					</td>
				</tr>
				<tr>
					<th>级联删除相关字段：</th>
					<td>
						<%If Convert.ToBoolean(Property[DeleteRule])%>
							<input type="radio" name="DeleteRule" id="DeleteRuleYes" checked="checked" ><label for="DeleteRuleYes">是</label>
							<input type="radio" name="DeleteRule" id="DeleteRuleNo" ><label for="DeleteRuleNo">否</label>
						<%Else%>
							<input type="radio" name="DeleteRule" id="DeleteRuleYes" ><label for="DeleteRuleYes">是</label>
							<input type="radio" name="DeleteRule" id="DeleteRuleNo" checked="checked" ><label for="DeleteRuleNo">否</label>
						<%EndIf%>
					</td>
				</tr>
			</tbody>
			<tfoot>
				<tr>
					<td colspan="2">
						<input type="submit" value="编辑" >
					</td>
				</tr>
			</tfoot>
		</table>
	</form>
	<div class="Footer"></div>
</div>
<script src="<%=CommonPath%>jquery/core.js"></script>
<script src="<%=CommonPath%>jquery/ui.js"></script>
<script src="<%=CommonPath%>utility.js"></script>
<script src="<%=Manager.GetModulePath(null)%><%=Instance[AliCMS.SystemModule.Alias.Module.Namespace]%>/alias.js"></script>
<script src="<%=CommonPath%>xmldom.js"></script>
<script src="<%=JsPath%>global.js"></script>
<script src="<%=ModuleJsPath%>module.js"></script>
</body>
</html>