1.城市区域
|
//页面使用
|
<div class="popupMenu" id="PCACCommon"></div>
|
<script type="text/javascript">
|
PCAC('<%=Province %>', '<%=City %>', '<%=County %>',"Name");//城市数据存名称用Name,存编号则空字符
|
</script>
|
|
//后台使用
|
//声明
|
public string Province = ""; //接收值 Request["selectProvince"].ToString2();
|
public string City = "";//接收值 Request["selectCity"].ToString2();
|
public string County = "";//接收值 Request["selectCounty"].ToString2();
|
|
//赋值
|
Province = model.Province.ToString2();
|
City= model.City.ToString2();
|
County = model.County.ToString2();
|
|
//接收
|
model.Province = Request["selectProvince"].ToString2();
|
model.City = Request["selectCity"].ToString2();
|
model.County = Request["selectCounty"].ToString2();
|
|
2.列表序号
|
//有分页
|
<%#Container.ItemIndex + 1+ this.UCPager1.PageSize * (this.UCPager1.PageIndex - 1)%>
|
//无分页
|
<%#Container.ItemIndex + 1%>
|
|
|
3.客户经理 业务经理 操作人 员工
|
//当数据库存int时//会员id,是否业务经理,是否客户经理
|
this.selBusinessManagerId.DataSource = bll_OA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId,true,false);
|
this.selBusinessManagerId.DataTextField = "Name";
|
this.selBusinessManagerId.DataValueField = "Keyid";
|
this.selBusinessManagerId.DataBind();
|
this.selBusinessManagerId.Items.Insert(0, new ListItem("请选择", ""));
|
this.selBusinessManagerId.Items.Insert(1, new ListItem(CurrentUser.ShortName, "0"));
|
//当数据库存string时
|
this.selBusinessManagerId.DataSource = bll_OA_StaffBLL.SelectListByFirmId(CurrentUser.MemberId,true,false);
|
this.selBusinessManagerId.DataTextField = "Name";
|
this.selBusinessManagerId.DataValueField = "Name";
|
this.selBusinessManagerId.DataBind();
|
this.selBusinessManagerId.Items.Insert(0, new ListItem("请选择", ""));
|
this.selBusinessManagerId.Items.Insert(1, new ListItem(CurrentUser.ShortName, CurrentUser.ShortName));
|
|
4.上传单张图片文件
|
|
<tr>
|
<td align="right">
|
Logo
|
</td>
|
<td>
|
<input type="file" name="fileAP_DefaultImg" class="" /><br />
|
<img width="60" height="60" src='<%=ViewData["_Logo"].JEP2() %>' />
|
</td>
|
</tr>
|
|
//写到业务逻辑层
|
CY.WebForm.cs.UploadCS.UpFileResult _UpFileResult2 = CY.WebForm.cs.UploadCS.Upload("fileAP_DefaultImg", m_Info_Ad.A_Pic);
|
m_Info_Ad.A_Pic = m_Info_Ad.A_Pic ?? "";
|
if (_UpFileResult2.returnerror.Count == 0)
|
{
|
if (_UpFileResult2.returnfilename.Count > 0)
|
m_Info_Ad.A_Pic = _UpFileResult2.returnfilename[0].ToString2();
|
}
|
else
|
JavaScript.MessageBox(string.Join("<br/>", (string[])_UpFileResult2.returnerror.ToArray(typeof(string))), this);
|
|
|
|
|
/*4 上传多张图片文件*/
|
<tr>
|
<td align="right">
|
产品图片
|
</td>
|
<td>
|
<div>
|
<ul>
|
<%
|
string[] s = null;
|
object o = ViewData["_ProductPics"];
|
if (o == null) { s = new string[] { }; }
|
else { s = (string[])o; }
|
for (int i = 0; i < s.Length; i++)
|
{
|
%>
|
<li class="fl" style="padding: 5px;">
|
<img style="border: 2px solid #666;" width="60" height="60" src='<%=s[i] %>' />
|
<input type="checkbox" checked="checked" name="OldProductPics" value='<%=s[i] %>' />
|
</li>
|
<%} %>
|
</ul>
|
<div class="cb">
|
</div>
|
</div>
|
<div class="Files">
|
<input type="file" name="ProductPics" /><br />
|
</div>
|
<div>
|
<input type="button" value=" + " class="addFile" />
|
<input type="button" value=" - " class="cutFile" />
|
</div>
|
<script>
|
$(function ()
|
{
|
$(".addFile").click(function ()
|
{
|
$(this).parent().parent().find(".Files").append("<input type=\"file\" name=\"ProductPics\" /><br />");
|
});
|
$(".cutFile").click(function ()
|
{
|
$(this).parent().parent().find(".Files").find(":file").last().remove();
|
$(this).parent().parent().find(".Files").find("br").last().remove();
|
});
|
});
|
</script>
|
</td>
|
</tr>
|
|
|
|
参数: string ProductPics, string[] OldProductPics,
|
|
//写到业务逻辑层
|
Common.Globals.UpFileResult _UpFileResult = Common.Globals.Upload("ProductPics");
|
if (_UpFileResult.returnerror.Count == 0)
|
{
|
ArrayList _Arr = new ArrayList();
|
if (OldProductPics != null && OldProductPics.Length > 0)
|
{ for (int i = 0; i < OldProductPics.Length; i++) { _Arr.Add(OldProductPics[i]); } }
|
_Arr.AddRange(_UpFileResult.returnfilename);
|
m_Product.ProductPics = string.Join(",", (string[])_Arr.ToArray(typeof(string)));
|
}
|
else
|
{
|
throw new DealMvc.Common.ExceptionEx.MyExceptionMessageBox(string.Join("<br/>", (string[])_UpFileResult.returnerror.ToArray(typeof(string))));
|
}
|
|
|
try
|
{
|
ViewData["_ProductPics"] = m_Product.ProductPics.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
|
}
|
catch { }
|