/// <summary> /// 返回字段键值对 /// </summary> /// <param name="id"></param> /// <returns></returns> public NameValueCollectionEx NameValueCollectionEx(ref DealMvc.Model.SiteMessage m_sm) { m_sm = DealMvc.Model.SiteMessage.GetModel(m_sm.id ?? 0); if (m_sm.IsNull) { throw new ExceptionEx.MyExceptionMessageBox("m_sm Is Null"); } NameValueCollectionEx _nvce = new NameValueCollectionEx(); _nvce.Add("UserName", m_sm.UserName); //UserName[Type=string] - 账号 _nvce.Add("UserPwd", m_sm.UserPwd); //UserPwd[Type=string] - 密码 _nvce.Add("UpTime", m_sm.UpTime); //UpTime[Type=DateTime?] - 更新时间 return(_nvce); }
public void ToReadOnly_ReturnsReadOnlyNameValueCollection() { NameValueCollectionEx target = new NameValueCollectionEx(); target.Add("name", "value"); NameValueCollectionEx actual = target.ToReadOnly(); actual.Add("exception", "here"); }
/// <summary> /// 返回字段键值对 /// </summary> /// <param name="id"></param> /// <returns></returns> public NameValueCollectionEx NameValueCollectionEx(ref DealMvc.Model.SiteLoginAPI m_slapi) { m_slapi = DealMvc.Model.SiteLoginAPI.GetModel(m_slapi.id ?? 0); if (m_slapi.IsNull) { throw new ExceptionEx.MyExceptionMessageBox("m_slapi Is Null"); } NameValueCollectionEx _nvce = new NameValueCollectionEx(); _nvce.Add("ApiType", m_slapi.ApiType); //ApiType[Type=string] - API类型 _nvce.Add("App_key", m_slapi.App_key); //App_key[Type=string] - App_key _nvce.Add("App_secret", m_slapi.App_secret); //App_secret[Type=string] - App_secret _nvce.Add("MetaProperty", m_slapi.MetaProperty); //MetaProperty[Type=string] - MetaProperty _nvce.Add("UpTime", m_slapi.UpTime); //UpTime[Type=DateTime?] - 更新时间 return(_nvce); }
/// <summary> /// 返回字段键值对 /// </summary> /// <param name="id"></param> /// <returns></returns> public NameValueCollectionEx NameValueCollectionEx(ref DealMvc.Model.SitePayAPI m_spapi) { m_spapi = DealMvc.Model.SitePayAPI.GetModel(m_spapi.id ?? 0); if (m_spapi.IsNull) { throw new ExceptionEx.MyExceptionMessageBox("m_spapi Is Null"); } NameValueCollectionEx _nvce = new NameValueCollectionEx(); _nvce.Add("ApiType", m_spapi.ApiType); //ApiType[Type=string] - API类型 _nvce.Add("Account", m_spapi.Account); //Account[Type=string] - 签约账号 _nvce.Add("AppIdentity", m_spapi.AppIdentity); //AppIdentity[Type=string] - 合作者身份 _nvce.Add("AppKey", m_spapi.AppKey); //AppKey[Type=string] - 密钥 _nvce.Add("UpTime", m_spapi.UpTime); //UpTime[Type=DateTime?] - 更新时间 return(_nvce); }
/// <summary> /// 返回字段键值对 /// </summary> /// <param name="id"></param> /// <returns></returns> public NameValueCollectionEx NameValueCollectionEx(ref DealMvc.Model.SiteUpLoad m_sul) { m_sul = DealMvc.Model.SiteUpLoad.GetModel(m_sul.id ?? 0); if (m_sul.IsNull) { throw new ExceptionEx.MyExceptionMessageBox("m_sul Is Null"); } NameValueCollectionEx _nvce = new NameValueCollectionEx(); _nvce.Add("UploadFolder", m_sul.UploadFolder); //UploadFolder[Type=string] - 上传文件夹 _nvce.Add("UploadExtension", m_sul.UploadExtension); //UploadExtension[Type=string] - 文件后缀名 _nvce.Add("UploadSize", m_sul.UploadSize); //UploadSize[Type=double?] - 文件大小 _nvce.Add("DefaultImg", m_sul.DefaultImg); //DefaultImg[Type=string] - 默认图片 _nvce.Add("UpTime", m_sul.UpTime); //UpTime[Type=DateTime?] - 更新时间 return(_nvce); }
/// <summary> /// 返回字段键值对 /// </summary> /// <param name="id"></param> /// <returns></returns> public NameValueCollectionEx NameValueCollectionEx(ref DealMvc.Model.PointsSet m_ps) { m_ps = DealMvc.Model.PointsSet.GetModel(m_ps.id ?? 0); if (m_ps.IsNull) { throw new ExceptionEx.MyExceptionMessageBox("m_ps Is Null"); } NameValueCollectionEx _nvce = new NameValueCollectionEx(); _nvce.Add("PS_ConsumerPoints", m_ps.PS_ConsumerPoints); //PS_Cate[Type= int?] - 完成消费送积分 _nvce.Add("PS_RegPoints", m_ps.PS_RegPoints); //PS_RegPoints[Type= int?] - 完成注册送积分 _nvce.Add("PS_PhoneVerifyPoints", m_ps.PS_PhoneVerifyPoints); //PS_PhoneVerifyPoints[Type= int?] - 验证手机送积分 _nvce.Add("PS_EmailVerifyPoints", m_ps.PS_EmailVerifyPoints); //PS_EmailVerifyPoints[Type= int?] - 验证邮箱送积分 _nvce.Add("PS_Time", m_ps.PS_Time); //PS_Time[Type=DateTime?] - 更新时间 _nvce.Add("A", m_ps.A); //A[Type=string] - 扩展A字段 _nvce.Add("B", m_ps.B); //B[Type=string] - 扩展B字段 _nvce.Add("C", m_ps.C); //C[Type=string] - 扩展C字段 _nvce.Add("D", m_ps.D); //D[Type=string] - 扩展D字段 _nvce.Add("E", m_ps.E); //E[Type=string] - 扩展E字段 return(_nvce); }
public ActionResult EAdminPwd(int?a_i_id, string AdminOldPwd, string AdminPwd, string AdminPwd2) { DealMvc.Model.Admin m_Admin = null; m_Admin = DealMvc.Orm.EntityCore <DealMvc.Model.Admin> .GetModel(a_i_id ?? 0); if (!m_Admin.IsNull) { NameValueCollectionEx _NameValueCollectionEx = new NameValueCollectionEx(); _NameValueCollectionEx.Add("AdminID", m_Admin.AdminID); SetSaveFormCollection = _NameValueCollectionEx; } if (IsPost) { try { if (m_Admin.IsNull) { throw new ExceptionEx.MyExceptionMessageBox("修改密码失败,请稍候在试"); } else { if (string.IsNullOrEmpty(AdminPwd) || AdminPwd != AdminPwd2) { throw new ExceptionEx.MyExceptionMessageBox("两次输入密码不一致"); } else { if (m_Admin.AdminPwd == Common.Net.DealString.MD5(AdminOldPwd)) { m_Admin.AdminPwd = Common.Net.DealString.MD5(AdminPwd); DealMvc.Orm.EntityCore <DealMvc.Model.Admin> .Update(m_Admin); throw new ExceptionEx.MyExceptionMessageBox("修改密码成功"); } else { throw new ExceptionEx.MyExceptionMessageBox("旧密码不正确"); } } } } catch (Exception ce) { ExceptionEx.MyExceptionLog.WriteLog(this, ce); } } return(View()); }
/// <summary> /// 返回字段键值对 /// </summary> /// <param name="id"></param> /// <returns></returns> public NameValueCollectionEx NameValueCollectionEx(ref DealMvc.Model.HelpCenterCate m_hcc) { m_hcc = DealMvc.Model.HelpCenterCate.GetModel(m_hcc.id ?? 0); if (m_hcc.IsNull) { throw new ExceptionEx.MyExceptionMessageBox("m_hcc Is Null"); } NameValueCollectionEx _nvce = new NameValueCollectionEx(); _nvce.Add("HCC_Name", m_hcc.HCC_Name); //HCC_Name[Type=string] - 分类名称 _nvce.Add("HCC_Sort", m_hcc.HCC_Sort); //HCC_Sort[Type= int?] - 排序 _nvce.Add("HCC_Time", m_hcc.HCC_Time); //HCC_Time[Type=DateTime?] - 操作时间 _nvce.Add("A", m_hcc.A); //A[Type=string] - 扩展A字段 _nvce.Add("B", m_hcc.B); //B[Type=string] - 扩展B字段 _nvce.Add("C", m_hcc.C); //C[Type=string] - 扩展C字段 _nvce.Add("D", m_hcc.D); //D[Type=string] - 扩展D字段 _nvce.Add("E", m_hcc.E); //E[Type=string] - 扩展E字段 return(_nvce); }
/// <summary> /// 返回字段键值对 /// </summary> /// <param name="id"></param> /// <returns></returns> public NameValueCollectionEx NameValueCollectionEx(ref DealMvc.Model.SiteEmail m_se) { m_se = DealMvc.Model.SiteEmail.GetModel(m_se.id ?? 0); if (m_se.IsNull) { throw new ExceptionEx.MyExceptionMessageBox("m_se Is Null"); } NameValueCollectionEx _nvce = new NameValueCollectionEx(); _nvce.Add("Smtp", m_se.Smtp); //Smtp[Type=string] - 邮箱SMTP _nvce.Add("Emailname", m_se.Emailname); //Emailname[Type=string] - 用户帐号 _nvce.Add("Email", m_se.Email); //Email[Type=string] - 邮箱地址 _nvce.Add("Emailpwd", m_se.Emailpwd); //Emailpwd[Type=string] - 邮箱密码 _nvce.Add("Port", m_se.Port); //Port[Type= int?] - 邮箱发送端口 _nvce.Add("IsRegSendEmail", m_se.IsRegSendEmail); //IsRegSendEmail[Type=bool] - 是否开启 _nvce.Add("UpTime", m_se.UpTime); //UpTime[Type=DateTime?] - 更新时间 return(_nvce); }
public ActionResult AEAdminSort(int?id, string AdminSortName, string[] AdminSortPowerValues, int?OrderNum) { Model.AdminSort m_AdminSort = null; bool isEdit = true; if (id == null) { isEdit = false; } ViewData["isEdit"] = isEdit; if (IsGet) { if (isEdit) { m_AdminSort = DealMvc.Orm.EntityCore <Model.AdminSort> .GetModel(id ?? 0); if (m_AdminSort.IsNull) { return(RedirectToAction("AdminSortList")); } NameValueCollectionEx _NameValueCollectionEx = new NameValueCollectionEx(); _NameValueCollectionEx.Add("AdminSortName", m_AdminSort.AdminSortName); _NameValueCollectionEx.Add("AdminSortPowerValues", m_AdminSort.AdminSortPowerValues.Split('|')); _NameValueCollectionEx.Add("OrderNum", m_AdminSort.OrderNum); _NameValueCollectionEx.Add("UpTime", m_AdminSort.UpTime); SetSaveFormCollection = _NameValueCollectionEx; } } if (IsPost) { try { if (isEdit) { m_AdminSort = DealMvc.Orm.EntityCore <Model.AdminSort> .GetModel(id ?? 0); } else { m_AdminSort = new Model.AdminSort(); } if (!isEdit) { //检查某些字段是否已经存在相同的值 if (Orm.EntityCore <Model.AdminSort> .Exists(new string[] { "AdminSortName" }, new System.Data.SqlDbType[] { System.Data.SqlDbType.NVarChar }, new object[] { AdminSortName })) { throw new ExceptionEx.MyExceptionMessageBox("已经存在此记录"); } } m_AdminSort.AdminSortName = AdminSortName; m_AdminSort.AdminSortPowerValues = AdminSortPowerValues != null?string.Join("|", AdminSortPowerValues) : ""; m_AdminSort.OrderNum = OrderNum; m_AdminSort.UpTime = DateTime.Now; if (isEdit) { DealMvc.Orm.EntityCore <Model.AdminSort> .Update(m_AdminSort); ExceptionEx.MyExceptionLog.AlertMessage(this, "编辑成功"); IsSaveForm = true; } else { DealMvc.Orm.EntityCore <Model.AdminSort> .Add(m_AdminSort); ExceptionEx.MyExceptionLog.AlertMessage(this, "添加成功", true); return(ViewAndEmpty()); } } catch (Exception ce) { IsSaveForm = true; ExceptionEx.MyExceptionLog.WriteLog(this, ce); } } return(View()); }
/// <summary> /// 返回字段键值对 /// </summary> /// <param name="id"></param> /// <returns></returns> public NameValueCollectionEx NameValueCollectionEx(ref DealMvc.Model.HelpCenterInfo m_hci) { m_hci = DealMvc.Model.HelpCenterInfo.GetModel(m_hci.id ?? 0); if (m_hci.IsNull) { throw new ExceptionEx.MyExceptionMessageBox("m_hci Is Null"); } NameValueCollectionEx _nvce = new NameValueCollectionEx(); _nvce.Add("HelpCateID1", m_hci.HelpCateID1); //HelpCateID1[Type= int?] - 帮助中心一级分类 _nvce.Add("HelpCateID2", m_hci.HelpCateID2); //HelpCateID2[Type= int?] - 帮助中心二级分类 _nvce.Add("HCI_LittleTitle", m_hci.HCI_LittleTitle); //HCI_LittleTitle[Type=string] - 小标题 _nvce.Add("HCI_Title", m_hci.HCI_Title); //HCI_Title[Type=string] - 详细标题 _nvce.Add("HCI_Content", m_hci.HCI_Content); //HCI_Content[Type=string] - 信息内容 _nvce.Add("HCI_IsDefault", m_hci.HCI_IsDefault); //HCI_IsDefault[Type=bool] - 是否默认展示 _nvce.Add("HCI_Sort", m_hci.HCI_Sort); //HCI_Sort[Type= int?] - 排序 _nvce.Add("HCI_Time", m_hci.HCI_Time); //HCI_Time[Type=DateTime?] - 操作时间 _nvce.Add("A", m_hci.A); //A[Type=string] - 扩展A字段 _nvce.Add("B", m_hci.B); //B[Type=string] - 扩展B字段 _nvce.Add("C", m_hci.C); //C[Type=string] - 扩展C字段 _nvce.Add("D", m_hci.D); //D[Type=string] - 扩展D字段 _nvce.Add("E", m_hci.E); //E[Type=string] - 扩展E字段 return(_nvce); }
public ActionResult AEAdmin(int?id, string AdminID, string AdminPwd, string AdminPwd2, string AdminRealName, string AdminSex, int?AdminSortID, string[] AdminPowerValues, string AdminRemark, int?OrderNum) { Model.Admin m_Admin = null; if (Request["a_i_id"] != null) { id = Request["a_i_id"].ToInt32(); } bool isEdit = true; if (id == null) { isEdit = false; } ViewData["isEdit"] = isEdit; if (IsGet) { if (isEdit) { m_Admin = DealMvc.Orm.EntityCore <Model.Admin> .GetModel(id ?? 0); if (m_Admin.IsNull) { return(RedirectToAction("AdminList")); } NameValueCollectionEx _NameValueCollectionEx = new NameValueCollectionEx(); _NameValueCollectionEx.Add("AdminID", m_Admin.AdminID); //_NameValueCollectionEx.Add("AdminPwd", m_Admin.AdminPwd); _NameValueCollectionEx.Add("AdminRealName", m_Admin.AdminRealName); _NameValueCollectionEx.Add("AdminSex", m_Admin.AdminSex); _NameValueCollectionEx.Add("AdminSortID", m_Admin.AdminSortID); _NameValueCollectionEx.Add("AdminPowerValues", m_Admin.AdminPowerValues.Split('|')); _NameValueCollectionEx.Add("AdminRemark", m_Admin.AdminRemark); _NameValueCollectionEx.Add("OrderNum", m_Admin.OrderNum); SetSaveFormCollection = _NameValueCollectionEx; } } if (IsPost) { try { if (isEdit) { m_Admin = DealMvc.Orm.EntityCore <Model.Admin> .GetModel(id ?? 0); } else { if (string.IsNullOrEmpty(AdminPwd) || AdminPwd != AdminPwd2) { DealMvc.Orm.EntityCore <Model.Admin> .Update(m_Admin); ExceptionEx.MyExceptionLog.AlertMessage(this, "两次输入密码不一致"); IsSaveForm = true; return(View()); } m_Admin = new Model.Admin(); m_Admin.AdminPwd = DealMvc.Common.Net.DealString.MD5(AdminPwd); } if (!isEdit) { //检查某些字段是否已经存在相同的值 if (Orm.EntityCore <Model.Admin> .Exists(new string[] { "AdminID" }, new System.Data.SqlDbType[] { System.Data.SqlDbType.NVarChar }, new object[] { AdminID })) { throw new ExceptionEx.MyExceptionMessageBox("已经存在此记录"); } } m_Admin.AdminID = AdminID; m_Admin.AdminRealName = AdminRealName; m_Admin.AdminSex = AdminSex; m_Admin.AdminRemark = AdminRemark; if (Request["a_i_id"] == null) { m_Admin.AdminSortID = AdminSortID; m_Admin.AdminPowerValues = AdminPowerValues == null ? "" : string.Join("|", AdminPowerValues); m_Admin.OrderNum = OrderNum; } m_Admin.UpTime = DateTime.Now; m_Admin.LastLoginTime = DateTime.Now; if (isEdit) { DealMvc.Orm.EntityCore <Model.Admin> .Update(m_Admin); ExceptionEx.MyExceptionLog.AlertMessage(this, "编辑成功"); IsSaveForm = true; } else { DealMvc.Orm.EntityCore <Model.Admin> .Add(m_Admin); ExceptionEx.MyExceptionLog.AlertMessage(this, "添加成功", true); return(ViewAndEmpty()); } } catch (Exception ce) { IsSaveForm = true; ExceptionEx.MyExceptionLog.WriteLog(this, ce); } } return(View()); }
/// <summary> /// 返回字段键值对 /// </summary> /// <param name="id"></param> /// <returns></returns> public NameValueCollectionEx NameValueCollectionEx(ref DealMvc.Model.SiteInfo m_si) { m_si = DealMvc.Model.SiteInfo.GetModel(m_si.id ?? 0); if (m_si.IsNull) { throw new ExceptionEx.MyExceptionMessageBox("m_si Is Null"); } NameValueCollectionEx _nvce = new NameValueCollectionEx(); _nvce.Add("WebName", m_si.WebName); //WebName[Type=string] - 网站名称 _nvce.Add("WebAddress", m_si.WebAddress); //WebAddress[Type=string] - 网站域名 _nvce.Add("WebTitle", m_si.WebTitle); //WebTitle[Type=string] - 网站标题 _nvce.Add("WebKeyword", m_si.WebKeyword); //WebKeyword[Type=string] - 网站关键词 _nvce.Add("WebDelimiter", m_si.WebDelimiter); //WebDelimiter[Type=string] - 网站标题分隔符 _nvce.Add("WebCopyright", m_si.WebCopyright); //WebCopyright[Type=string] - 版权 _nvce.Add("WebStatus", m_si.WebStatus); //WebStatus[Type=bool] - 网站状态(开启网站、关闭网站) _nvce.Add("WebCloseRemark", m_si.WebCloseRemark); //WebCloseRemark[Type=string] - 关闭网站原因 _nvce.Add("WebCompetence", m_si.WebCompetence); //WebCompetence[Type=bool] - 网站后台权限 _nvce.Add("IsOpenDataCache", m_si.IsOpenDataCache); //IsOpenDataCache[Type=bool] - 数据缓存 是否启用 _nvce.Add("DataCacheTime", m_si.DataCacheTime); //DataCacheTime[Type= int?] - 缓存时间(秒) _nvce.Add("ProportionMention", m_si.ProportionMention); //ProportionMention[Type=double?] - 平台提拥比例 _nvce.Add("WebBottomInfo", m_si.WebBottomInfo); //WebBottomInfo[Type=string] - 网站底部信息 _nvce.Add("WebFriendLinks", m_si.WebFriendLinks); //WebFriendLinks[Type=string] - 友情链接 _nvce.Add("WebBottomContact", m_si.WebBottomContact); //WebBottomContact[Type=string] - 底部联系方式 _nvce.Add("WebBottomHours", m_si.WebBottomHours); //WebBottomHours[Type=string] - 营业时间 _nvce.Add("WebRegService", m_si.WebRegService); //WebRegService[Type=string] - 注册条款 _nvce.Add("WebWeiXinImage", m_si.WebWeiXinImage); //WebWeiXinImage[Type=string] - 微信二维码图片 _nvce.Add("WebWeiBoImage", m_si.WebWeiBoImage); //WebWeiBoImage[Type=string] - 微博二维码图片 _nvce.Add("WebContactPhone", m_si.WebContactPhone); //WebContactPhone[Type=string] - 联系电话 _nvce.Add("WebContactEmail", m_si.WebContactEmail); //WebContactEmail[Type=string] - 联系邮箱 _nvce.Add("KeFuQQ", m_si.KeFuQQ); //KeFuQQ[Type=string] - 客服QQ _nvce.Add("BeforeSalePhone", m_si.BeforeSalePhone); //BeforeSalePhone[Type=string] - 售前电话 _nvce.Add("AfterSalePhone", m_si.AfterSalePhone); //AfterSalePhone[Type=string] - 售后电话 return(_nvce); }
/// <summary> /// 返回字段键值对 /// </summary> /// <param name="id"></param> /// <returns></returns> public NameValueCollectionEx NameValueCollectionEx(ref DealMvc.Model.AdvertisingInfo m_ai) { m_ai = DealMvc.Model.AdvertisingInfo.GetModel(m_ai.id ?? 0); if (m_ai.IsNull) { throw new ExceptionEx.MyExceptionMessageBox("m_ai Is Null"); } NameValueCollectionEx _nvce = new NameValueCollectionEx(); _nvce.Add("AI_AdLocation", m_ai.AI_AdLocation); //AI_AdLocation[Type=string] - 广告位置 _nvce.Add("AI_AdPicWidth", m_ai.AI_AdPicWidth); //AI_AdPicWidth[Type= int?] - 像素宽 _nvce.Add("AI_AdPicHeight", m_ai.AI_AdPicHeight); //AI_AdPicHeight[Type= int?] - 像素高 _nvce.Add("AI_AdTitle", m_ai.AI_AdTitle); //AI_AdTitle[Type=string] - 广告语 _nvce.Add("AI_AdPic", m_ai.AI_AdPic); //AI_AdPic[Type=string] - 广告图片 _nvce.Add("AI_LinkUrl", m_ai.AI_LinkUrl); //AI_LinkUrl[Type=string] - 链接地址 _nvce.Add("AI_Remarks", m_ai.AI_Remarks); //AI_Remarks[Type=string] - 广告备注 _nvce.Add("AI_IsTarget", m_ai.AI_IsTarget); //AI_IsTarget[Type=bool] - 是否新窗口打开 _nvce.Add("AI_Time", m_ai.AI_Time); //AI_Time[Type=DateTime?] - 操作时间 _nvce.Add("A", m_ai.A); //A[Type=string] - 扩展A字段 _nvce.Add("B", m_ai.B); //B[Type=string] - 扩展B字段 _nvce.Add("C", m_ai.C); //C[Type=string] - 扩展C字段 _nvce.Add("D", m_ai.D); //D[Type=string] - 扩展D字段 _nvce.Add("E", m_ai.E); //E[Type=string] - 扩展E字段 return(_nvce); }