YNICTE/BO/Views/Shared/Partial/Mobile.cshtml

26 lines
1.3 KiB
Plaintext

@model string
@{
var changeid = (ViewData["changeid"] ?? "xxx").ToString();
var _model = Model == null ? "" : Model;
var mobile = new string[3];
if (_model.Length < 10)
{
mobile = new string[] { "", "", "" };
}
else
{
mobile = new string[] { Model.Substring(0, 3), Model.Length == 10 ? Model.Substring(3, 3) : Model.Substring(3, 4), Model.Length == 10 ? Model.Substring(6) : Model.Substring(7) };
}
var _id = ViewData["id"].ToString();
}
<select id="@(_id)1" class="mobile1 mobile mobiledata@(changeid)" data-bind="@changeid" style="width: 80px;">
<option value="010" @("010".Equals(mobile[0]) ? "selected" : "")>010</option>
<option value="016" @("016".Equals(mobile[0]) ? "selected" : "")>016</option>
<option value="017" @("017".Equals(mobile[0]) ? "selected" : "")>017</option>
<option value="018" @("018".Equals(mobile[0]) ? "selected" : "")>018</option>
<option value="019" @("019".Equals(mobile[0]) ? "selected" : "")>019</option>
</select>
<input type="text" id="@(_id)2" value="@mobile[1]" maxlength="4" class="int mobile2 mobile mobiledata@(changeid)" data-bind="@changeid"/>
<input type="text" id="@(_id)3" value="@mobile[2]" maxlength="4" class="int mobile3 mobile mobiledata@(changeid)" data-bind="@changeid"/>