protected void btnSave_Click(object sender, EventArgs e) { EyouSoft.Model.CommunityStructure.ExchangeComment model = new EyouSoft.Model.CommunityStructure.ExchangeComment(); model.CommentId = string.Empty; model.CommentIP = StringValidate.GetRemoteIP(); model.CommentText = Utils.InputText(Utils.GetFormValue("txt_content")); model.CompanyId = base.SiteUserInfo.CompanyID; model.CompanyName = base.SiteUserInfo.CompanyName; model.IsAnonymous = IsAnonymous.Checked; model.IsCheck = false; model.IsDeleted = false; model.IsHasNextLevel = false; model.IssueTime = DateTime.Now; model.OperatorId = base.SiteUserInfo.ID; model.OperatorMQ = base.SiteUserInfo.ContactInfo.MQ; model.OperatorName = base.SiteUserInfo.ContactInfo.ContactName; model.TopicType = EyouSoft.Model.CommunityStructure.TopicType.宾; model.TopicId = hGuestId.Value; int Result = Ibll.AddExchangeComment(model); Ibll = null; model = null; if (Result > 0) { Utils.ShowAndRedirect("发表成功!", Request.RawUrl); } else { Utils.ShowAndRedirect("发表失败!", Request.RawUrl); } }
private void BindData() { string fromDate = Request.QueryString["FromDate"]; if (StringValidate.IsDateTime(fromDate)) { IList <EyouSoft.Model.ToolStructure.CompanyDayMemo> list = EyouSoft.BLL.ToolStructure.CompanyDayMemo.CreateInstance().GetList(this.SiteUserInfo.CompanyID, Convert.ToDateTime(fromDate)); if (list != null && list.Count > 0) { crptMemList.DataSource = list; crptMemList.DataBind(); list = null; } else { crptMemList.EmptyText = "<div style=\"text-align:center; margin-top:75px; margin-bottom:75px;\">暂无备忘录信息</div>"; } hdfDateTime.Value = fromDate; } else { MessageBox.ResponseScript(this.Page, "MemorandumList.tabChange(\"/Memorandum/MemorandumCalendar.aspx\")"); return; } }
/// <summary> /// 显示专线区域控制的checkbox /// </summary> /// <param name="AreaId">专线区域id</param> /// <returns></returns> protected string ShowTourAreaCheckBox(string AreaId, string AreaName, string RouteType) { bool isSelected = false; //判断是否被选择过 string returnVal = ""; //判断该专线是否已经被该城市选择过 if (AreaIdList != null) { foreach (string id in AreaIdList) { if (!string.IsNullOrEmpty(id) && StringValidate.IsInteger(id) && int.Parse(AreaId) == int.Parse(id)) { isSelected = true; break; } } } if (!isSelected) { returnVal = string.Format("<input type=\"checkbox\" id=\"TourAreaID_{0}\" name=\"cbkName_{2}\" value=\"{0}|{1}\">", AreaId, AreaName, RouteType); } else { returnVal = string.Format("<input type=\"checkbox\" id=\"TourAreaID_{0}\" name=\"cbkName_{2}\" value=\"{0}|{1}\" checked=true >", AreaId, AreaName, RouteType); } return(returnVal); }
/// <summary> /// 页面功能:ajax调用删除线路 /// 修改时间:2010-08-14 修改人:袁惠 /// </summary> protected void Page_Load(object sender, EventArgs e) { if (HttpContext.Current.Request.QueryString["RoleDelete"].ToLower() == "true") { bool result = false; string ids = Utils.GetString(HttpContext.Current.Request.QueryString["RouteIdList"], ""); if (ids.Length > 0) { string[] idlist = StringValidate.Split(ids, ","); if (idlist.Length > 0) { for (int i = 0; i < idlist.Length; i++) { result = EyouSoft.BLL.NewTourStructure.BRoute.CreateInstance().DeleteSiteRoute(idlist[i]); } } } if (result) { HttpContext.Current.Response.Write("1"); } else { HttpContext.Current.Response.Write("0"); } } else { HttpContext.Current.Response.Write("2"); } HttpContext.Current.Response.End(); }
/// <summary> /// 128位MD5算法加密字符串 /// </summary> /// <param name="text">要加密的字符串</param> public static string MD5Encrypt2(string text) { //如果字符串为空,则返回 if (StringValidate.IsNullOrEmpty <string>(text)) { return(""); } //返回MD5值的字符串表示 byte[] objHashCode = Encoding.UTF8.GetBytes(text); try { //创建MD5密码服务提供程序 MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider(); //计算传入的字节数组的哈希值 byte[] result = md5.ComputeHash(objHashCode); //释放资源 md5.Clear(); //返回MD5值的字符串表示 return(Convert.ToBase64String(result)); } catch { return(""); } }
//续费 private void AddMoneyOpear() { string startDate = Request.QueryString["StartDate"]; string endDate = Request.QueryString["EndDate"]; string applyId = Utils.InputText(Request.QueryString["ApplyId"]); if (!(StringValidate.IsDateTime(startDate) && StringValidate.IsDateTime(endDate))) { Utils.ResponseMeg(false, "到期时间格式错误"); return; } if (Convert.ToDateTime(startDate) > Convert.ToDateTime(endDate)) { Utils.ResponseMeg(false, "续费时间不对"); return; } int result = EyouSoft.BLL.SystemStructure.SysApplyService.CreateInstance().EshopRenewed(applyId, Convert.ToDateTime(startDate), Convert.ToDateTime(endDate), this.MasterUserInfo.ID, DateTime.Now); if (result == 1) { Utils.ResponseMeg(true, "操作成功"); } else if (result == 2) { Utils.ResponseMeg(false, "续费时间不对"); } else { Utils.ResponseMeg(false, "操作失败"); } }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { if(string.IsNullOrEmpty(txtCompanyBrand.Value.Trim())) { MessageBox.ResponseScript(this.Page,"alert('请填写品牌名称!');"); return; } if (string.IsNullOrEmpty(txtContactName.Value.Trim())) { MessageBox.ResponseScript(this.Page, "alert('请填写联系人!');"); return; } if (!string.IsNullOrEmpty(txtContactMobile.Value.Trim()) && !Utils.IsMobile(txtContactMobile.Value.Trim())) { MessageBox.ResponseScript(this.Page, "alert('手机号码填写错误!');"); return; } EyouSoft.Model.CompanyStructure.CompanyArchiveInfo info = new EyouSoft.Model.CompanyStructure.CompanyArchiveInfo(); info.CompanyAddress = Utils.InputText(txtOfficeAddress.Value); info.ContactInfo.Tel = StringValidate.SafeRequest(txtContactTel.Value); info.ContactInfo.ContactName = Utils.InputText(txtContactName.Value); info.ContactInfo.Fax = Utils.InputText(txtContactFax.Value); info.ContactInfo.Mobile = Utils.InputText(txtContactMobile.Value); info.CompanyBrand = Utils.InputText(this.txtCompanyBrand.Value); info.ContactInfo.MQ = Utils.InputText(this.txtMQ.Value); info.ID = CompanyId; if (EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().UpdateArchive(info)) { MessageBox.ResponseScript(this.Page, "alert(\"操作成功!\");parent.Boxy.getIframeDialog('" + Request.QueryString["iframeId"] + "').hide(function(){window.parent.location.reload();});"); } else { MessageBox.ShowAndRedirect(this.Page, "操作失败",Request.Url.ToString()); } }
private void BindData() { int intRecordCount = 0; string fromDate = Request.QueryString["FromDate"]; CurrentPage = Utils.GetInt(Request.QueryString["Page"], 1); if (StringValidate.IsDateTime(fromDate)) { IList <EyouSoft.Model.ToolStructure.CompanyDayMemo> list = EyouSoft.BLL.ToolStructure.CompanyDayMemo.CreateInstance().GetList(this.SiteUserInfo.CompanyID, Convert.ToDateTime(fromDate)); if (list != null && list.Count > 0) { crptMemList.DataSource = list; crptMemList.DataBind(); this.ExportPageInfo1.intPageSize = PageSize; this.ExportPageInfo1.CurrencyPage = CurrentPage; this.ExportPageInfo1.intRecordCount = intRecordCount; this.ExportPageInfo1.PageLinkURL = Request.ServerVariables["SCRIPT_NAME"].ToString() + "?"; list = null; } else { ExportPageInfo1.Visible = false; crptMemList.EmptyText = "<div style=\"text-align:center; margin-top:75px; margin-bottom:75px;\">暂无备忘录信息</div>"; } } else { //页面跳转到备忘录首页 } }
private void BindInfo() { //获取类型编号 int StatusId = Utils.GetInt(Request.QueryString["StatusId"], 0); if (Utils.InputText(Request.QueryString["StatusId"]) != null) { SendStatus.Value = Utils.InputText(Request.QueryString["StatusId"]); } //获取查询的关键字 string keyword = Server.UrlDecode(Utils.InputText(Request.QueryString["keyword"])); if (!String.IsNullOrEmpty(keyword)) { txtKey.Value = keyword; } //开始时间 DateTime?startTime = Utils.GetDateTimeNullable(Request.QueryString["leavDate"]); //结束时间 DateTime?EndTime = Utils.GetDateTimeNullable(Request.QueryString["returnDate"]); if (startTime.HasValue) { ShowBeginDate = startTime.Value.ToShortDateString(); } if (EndTime.HasValue) { ShowEndDate = EndTime.Value.ToShortDateString(); } //根据关键字查询短信息历史信息 CurrencyPage = Utils.GetInt(Request.QueryString["Page"], 1); if (CurrencyPage < 1) { CurrencyPage = 1; } IList <EyouSoft.Model.SMSStructure.SendDetailInfo> GetListInfoByKey = EyouSoft.BLL.SMSStructure.SendMessage.CreateInstance().GetSendHistorys(intPageSize, CurrencyPage, ref intRecordCount, companyid, keyword, StatusId, startTime, EndTime); if (GetListInfoByKey != null && GetListInfoByKey.Count > 0) { //绑定短语信息 ReListMoblie.DataSource = GetListInfoByKey; ReListMoblie.DataBind(); //绑定分页控件 this.ExportPageInfo1.intPageSize = intPageSize; this.ExportPageInfo1.CurrencyPage = CurrencyPage; this.ExportPageInfo1.intRecordCount = intRecordCount; this.ExportPageInfo1.CurrencyPageCssClass = "RedFnt"; string [] param = { "urlType", "t", "page" }; string linkUrl = StringValidate.BuildUrlString(Request.QueryString, param); this.ExportPageInfo1.PageLinkURL = Request.ServerVariables["SCRIPT_NAME"].ToString() + "?" + linkUrl + "&"; } else { this.NoData.Visible = true; this.div_Expage.Visible = false; } GetListInfoByKey = null; }
public void EditarJugador(List <Seleccion> selecciones) { string nombre; try { if (MostrarSelecciones(selecciones) > 0) { Console.WriteLine("Ingrese el nombre de la selección: "); string nombreSelec = Console.ReadLine(); Seleccion s = selecciones.First(p => nombreSelec == p.Nombre); MostrarJugadores(s); bool validate; Console.Write("Ingrese el nombre del jugador: "); nombre = Console.ReadLine(); validate = StringValidate.ValidateField(nombre); if (validate) { Jugador j = s.Jugadores.First(j => j.Nombre == nombre); string value; List <string> atributos = new List <string>(); atributos.Add(j.Nombre); Console.Write("Edad:"); value = Console.ReadLine(); atributos.Add(value); validate = validate && IntValidate.ValidateField(value); Console.Write("Posición:"); value = Console.ReadLine(); atributos.Add(value); validate = validate && IntValidate.ValidateField(value); Console.Write("Ataque:"); value = Console.ReadLine(); atributos.Add(value); validate = validate && DoubleValidate.ValidateField(value); Console.Write("Defensa:"); value = Console.ReadLine(); atributos.Add(value); validate = validate && DoubleValidate.ValidateField(value); if (validate) { CrearJugador(j, atributos); JsonHandler.Save(s); } else { Console.WriteLine("Se ingresaron datos invalidos"); } } } else { Console.WriteLine("No hay selecciones"); } } catch (InvalidOperationException) { Console.WriteLine("No existe ese jugador u selección"); } }
public static decimal?GetDecimal(string key, decimal?defaultValue) { if (string.IsNullOrEmpty(key) || !StringValidate.IsDecimalSign(key)) { return(defaultValue); } return(Decimal.Parse(key)); }
protected void Page_Load(object sender, EventArgs e) { CompanyId = Request.QueryString["cid"]; TabIndex = Request.QueryString["st"]; type = (SeniorOnlineShop.master.SPOTT1TAB)Enum.Parse(typeof(SeniorOnlineShop.master.SPOTT1TAB), TabIndex); StrTitle = EyouSoft.Common.Utils.GetQueryStringValue("title").Trim(); CurrencyPage = StringValidate.GetIntValue(Request.QueryString["Page"], 1); InitPage(); }
/// <summary> /// 初始化 /// </summary> private void InitPage() { CompanyId = ((SeniorOnlineShop.master.ScenicSpotsT1)base.Master).CompanyId; CurrencyPage = StringValidate.GetIntValue(Request.QueryString["Page"], 1); var qmodel = new EyouSoft.Model.ScenicStructure.MScenicImgSearch { ImgType = new EyouSoft.Model.ScenicStructure.ScenicImgType?[] { EyouSoft.Model.ScenicStructure.ScenicImgType.景区形象, EyouSoft.Model.ScenicStructure.ScenicImgType.其他 } }; IList <EyouSoft.Model.ScenicStructure.MScenicImg> list = EyouSoft.BLL.ScenicStructure.BScenicImg.CreateInstance().GetList(intPageSize, CurrencyPage, ref intRecordCount, CompanyId, qmodel); if (list != null && list.Count > 0) { //加上文件系统URL前缀 ((List <EyouSoft.Model.ScenicStructure.MScenicImg>)list).ForEach(item => { item.Address = EyouSoft.Common.Domain.FileSystem + item.Address; item.ThumbAddress = EyouSoft.Common.Domain.FileSystem + item.ThumbAddress; }); this.rptData.DataSource = list; this.rptData.DataBind(); //绑定分页控件 this.ExporPageInfoSelect1.intPageSize = intPageSize; this.ExporPageInfoSelect1.intRecordCount = intRecordCount; this.ExporPageInfoSelect1.CurrencyPage = CurrencyPage; this.ExporPageInfoSelect1.CurrencyPageCssClass = "RedFnt"; //this.ExporPageInfoSelect1.UrlParams = Request.QueryString; //this.ExporPageInfoSelect1.PageLinkURL = "/scenicspots/t1/ScenicBeauties.aspx?"; this.ExporPageInfoSelect1.LinkType = 3; if (EyouSoft.Common.URLREWRITE.UrlReWriteUtils.IsReWriteUrl(Request)) { //是否重写 分页的链接 this.ExporPageInfoSelect1.IsUrlRewrite = true; //设置需要替换的值 this.ExporPageInfoSelect1.Placeholder = "#PageIndex#"; //获得线路的url 赋值给分页控件 this.ExporPageInfoSelect1.PageLinkURL = EyouSoft.Common.URLREWRITE.UrlReWriteUtils.GetUrlForPage(Request) + "_#PageIndex#"; } else { this.ExporPageInfoSelect1.PageLinkURL = Request.ServerVariables["SCRIPT_NAME"].ToString() + "?"; this.ExporPageInfoSelect1.UrlParams = Request.QueryString; } } else { NoData.Visible = true; } list = null; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { lblTitle.Text = string.IsNullOrEmpty(SetTitle) == true ? "时间段" : SetTitle; dpkStart.Value = StringValidate.IsDateTime(SetStartDate) == false ? "" : SetStartDate; dpkEnd.Value = StringValidate.IsDateTime(SetEndDate) == false ? "" : SetEndDate; } }
/// <summary> /// 获取MQ链接 /// </summary> /// <param name="OperatorMQ">MQ编号</param> /// <returns></returns> protected string GetMQUrl(string OperatorMQ) { if (string.IsNullOrEmpty(OperatorMQ) || StringValidate.IsInteger(OperatorMQ.Trim()) == false || Convert.ToInt32(OperatorMQ.Trim()) <= 0) { return(string.Empty); } return(Utils.GetMQ(OperatorMQ)); }
public static DateTime GetDateTime(string key, DateTime defaultValue) { DateTime result = defaultValue; if (StringValidate.IsDateTime(key)) { DateTime.TryParse(key, out result); } return(result); }
protected void Page_Load(object sender, EventArgs e) { #region 页面初始化控件赋值 this.UCRightList1.IsSearch = true; this.UCRightList1.IsToolbar = true; this.UCRightList1.CityID = CityId; this.UCRightList1.IsPinpai = false; this.CityAndMenu1.HeadMenuIndex = 2; #endregion RouteId = Utils.GetQueryStringValue("RouteID"); if (!IsPostBack) { if (RouteId != "") { GetTourInfo(); } else { _intRouteId = StringValidate.IsDecimal(Utils.GetQueryStringValue("intRouteId")) ? long.Parse(Utils.GetQueryStringValue("intRouteId")) : 0; if (_intRouteId > 0) { GetTourInfo(); } else { Utils.ShowError("暂无线路信息!", "Tour"); return; } } if (IsLogin) { if (this.SiteUserInfo != null && !string.IsNullOrEmpty(this.SiteUserInfo.CompanyID)) { EyouSoft.Model.CompanyStructure.CompanyDetailInfo Userinfo = new EyouSoft.BLL.CompanyStructure.CompanyInfo().GetModel(this.SiteUserInfo.CompanyID); if (Userinfo != null && Userinfo.CompanyRole != null) { if (Userinfo.CompanyRole.HasRole(EyouSoft.Model.CompanyStructure.CompanyType.组团)) { this.txtContactName.Text = Userinfo.ContactInfo.ContactName; this.txtContactTel.Text = Userinfo.ContactInfo.Tel; IsTour = true; } if (Userinfo.CompanyRole.HasRole(EyouSoft.Model.CompanyStructure.CompanyType.专线)) { IsRoute = true; } } } } } }
//申请开通高级网店 protected void AddEShop() { if (!IsCompanyCheck) { Response.Clear(); return; } int result = 0; string ContactName = Utils.InputText(Server.HtmlDecode(Request.QueryString["p"])); string Tel = Utils.InputText(Server.HtmlDecode(Request.QueryString["t"])); string Mobile = Utils.InputText(Server.HtmlDecode(Request.QueryString["m"])); string Net = Utils.InputText(Request.QueryString["n"]); string CompanyName = Utils.InputText(Server.HtmlDecode(Request.QueryString["c"])); if (ContactName.Length > 0 && Tel.Length > 0 && Mobile.Length > 0 && Net.Length > 0 && CompanyName.Length > 0) { if (Utils.IsMobile(Mobile) && Utils.IsPhone(Tel) && StringValidate.IsUrl(Net) && CompanyName == this.SiteUserInfo.CompanyName) { EyouSoft.Model.SystemStructure.SysApplyServiceInfo model = new EyouSoft.Model.SystemStructure.SysApplyServiceInfo(); model.ContactMobile = Mobile; model.ContactMQ = this.SiteUserInfo.ContactInfo.MQ; model.ContactName = ContactName; model.ContactQQ = this.SiteUserInfo.ContactInfo.QQ; model.ContactTel = Tel; model.ApplyTime = DateTime.Now; model.UserId = this.SiteUserInfo.ID; model.CityId = this.SiteUserInfo.CityId; model.CityName = EyouSoft.BLL.SystemStructure.SysCity.CreateInstance().GetSysCityModel(this.SiteUserInfo.CityId).CityName; model.CompanyId = this.SiteUserInfo.CompanyID; model.CompanyName = this.SiteUserInfo.CompanyName; model.ProvinceId = this.SiteUserInfo.ProvinceId; model.ProvinceName = EyouSoft.BLL.SystemStructure.SysProvince.CreateInstance().GetProvinceModel(this.SiteUserInfo.ProvinceId).ProvinceName; model.ApplyServiceType = EyouSoft.Model.CompanyStructure.SysService.HighShop; model.ApplyText = Net; if (EyouSoft.BLL.SystemStructure.SysApplyService.CreateInstance().Apply(model)) { result = 1; } model = null; } else { result = 4; //数据输入错误 } } else { result = 3; //数据填写不完整 } Response.Write(result.ToString()); Response.End(); return; }
/// <summary> /// 绑定列表 /// </summary> /// <param name="IsOneLoad">判断是否为初次加载</param> private void InitList(bool IsOneLoad) { int recordCount = 0; string CompanyId = ""; string CompanyName = null; DateTime?StartDate = null; DateTime?EndDate = null; pageIndex = Utils.GetInt(Request.QueryString["Page"]); if (pageIndex <= 0) { pageIndex = 1; } CompanyId = Utils.InputText(Request.QueryString["CompanyId"]); string date1 = Request.QueryString["BeginTime"]; string date2 = Request.QueryString["EndTime"]; CompanyName = Utils.InputText(Server.HtmlDecode(Request.QueryString["CompanyName"])); if (StringValidate.IsDateTime(date1)) { StartDate = Convert.ToDateTime(date1); } if (StringValidate.IsDateTime(date2)) { EndDate = Convert.ToDateTime(date2); } StartAndEndDate1.SetStartDate = date1; StartAndEndDate1.SetEndDate = date2; txtcompanyName.Value = CompanyName; hidCompanyId.Value = CompanyId; IList <EyouSoft.Model.TourStructure.TourVisitInfo> list = EyouSoft.BLL.TourStructure.Tour.CreateInstance().GetVisitedHistorysByCompany(pageSize, pageIndex, ref recordCount, CompanyId, CompanyName, StartDate, EndDate); if (list.Count > 0 && list != null) { this.ExportPageInfo1.intPageSize = pageSize; this.ExportPageInfo1.CurrencyPage = pageIndex; this.ExportPageInfo1.intRecordCount = recordCount; this.ExportPageInfo1.LinkType = 3; this.ExportPageInfo1.UrlParams = Request.QueryString; this.ExportPageInfo1.PageLinkURL = "VisitLocaList.aspx?"; crptinfoList.DataSource = list; crptinfoList.DataBind(); list = null; } else { crptinfoList.EmptyText = "<tr><td colspan=\"4\" align=\"center\"><div style=\"text-align:center; margin-top:75px; margin-bottom:75px;\">暂无数据!</span></div></td></tr>"; ExportPageInfo1.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { divApplSuss.Visible = false; if (StringValidate.SafeRequest(Request.QueryString["AddEShop"]) == "1") { AddEShop(); } InitCompanyInfo(); this.AddJavaScriptInclude(JsManage.GetJsFilePath("validatorform"), true, false); } }
/// <summary> /// 检测上传参数中是否有非法SQL字符(get、post) /// </summary> /// <returns></returns> public static bool ValidatorURL() { NameValueCollection nameOfVal = GetRequestParameters(HttpContext.Current.Request, ""); foreach (string item in nameOfVal.AllKeys) { if (!StringValidate.CheckSQLWord(nameOfVal[item])) { return(false); } } return(true); }
protected void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(setreso_txttitle.Value.Trim()) && setreso_txttitle.Value.Trim().Length > 30) { MessageBox.ResponseScript(this.Page, "alert('标题不能为空并且不能大于30个字符!');"); return; } if (string.IsNullOrEmpty(editreso.Value.Trim())) { MessageBox.ResponseScript(this.Page, "alert('内容不能为空!');"); return; } EyouSoft.Model.ShopStructure.HighShopResource reso = new EyouSoft.Model.ShopStructure.HighShopResource(); reso.Title = StringValidate.SafeRequest(setreso_txttitle.Value); reso.ContentText = Utils.EditInputText(editreso.Value); reso.OperatorID = this.SiteUserInfo.ID; reso.CompanyID = this.SiteUserInfo.CompanyID; string imgpath = Utils.GetFormValue("sfuResoImg$hidFileName"); if (imgpath.Length > 0) { reso.ImagePath = imgpath; } else { reso.ImagePath = Utils.GetFormValue(hdfAgoImgPath.UniqueID); } bool result = false; if (!string.IsNullOrEmpty(Request.QueryString["Reso_Id"])) { reso.ID = Request.QueryString["Reso_Id"]; result = EyouSoft.BLL.ShopStructure.HighShopResource.CreateInstance().Update(reso); } else { reso.IssueTime = DateTime.Now; result = EyouSoft.BLL.ShopStructure.HighShopResource.CreateInstance().Add(reso); } if (result) { MessageBox.ShowAndRedirect(this.Page, "操作成功", "SetResourcesList.aspx"); } else { MessageBox.ShowAndRedirect(this.Page, "操作失败", Request.Url.ToString()); } reso = null; }
public override string ToString() { string result = ""; result += m_cSymbol; if (m_listParams.Count == 0) { return(result); } result += "("; if (m_cSymbol.Equals("%")) //存在Mesh名替换的情况 { for (int i = 0; i < m_listParams.Count; i++) { //判断是否为数字,如果为数字则判断时候需要替换 string MeshName = StringValidate.IsNumeric(m_listParams[i]) ? MeshResource.GetInstance().GetNameOf(Convert.ToInt32(m_listParams[i])) : m_listParams[i]; if (i != 0) { result += ","; } if (MeshName != null) { result += MeshName; } else { result += m_listParams[i]; } } } else { for (int i = 0; i < m_listParams.Count; i++) { if (i != 0) { result += ","; } result += m_listParams[i]; } } result += ")"; return(result); }
protected void ibtnSave_Click(object sender, EventArgs e) { if (!IsLogin) { MessageBox.ShowAndReturnBack(this, "请先登录!", 1); return; } string strInfo = Utils.InputText(txtCommentInfo.Value.Trim()); string strTopicId = id; string strCommentId = Utils.GetFormValue("hidCommentId"); if (string.IsNullOrEmpty(strInfo)) { MessageBox.ShowAndReturnBack(this, "回复内容不能为空!", 1); return; } if (strInfo.Length > 500) { MessageBox.ShowAndReturnBack(this, "回复内容应限制在500个字符以内!", 1); return; } EyouSoft.Model.CommunityStructure.ExchangeComment model = new EyouSoft.Model.CommunityStructure.ExchangeComment(); model.CommentId = strCommentId; model.CommentIP = StringValidate.GetRemoteIP(); model.CommentText = strInfo; model.CompanyId = SiteUserInfo.CompanyID; model.CompanyName = SiteUserInfo.CompanyName; model.IsAnonymous = false; model.IsCheck = false; model.IsDeleted = false; model.IsHasNextLevel = false; model.IssueTime = DateTime.Now; model.OperatorId = SiteUserInfo.ID; model.OperatorMQ = SiteUserInfo.ContactInfo == null ? "0" : SiteUserInfo.ContactInfo.MQ; model.OperatorName = SiteUserInfo.ContactInfo == null ? string.Empty : SiteUserInfo.ContactInfo.ContactName; model.TopicId = strTopicId; model.TopicType = EyouSoft.Model.CommunityStructure.TopicType.供求; if (EyouSoft.BLL.CommunityStructure.ExchangeComment.CreateInstance().AddExchangeComment(model) == 1) { MessageBox.ShowAndRedirect(this, "提交评论成功!", Request.RawUrl); return; } else { MessageBox.ShowAndRedirect(this, "提交评论失败!", Request.RawUrl); return; } }
/// <summary> /// 命令行事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void RepeaterList_ItemCommand(object sender, RepeaterCommandEventArgs e) { if (string.IsNullOrEmpty(e.CommandName) || string.IsNullOrEmpty(e.CommandArgument.ToString())) { return; } if (!CheckMasterGrant(YuYingPermission.宾访谈_管理该栏目, YuYingPermission.宾访谈_顾问团队审核)) { MessageBox.Show(this.Page, "对不起,你没有该权限"); return; } switch (e.CommandName.ToLower()) { case "show": string[] strTmp = e.CommandArgument.ToString().Trim().Split(','); bool IsShow = false; if (strTmp == null || strTmp.Length != 2 || string.IsNullOrEmpty(strTmp[0]) || StringValidate.IsInteger(strTmp[0]) == false) { break; } if (strTmp[1].ToLower() == "true" || strTmp[1].ToLower() == "1") { IsShow = true; } if (EyouSoft.BLL.CommunityStructure.CommunityAdvisor.CreateInstance().SetIsShow(IsShow ? false : true, MasterUserInfo.ID, int.Parse(strTmp[0]))) { MessageBox.ShowAndRedirect(this, "操作成功!", Request.RawUrl); } else { MessageBox.ShowAndRedirect(this, "操作失败!", Request.RawUrl); } break; case "del": if (StringValidate.IsInteger(e.CommandArgument.ToString()) == false) { break; } if (EyouSoft.BLL.CommunityStructure.CommunityAdvisor.CreateInstance().DeleteCommunityAdvisor(int.Parse(e.CommandArgument.ToString()))) { MessageBox.ShowAndRedirect(this, "删除成功!", Request.RawUrl); } else { MessageBox.ShowAndRedirect(this, "删除失败!", Request.RawUrl); } break; } }
/// <summary> /// 删除事件 /// </summary> private void DelProcess(string DelID) { string strErr = ""; if (StringValidate.IsInteger(DelID) == false) { strErr += "未找到您要删除的线路区域"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } deletFlag = EyouSoft.BLL.SystemStructure.SysArea.CreateInstance().DeleteSysArea(int.Parse(DelID)); return; }
/// <summary> /// 修改友情链接 /// </summary> private void UpdateFriendLink() { string LinkAddress = Utils.InputText(Request.QueryString["LinkAddress"]); LinkAddress = LinkAddress.ToLower().Contains("http://") ? LinkAddress : "http://" + LinkAddress; string LinkName = Server.HtmlDecode(Utils.InputText(Request.QueryString["LinkName"])); string errorMsg = string.Empty; if (string.IsNullOrEmpty(LinkName)) { errorMsg = "链接名称为空或输入错误!"; } if (string.IsNullOrEmpty(LinkAddress)) { errorMsg = errorMsg == "" ? "链接地址不能为空!" : errorMsg + ",链接地址不能为空!"; } else { if (!StringValidate.IsUrl(LinkAddress)) { errorMsg = errorMsg == "" ? "链接地址输入错误!" : errorMsg + ",链接地址输入错误!"; } } if (errorMsg == "") { EyouSoft.Model.ShopStructure.HighShopFriendLink link = new EyouSoft.Model.ShopStructure.HighShopFriendLink(); link.ID = StringValidate.SafeRequest(Request.QueryString["FriendLinkId"]); link.CompanyID = CompanyId; link.LinkAddress = LinkAddress; link.OperatorID = this.SiteUserInfo.ID; link.LinkName = StringValidate.SafeRequest(LinkName); link.SortID = Utils.GetInt(Request.QueryString["SortId"], 0); if (EyouSoft.BLL.ShopStructure.HighShopFriendLink.CreateInstance().Update(link)) { link = null; Response.Clear(); Response.Write("1"); Response.End(); } } else { Response.Clear(); Response.Write("{errorMsg:\"" + errorMsg + "\"}"); Response.End(); } }
/// <summary> /// 根据省份ID获取省份名称 /// </summary> /// <param name="ProvinceId">省份ID</param> /// <returns></returns> protected string GetProvinceNameById(string ProvinceId) { if (string.IsNullOrEmpty(ProvinceId) || StringValidate.IsInteger(ProvinceId.Trim()) == false || Convert.ToInt32(ProvinceId.Trim()) <= 0) { return(string.Empty); } ProvinceModel = EyouSoft.BLL.SystemStructure.SysProvince.CreateInstance().GetProvinceModel(int.Parse(ProvinceId)); if (ProvinceModel != null) { return(string.Format("【{0}】", ProvinceModel.ProvinceName)); } else { return(string.Empty); } }
/// <summary> /// 删除事件 /// </summary> private void DelProcess(string DelID) { string strErr = ""; if (StringValidate.IsInteger(DelID) == false) { strErr += "未找到您要删除的客户等级"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int[] SetId = { int.Parse(DelID) }; EyouSoft.BLL.SystemStructure.SysField.CreateInstance().Delete(SetId, EyouSoft.Model.SystemStructure.SysFieldType.客户等级); return; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { InitExchangeList(); string ClientIP = StringValidate.GetRemoteIP(); if (!string.IsNullOrEmpty(ClientIP)) { EyouSoft.Model.SystemStructure.CityBase model = EyouSoft.BLL.SystemStructure.SysCity.CreateInstance().GetClientCityByIp(ClientIP); if (model != null) { CityId = model.CityId; } model = null; } } }