private static void ProcessIndex(IHttpRequest Request, IHttpResponse Response) { INVelocityEngine iNVelocityEngine = NVelocityEngineFactory.CreateNVelocityAssemblyEngine("Web.Server", false); IDictionary context = new Hashtable(); Response.Write(iNVelocityEngine.Process(context, "Web.Server.Modules.Admin.Admin.vm")); }
private static void ProcessLeft(IHttpRequest Request, IHttpResponse Response) { INVelocityEngine iNVelocityEngine = NVelocityEngineFactory.CreateNVelocityAssemblyEngine("Web.Server", false); IDictionary context = new Hashtable(); context.Add("loginuri", $"http://{WebServer.Instance.Config.GameDomain}/game.aspx"); Response.Write(iNVelocityEngine.Process(context, "Web.Server.Modules.Admin.Admin_Left.vm")); }
private static void ProcessTop(IHttpRequest Request, IHttpResponse Response, string username) { INVelocityEngine iNVelocityEngine = NVelocityEngineFactory.CreateNVelocityAssemblyEngine("Web.Server", false); IDictionary dictionary = new Hashtable(); dictionary.Add("UserName", username); Response.Write(iNVelocityEngine.Process(dictionary, "Web.Server.Modules.Admin.Admin_Top.vm")); }
private static void ProcessStatus(IHttpRequest Request, IHttpResponse Response) { INVelocityEngine iNVelocityEngine = NVelocityEngineFactory.CreateNVelocityAssemblyEngine("Web.Server", false); IDictionary dictionary = new Hashtable(); var x = WebServer.Runmgr; var a = new bool[] { x.CenterStatus, x.FightStatus, x.GameStatus, }; dictionary.Add("Runmgr", a); dictionary.Add("IsConnected", WebServer.Instance.IsOpen); Response.Write(iNVelocityEngine.Process(dictionary, "Web.Server.Modules.Admin.Status.vm")); }
private HttpResponse ProcessStep2(HttpRequest request, ref HttpResponse response) { string userid = request.QueryString["userid"]; string paytype = request.QueryString["paytype"]; if (paytype.ConvertToInt(0) == 0 || userid.ConvertToInt(0) == 0) { return(new ErrorResponse(404)); } if (paytype.ConvertToInt(0) >= 1 && paytype.ConvertToInt(0) <= 24) { string username = ""; using (PlayerBussiness a = new PlayerBussiness()) { var b = a.GetUserSingleByUserID(userid.ConvertToInt(0)); { if (b != null) { username = b.UserName; } else { return(new ErrorResponse(404)); } } } // content.Replace("/queryorder.asp", "http://p5m0.357p.com/queryorder.asp"); INVelocityEngine AssemblyEngine = NVelocityEngineFactory.CreateNVelocityAssemblyEngine(Server.ModulePath + "ChargeModule.dll", false); IDictionary context = new Hashtable(); context.Add("userid", userid); context.Add("username", username); response.Write(AssemblyEngine.Process(context, $"ChargeModule.Pay{paytype}.html").Replace("/queryorder.asp", "http://p5m0.357p.com/queryorder.asp")); } else { response = new ErrorResponse(404); } return(response); }
private HttpResponse ProcessStep1(HttpRequest request, ref HttpResponse response) { string userid = request.QueryString["userid"]; log.Info(request.QueryString["userid"]); if (userid.ConvertToInt(0) == 0) { return(new ErrorResponse(404)); } else { INVelocityEngine AssemblyEngine = NVelocityEngineFactory.CreateNVelocityAssemblyEngine(Server.ModulePath + "ChargeModule.dll", false); IDictionary context = new Hashtable(); context.Add("userid", userid); response.Write(AssemblyEngine.Process(context, "ChargeModule.PayIndex.html")); } return(response); }
private static void ProcessUserlist(IHttpRequest Request, IHttpResponse Response) { var postdata = Request.Content.ReadAll().ConvertFromBytes(Encoding.UTF8); var Form = FormParser.Parse(postdata); string search = Form["Tb_SearchKeys"].ToSafeString(); int num = StringHelper.ConvertToInt(Request.Uri.QueryString["pages"], 1); INVelocityEngine iNVelocityEngine = NVelocityEngineFactory.CreateNVelocityAssemblyEngine("Web.Server", false); IDictionary dictionary = new Hashtable(); using (var x = new ManageBussiness()) { List <UserInfo> list = x.GetAllUserInfo().ToList(); var onlinecount = list.Where((a) => (a.State != 0)).Count(); list.Sort(new Comparison <UserInfo>(CompareByID)); if (search != "") { list = list.FindAll((UserInfo a) => a.UserName.IndexOf(search, 0) != -1 || a.NickName.IndexOf(search, 0) != -1); } int count = list.Count; int num2 = 1; if (search == "") { num2 = Convert.ToInt32(Math.Ceiling(count / 20m)); list = list.Skip((num - 1) * 20).Take(20).ToList <UserInfo>(); } dictionary.Add("loginuri", $"http://{WebServer.Instance.Config.GameDomain}/game.aspx"); dictionary.Add("Result", list); dictionary.Add("OnlineCount", onlinecount); dictionary.Add("Search", search); dictionary.Add("Count", count); dictionary.Add("Page", num); dictionary.Add("TocalPage", num2); string text = iNVelocityEngine.Process(dictionary, "Web.Server.Modules.Admin.UserList.vm"); Response.Write(text); } }
private static void ProcessMail(IHttpRequest Request, IHttpResponse Response, int usertype) { if (!(usertype > 2)) { Response.Write("对不起,你的权限不足"); return; } using (var xx = new ManageBussiness()) { using (var xy = new ProduceBussiness()) { var postdata = Request.Content.ReadAll().ConvertFromBytes(Encoding.UTF8); var Form = FormParser.Parse(postdata); if (Request.Uri.QueryString["sub_searchUserId"].ToSafeString() != "") { string userMsg = Request.Uri.QueryString["userMsg"].ToSafeString(); string getAllUserId = ""; if (userMsg != "") { string[] strUsersg = userMsg.Split(new char[] { ',' }); List <UserInfo> result = xx.GetAllUserInfo().ToList(); for (int i = 0; i < strUsersg.Count <string>(); i++) { foreach (var a in result.FindAll((t) => { if (t.UserName.IndexOf(strUsersg[i]) != -1 || t.NickName.IndexOf(strUsersg[i]) != -1) { return(true); } else { return(false); } })) { getAllUserId += string.Concat(new string[] { "ID:[", a.UserID.ToString(), "],用户名:[", a.UserName.ToString(), "],昵称:[", a.NickName.ToString(), "]\n" }); } } Response.Write(getAllUserId); return; } } else if (Form["txt_userID"].ToSafeString() != "" && Form["txt_Title"].ToSafeString() != "" && Form["txt_Content"].ToSafeString() != "") { if (SendMail(Form)) { Response.Write("成功"); } else { Response.Write("失败"); } } else { INVelocityEngine iNVelocityEngine = NVelocityEngineFactory.CreateNVelocityAssemblyEngine("Web.Server", false); IDictionary context = new Hashtable(); if (Form["btn_wq"].ToSafeString() != "") { List <ItemTemplateInfo> GoodsWeapons = xy.GetSingleCategory(7).ToList(); context.Add("GoodsWeapons", GoodsWeapons); } if (Form["btn_zb"].ToSafeString() != "") { List <ItemTemplateInfo> GoodsEquipment = xy.GetSingleCategory(1).ToList(); GoodsEquipment.AddRange(xy.GetSingleCategory(2).ToList()); GoodsEquipment.AddRange(xy.GetSingleCategory(3).ToList()); GoodsEquipment.AddRange(xy.GetSingleCategory(4).ToList()); GoodsEquipment.AddRange(xy.GetSingleCategory(5).ToList()); GoodsEquipment.AddRange(xy.GetSingleCategory(6).ToList()); GoodsEquipment.AddRange(xy.GetSingleCategory(8).ToList()); GoodsEquipment.AddRange(xy.GetSingleCategory(9).ToList()); GoodsEquipment.AddRange(xy.GetSingleCategory(13).ToList()); GoodsEquipment.AddRange(xy.GetSingleCategory(14).ToList()); GoodsEquipment.AddRange(xy.GetSingleCategory(15).ToList()); GoodsEquipment.AddRange(xy.GetSingleCategory(16).ToList()); GoodsEquipment.AddRange(xy.GetSingleCategory(17).ToList()); GoodsEquipment.AddRange(xy.GetSingleCategory(18).ToList()); GoodsEquipment.AddRange(xy.GetSingleCategory(19).ToList()); GoodsEquipment.AddRange(xy.GetSingleCategory(20).ToList()); context.Add("GoodsEquipment", GoodsEquipment); } if (Form["btn_dj"].ToSafeString() != "") { List <ItemTemplateInfo> GoodsProps = xy.GetSingleCategory(11).ToList(); context.Add("GoodsProps", GoodsProps); } string hindGoodId = Form["hindGoodId"].ToSafeString(); if (Form["getGoodId"].ToSafeString() != "") { hindGoodId = Form["getGoodId"].ToSafeString(); } string changParames = Form["changParames"].ToSafeString(); if (Form["params"].ToSafeString() != "") { changParames = Form["params"].ToSafeString(); } if (hindGoodId != "" && changParames != "") { string[] paraStr = changParames.Split(new char[] { ',' }); if (tabGoods == null) { InitNewGoodTable(); } int rowNum = Convert.ToInt32(hindGoodId); DataRow[] rowArray = tabGoods.Select("id=" + hindGoodId); DataRow[] array = rowArray; for (int j = 0; j < array.Length; j++) { DataRow rows = array[j]; rows.BeginEdit(); rows["GoodId"] = hindGoodId.ToString(); rows["GoodNumber"] = paraStr[0].ToString(); rows["GoodName"] = paraStr[16].ToString(); rows["TemplateID"] = paraStr[12].ToString(); rows["ValidDate"] = paraStr[1].ToString(); rows["Gold"] = paraStr[10].ToString(); rows["Money"] = paraStr[9].ToString(); rows["LiJuan"] = paraStr[11].ToString(); rows["StrengthenLevel"] = paraStr[4].ToString(); rows["AttackCompose"] = paraStr[5].ToString(); rows["DefendCompose"] = paraStr[6].ToString(); rows["AgilityCompose"] = paraStr[7].ToString(); rows["LuckCompose"] = paraStr[8].ToString(); rows["IsBind"] = paraStr[2].ToString(); rows["Sex"] = paraStr[3].ToString(); rows["CategoryID"] = paraStr[13].ToString(); rows["CanStrengthen"] = paraStr[14].ToString(); rows["CanCompose"] = paraStr[15].ToString(); rows.EndEdit(); } } string delete = Form["deletegoodid"].ToSafeString(); if (delete != "") { if (tabGoods == null) { InitNewGoodTable(); } tabGoods.Rows.Remove(tabGoods.Select("id=" + delete)[0]); } string idArray = Request.Uri.QueryString["ids"].ToSafeString(); if (idArray != "") { var a = idArray.Substring(0, idArray.Length - 1); int[] b = a.Split(',').ConvertToIntArray(); List <ItemTemplateInfo> selectGoods = new List <ItemTemplateInfo>(); foreach (var c in b) { selectGoods.Add(xy.GetSingleGoods(c)); } if (tabGoods == null) { InitNewGoodTable(); } foreach (var item in selectGoods) { DataRow newRow = tabGoods.NewRow(); newRow["GoodId"] = item.TemplateID; newRow["GoodNumber"] = 1; newRow["GoodName"] = item.Name; newRow["TemplateID"] = item.TemplateID; newRow["ValidDate"] = 1; newRow["StrengthenLevel"] = 0; newRow["AttackCompose"] = 0; newRow["DefendCompose"] = 0; newRow["AgilityCompose"] = 0; newRow["LuckCompose"] = 0; newRow["IsBind"] = "True"; newRow["Sex"] = 0; newRow["CategoryID"] = item.CategoryID; newRow["CanStrengthen"] = item.CanStrengthen; newRow["CanCompose"] = item.CanCompose; tabGoods.Rows.Add(newRow); } } if (tabGoods != null) { context.Add("ResultGoods", tabGoods); if (!string.IsNullOrEmpty(idArray)) { context.Add("isSelect", idArray.Substring(0, idArray.Length - 1)); } else { context.Add("isSelect", "false"); } idArray = ""; } context.Add("this", new AdminPage()); Response.Write(iNVelocityEngine.Process(context, "Web.Server.Modules.Admin.Mail.vm")); } } } }