Exemple #1
0
 private static bool LoadProps(Dictionary <int, ItemTemplateInfo> allProp)
 {
     using (ProduceBussiness db = new ProduceBussiness())
     {
         ItemTemplateInfo[] list = db.GetSingleCategory(10);
         foreach (ItemTemplateInfo p in list)
         {
             allProp.Add(p.TemplateID, p);
         }
     }
     return(true);
 }
Exemple #2
0
 private static bool LoadProps(Dictionary <int, ItemTemplateInfo> allProp)
 {
     using (ProduceBussiness db = new ProduceBussiness())
     {
         ItemTemplateInfo[] list  = db.GetSingleCategory(10);
         ItemTemplateInfo[] array = list;
         for (int i = 0; i < array.Length; i++)
         {
             ItemTemplateInfo p = array[i];
             allProp.Add(p.TemplateID, p);
         }
     }
     return(true);
 }
 private static bool LoadProps(Dictionary <int, ItemTemplateInfo> allProp)
 {
     using (ProduceBussiness produceBussiness = new ProduceBussiness())
     {
         ItemTemplateInfo[] singleCategory = produceBussiness.GetSingleCategory(10);
         ItemTemplateInfo[] array          = singleCategory;
         for (int i = 0; i < array.Length; i++)
         {
             ItemTemplateInfo itemTemplateInfo = array[i];
             allProp.Add(itemTemplateInfo.TemplateID, itemTemplateInfo);
         }
     }
     return(true);
 }
Exemple #4
0
        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"));
                    }
                }
            }
        }