Exemplo n.º 1
0
        public void queryOrderRecords(object temp)
        {
            OrderRecordsReq req = (OrderRecordsReq)temp;

            string resp = BgWork.HttpPost(Host + QueryOrderRecordsURL, String.Format("begin_time={0}&end_time={1}&page=1&page_row=10",
                                                                                     this.dateTimePicker1.Text, this.dateTimePicker2.Text));
            JavaScriptObject jsonObj = JavaScriptConvert.DeserializeObject <JavaScriptObject>(resp);


            if (jsonObj.ContainsKey("code") && (Int64)jsonObj["code"] == 0 && jsonObj.ContainsKey("datas"))
            {
                JavaScriptArray jList = (JavaScriptArray)jsonObj["datas"];
                if (jList.Count == 0)
                {
                    MessageBox.Show("没有记录!");
                    return;
                }
                List <OrderRecord> orderRecords = new List <OrderRecord>();
                for (int i = 0; i < jList.Count; i++)
                {
                    JavaScriptObject item = (JavaScriptObject)jList[i];
                    OrderRecord      tt   = new OrderRecord {
                        order_id       = (string)item["order_id"], createtime = (string)item["createtime"],
                        total          = (string)item["total"], total_fact = (string)item["total_fact"], status = (string)item["status"], remark = (string)item["remark"],
                        create_user_id = (string)item["create_user_id"]
                    };
                    orderRecords.Add(tt);
                }
                req.form.BeginInvoke(new UpdateInvoke(updateSoldRecords), orderRecords);
            }
            else
            {
                MessageBox.Show("错误!", "查询失败!");
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// json 添加
 /// </summary>
 /// <param name="pKey"></param>
 /// <param name="pMsg"></param>
 public void AddMessage(string pKey, string pMsg)
 {
     if (jso.ContainsKey(pKey))
     {
         jso[pKey] = pMsg;
     }
     else
     {
         jso.Add(pKey, pMsg);
     }
 }
        private PriceInfo JsonToPriceInfo(JavaScriptObject jso)
        {
            PriceInfo info = new PriceInfo
            {
                Id           = (!jso.ContainsKey("ID") || (jso["ID"] == null)) ? "" : jso["ID"].ToString(),
                Name         = jso["名称"].ToString(),
                Type         = jso["价格类型"].ToString(),
                SetTime      = DateTime.Now,
                LaddersCount = Convert.ToInt32(jso["阶梯数量"].ToString()),
                LadderType   = (PriceInfo.LaddersType)Enum.Parse(typeof(PriceInfo.LaddersType), jso["阶梯类型"].ToString()),
                StartTime    = (!jso.ContainsKey("起始时间") || (jso["起始时间"] == null)) ? "" : jso["起始时间"].ToString(),
                EndTime      = (!jso.ContainsKey("结束时间") || (jso["结束时间"] == null)) ? "" : jso["结束时间"].ToString()
            };

            if (info.LaddersCount > 0)
            {
                info.FirstPrice  = Convert.ToDecimal(jso["一阶价格"].ToString());
                info.FirstVolume = Convert.ToDecimal(jso["一阶水量"].ToString());
            }
            if (info.LaddersCount > 1)
            {
                info.SecondPrice  = Convert.ToDecimal(jso["二阶价格"].ToString());
                info.SecondVolume = Convert.ToDecimal(jso["二阶水量"].ToString());
            }
            if (info.LaddersCount > 2)
            {
                info.ThirdPrice  = Convert.ToDecimal(jso["三阶价格"].ToString());
                info.ThirdVolume = Convert.ToDecimal(jso["三阶水量"].ToString());
            }
            if (info.LaddersCount > 3)
            {
                info.FourthPrice  = Convert.ToDecimal(jso["四阶价格"].ToString());
                info.FourthVolume = Convert.ToDecimal(jso["四阶水量"].ToString());
            }
            return(info);
        }
Exemplo n.º 4
0
		/// <summary>
		/// Converts an XML document to an IJavaScriptObject (JSON).
		/// <see cref="http://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html?page=1">Stefan Goessner</see>
		/// 	<see cref="http://developer.yahoo.com/common/json.html#xml">Yahoo XML JSON</see>
		/// </summary>
		/// <param name="n">The XmlNode to serialize to JSON.</param>
		/// <returns>A IJavaScriptObject.</returns>
		public static IJavaScriptObject GetIJavaScriptObjectFromXmlNode(XmlNode n)
		{
			if (n == null)
				return null;

			//if (xpath == "" || xpath == "/")
			//    xpath = n.Name;

			System.Text.RegularExpressions.Regex r = new System.Text.RegularExpressions.Regex(@"\w+|\W+", System.Text.RegularExpressions.RegexOptions.Compiled);
			JavaScriptObject o = new JavaScriptObject();

			if (n.NodeType == XmlNodeType.Element)
			{
				for (int i = 0; i < n.Attributes.Count; i++)
				{
					o.Add("@" + n.Attributes[i].Name, n.Attributes[i].Value);
				}

				if (n.FirstChild != null)	// element has child nodes
				{
					int textChild = 0;
					bool hasElementChild = false;

					for (XmlNode e = n.FirstChild; e != null; e = e.NextSibling)
					{
						if (e.NodeType == XmlNodeType.Element) hasElementChild = true;
						if (e.NodeType == XmlNodeType.Text && r.IsMatch(e.InnerText)) textChild++;	// non-whitespace text
					}

					if (hasElementChild)
					{
						if (textChild < 2)	// structured element with evtl. a single text node
						{
							for (XmlNode e = n.FirstChild; e != null; e = e.NextSibling)
							{
								if (e.NodeType == XmlNodeType.Text)
								{
									o.Add("#text", e.InnerText);
								}
								else if (o.ContainsKey(e.Name))
								{
									if (o[e.Name] is JavaScriptArray)
									{
										((JavaScriptArray)o[e.Name]).Add(GetIJavaScriptObjectFromXmlNode(e));
									}
									else
									{
										IJavaScriptObject _o = o[e.Name];
										JavaScriptArray a = new JavaScriptArray();
										a.Add(_o);
										a.Add(GetIJavaScriptObjectFromXmlNode(e));
										o[e.Name] = a;
									}
								}
								else
								{
                                    o.AddInternal(e.Name, GetIJavaScriptObjectFromXmlNode(e));
								}
							}
						}
					}
					else if (textChild > 0)
					{
						if (n.Attributes.Count == 0)
							return new JavaScriptString(n.InnerText);
						else
							o.Add("#text", n.InnerText);
					}
				}
				if (n.Attributes.Count == 0 && n.FirstChild == null)
					return new JavaScriptString(n.InnerText);
			}
			else if (n.NodeType == XmlNodeType.Document)
				return GetIJavaScriptObjectFromXmlNode(((XmlDocument)n).DocumentElement);
			else
				throw new NotSupportedException("Unhandled node type '" + n.NodeType + "'.");

			return o;
		}
        private void label1_TextChanged(object sender, EventArgs e)
        {
            pictureBox1.Image         = Image.FromFile(Environment.CurrentDirectory + "\\Resources\\Pics\\loading.png");
            pictureBox1.ImageLocation = "https://cdn.sayobot.cn:25225/beatmaps/" + label1.Text + "/covers/cover.jpg?0";
            string           GettedJsonString = StaticUtilFunctions.JsonGet("https://api.sayobot.cn/v2/beatmapinfo?0=" + label1.Text);
            JavaScriptObject Json             = (JavaScriptObject)JavaScriptConvert.DeserializeObject(GettedJsonString);

            if (!Json.ContainsKey("status"))
            {
                MessageBox.Show("请求API失败", "网络错误", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            else if (Convert.ToInt32(Json["status"]) == -1)
            {
                MessageBox.Show("没有查询到数据", "SayobotBeatmapDownloader", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            else
            {
                JavaScriptObject Data = (JavaScriptObject)Json["data"];
                setInfo.approved      = Convert.ToInt16(Data["approved"]);
                setInfo.approved_date = Convert.ToInt32(Data["approved_date"]);
                setInfo.artist        = Convert.ToString(Data["artist"]);
                setInfo.beatmap_count = Convert.ToInt16(Data["bids_amount"]);
                setInfo.bpm           = Convert.ToDouble(Data["bpm"]);
                setInfo.genre         = Convert.ToInt16(Data["genre"]);
                setInfo.language      = Convert.ToInt16(Data["language"]);
                setInfo.last_update   = Convert.ToInt32(Data["last_update"]);
                setInfo.preview       = Convert.ToInt16(Data["preview"]);
                setInfo.sid           = Convert.ToInt32(Data["sid"]);
                setInfo.source        = Convert.ToString(Data["source"]);
                setInfo.storyboard    = Convert.ToInt16(Data["storyboard"]);
                setInfo.tags          = Convert.ToString(Data["tags"]);
                setInfo.title         = Convert.ToString(Data["title"]);
                setInfo.video         = Convert.ToInt16(Data["video"]);
                setInfo.favorite      = Convert.ToInt16(Data["favourite_count"]);
                JavaScriptArray mapArray = (JavaScriptArray)Data["bid_data"];
                setInfo.beatmapInfos = new System.Collections.Generic.List <BeatmapInfo>();
                for (int i = 0; i < setInfo.beatmap_count; i++)
                {
                    JavaScriptObject singleMap = (JavaScriptObject)mapArray[i];
                    BeatmapInfo      beatmap   = new BeatmapInfo
                    {
                        ar         = Convert.ToDouble(singleMap["AR"]),
                        bid        = Convert.ToInt32(singleMap["bid"]),
                        creator    = Convert.ToString(Data["creator"]),
                        cs         = Convert.ToDouble(singleMap["CS"]),
                        hp         = Convert.ToDouble(singleMap["HP"]),
                        img_base64 = Convert.ToString(singleMap["img"]),
                        maxcombo   = Convert.ToInt32(singleMap["maxcombo"]),
                        od         = Convert.ToDouble(singleMap["OD"]),
                        passcount  = Convert.ToInt32(singleMap["passcount"]),
                        playcount  = Convert.ToInt32(singleMap["playcount"]),
                        stars      = Convert.ToDouble(singleMap["star"]),
                        version    = Convert.ToString(singleMap["version"]),
                        length     = Convert.ToInt16(singleMap["length"])
                    };
                    if (beatmap.passcount != 0)
                    {
                        beatmap.passrate = Convert.ToDouble(beatmap.passcount * 100) / beatmap.playcount;
                    }
                    else
                    {
                        beatmap.passrate = 0.0D;
                    }
                    setInfo.beatmapInfos.Add(beatmap);
                }
                DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
                string[] MapStatus = { "graveyard", "WIP", "pending", "ranked", "approved", "qualified", "loved" };
                label2.Text  = setInfo.beatmapInfos[0].version;
                label23.Text = Convert.ToString(setInfo.sid);
                label24.Text = MapStatus[setInfo.approved + 2];
                label3.Text  = setInfo.artist + " - " + setInfo.title;
                button8.Text = startTime.AddSeconds(setInfo.last_update + 8 * 3600).ToString("yyyy-MM-dd HH:mm:ss");
                if (setInfo.approved_date > 0)
                {
                    button9.Text = startTime.AddSeconds(setInfo.approved_date + 8 * 3600).ToString("yyyy-MM-dd HH:mm:ss");
                }
                else
                {
                    button9.Text = "null";
                }
                button2.Text = Convert.ToString(setInfo.bpm);
                button5.Text = UtilValues.PublicValue.Language[setInfo.language];
                button6.Text = UtilValues.PublicValue.Genre[setInfo.genre];
                button7.Text = Convert.ToString(setInfo.favorite);
                toolTip1.SetToolTip(label8, setInfo.tags);
                toolTip1.SetToolTip(label12, setInfo.source);
                if (50 * setInfo.beatmap_count < 450)
                {
                    panel2.Size = new Size(50 * setInfo.beatmap_count, 32);
                }
                else
                {
                    panel2.Size = new Size(450, 32);
                }
                DrawRoundRectControl(panel2, Color.FromArgb(127, 216, 148, 139));
                displayInfo(0);
                if (!this.Visible)
                {
                    this.Show();
                }
            }
        }
Exemplo n.º 6
0
        public ResolvedReference ResolveTypeReference(ObjectImage context, JavaScriptObject typeReference)
        {
            JavaScriptObject metadata = context.GetMetadata();
            int assemblyReferenceIndex = (int)(long)typeReference["Assembly"];
            ObjectImage referencedObjectImage;
            if (assemblyReferenceIndex == -1)
            {
                referencedObjectImage = context;
            }
            else
            {
                JavaScriptObject assemblyReference = (JavaScriptObject)((JavaScriptArray)metadata["AssemblyReferences"])[assemblyReferenceIndex];
                referencedObjectImage = ResolveAssemblyReference(assemblyReference);
            }

            JavaScriptObject referencedMetadata = referencedObjectImage.GetMetadata();
            foreach (JavaScriptObject typeDefinition in (JavaScriptArray)referencedMetadata["Types"])
            {
                if (TypeReferenceEquals(context, typeReference, referencedObjectImage, typeDefinition))
                {
                    int declaringTypeReferenceIndex = (int)(long)typeReference["DeclaringType"];
                    int declaringTypeReferenceIndex2 = (int)(long)typeDefinition["DeclaringType"];
                    if (declaringTypeReferenceIndex != -1 && declaringTypeReferenceIndex2 != -1)
                    {
                        // if both have declaring types
                        JavaScriptObject declaringTypeReference = (JavaScriptObject)((JavaScriptArray)metadata["TypeReferences"])[declaringTypeReferenceIndex];
                        JavaScriptObject declaringTypeReference2 = (JavaScriptObject)((JavaScriptArray)referencedMetadata["TypeReferences"])[declaringTypeReferenceIndex2];
                        ResolvedReference resolvedReference = ResolveTypeReference(referencedObjectImage, declaringTypeReference2);
                        if (!TypeReferenceEquals(context, declaringTypeReference, resolvedReference.Context, resolvedReference.Resolved))
                        {
                            continue;
                        }
                    }
                    else if (declaringTypeReferenceIndex != -1 || declaringTypeReferenceIndex2 != -1)
                    {
                        // if one has a declaring type and not the other
                        continue;
                    }
                    return new ResolvedReference(referencedObjectImage, typeDefinition);
                }
            }
            // TODO: Resolve declaring type to get its full name
            throw new Exception("Could not resolve type: " + (typeReference.ContainsKey("DeclaringType") && (long)typeReference["DeclaringType"] != -1 ? typeReference["DeclaringType"] : typeReference["Namespace"]) + "." + typeReference["Name"]);
        }
        public string ModifyPriceInfo(string loginIdentifer, string priceJson)
        {
            JavaScriptObject obj2 = new JavaScriptObject();

            obj2.Add("Result", false);
            obj2.Add("Message", "");
            LoginUser loginUser = GlobalAppModule.GetLoginUser(loginIdentifer);

            if (loginUser == null)
            {
                obj2["Message"] = "未登录";
                return(JavaScriptConvert.SerializeObject(obj2));
            }
            if (loginUser.LoginTimeout)
            {
                obj2["Message"] = "登录超时";
                return(JavaScriptConvert.SerializeObject(obj2));
            }
            loginUser.LastOperateTime = DateTime.Now;
            CommonUtil.WaitMainLibInit();
            JavaScriptObject jso = (JavaScriptObject)JavaScriptConvert.DeserializeObject(priceJson);

            if (jso == null)
            {
                obj2["Message"] = "参数priceJson格式不正确";
                return(JavaScriptConvert.SerializeObject(obj2));
            }
            if ((!jso.ContainsKey("ID") || (jso["ID"] == null)) || (jso["ID"].ToString().Trim() == ""))
            {
                obj2["Message"] = "价格ID不能为空";
                return(JavaScriptConvert.SerializeObject(obj2));
            }
            PriceInfo pi = null;

            try
            {
                pi = this.JsonToPriceInfo(jso);
            }
            catch (Exception exception)
            {
                obj2["Message"] = exception.Message;
                return(JavaScriptConvert.SerializeObject(obj2));
            }
            ResMsg msg = PriceModule.ModifyPriceInfo(pi);

            string[]    strArray  = new string[] { "一阶名称", "二阶名称", "三阶名称", "四阶名称" };
            string[]    strArray2 = new string[4];
            string[]    strArray3 = new string[4];
            XmlDocument document  = new XmlDocument();
            string      filename  = AppDomain.CurrentDomain.BaseDirectory.ToString() + @"App_Config\Price.config";

            document.Load(filename);
            XmlNode node  = document.GetElementsByTagName("水价").Item(0);
            XmlNode node2 = document.GetElementsByTagName("电价").Item(0);
            int     num   = int.Parse(document.SelectSingleNode("价格设置/水价/阶梯数量").InnerText);
            int     num2  = int.Parse(document.SelectSingleNode("价格设置/电价/阶梯数量").InnerText);

            for (int i = 0; (i < num) && (i < strArray.Length); i++)
            {
                XmlNode node5 = node.SelectSingleNode(strArray[i]);
                strArray2[i] = node5.InnerText;
            }
            for (int j = 0; (j < num2) && (j < strArray.Length); j++)
            {
                XmlNode node6 = node2.SelectSingleNode(strArray[j]);
                strArray3[j] = node6.InnerText;
            }
            obj2["Result"]  = msg.Result;
            obj2["Message"] = msg.Message;
            try
            {
                SysLog log = new SysLog();
                log.LogUserId   = loginUser.UserId;
                log.LogUserName = loginUser.LoginName;
                log.LogAddress  = ToolsWeb.GetIP(context.Request);
                log.LogTime     = DateTime.Now;
                log.LogType     = "修改价格信息";
                log.LogContent  = msg + "|" + ModelHandler <PriceInfo> .ToString(pi);

                SysLogModule.Add(log);
            }
            catch { }
            return(JavaScriptConvert.SerializeObject(obj2));
        }
Exemplo n.º 8
0
        public static JavaScriptObject splitJson(string json)
        {
            Stack <Range>      sta       = new Stack <Range>();
            LinkedList <Range> rangeList = new LinkedList <Range>();

            char[] str = json.ToCharArray();
            for (int i = 0; i < str.Length; i++)
            {
                Range mark = null;
                if (sta.Count > 0)
                {
                    mark = sta.Peek();
                }
                if (str[i] == '[' || str[i] == '{')
                {
                    sta.Push(new Range(str[i], i));
                }
                else if ((str[i] == ']' && mark != null && mark.start == '[') || (str[i] == '}' && mark != null && mark.start == '{'))
                {
                    Range  seg    = new Range(mark.end, i + 1);
                    string subStr = json.Substring(seg.start, seg.end - seg.start);
                    if (IsJson(subStr))
                    {
                        addToRange(rangeList, seg);
                        //string posLog = "";
                        //string strLog = "";
                        //LinkedListNode<Range> temp = rangeList.Count>0?rangeList.First:null;
                        //while (temp != null)
                        //{
                        //    string line = json.Substring(temp.Value.start, temp.Value.end - temp.Value.start);
                        //    posLog += "(" + temp.Value.start + "," + temp.Value.end + "),";
                        //    strLog += "【" + line + "】";
                        //    temp = temp.Next;
                        // }
                        //Console.Error.WriteLine("区间列表:" + posLog);
                        //Console.Error.WriteLine("字串列表:" + strLog);
                    }
                    else
                    {
                        //Console.Error.WriteLine("此货不是json:" + subStr);
                    }
                    sta.Pop();
                }
            }

            JavaScriptObject objs = new JavaScriptObject();

            if (rangeList.Count < 1)
            {
                return(objs);
            }
            LinkedListNode <Range> cur = rangeList.Count > 0?rangeList.First:null;
            int lastPos = 0;

            while (cur != null)
            {
                object subJson = JavaScriptConvert.DeserializeObject(json.Substring(cur.Value.start, cur.Value.end - cur.Value.start));
                string key     = json.Substring(lastPos, cur.Value.start - lastPos);
                while (objs.ContainsKey(key) || key.Length < 1)
                {
                    key = key + " ";
                }
                objs.Add(key, subJson);
                lastPos = cur.Value.end;
                cur     = cur.Next;
            }
            return(objs);
        }
Exemplo n.º 9
0
        private void Form2_Load(object sender, EventArgs e)
        {
            UtilValues.PublicValue.ProgramRunTime = 0;

            //Thread[] FormsLoad = {
            //    new Thread(new ParameterizedThreadStart(ChildForms.LoadSettingsForm)),
            //    new Thread(new ParameterizedThreadStart(ChildForms.LoadFilterForm))};
            //var waits = new EventWaitHandle[2];
            //int temp = 0;
            //foreach (Thread subThread in FormsLoad)
            //{
            //    var handler = new ManualResetEvent(false);
            //    waits[temp]=handler;
            //    subThread.Start(handler);
            //    subThread.DisableComObjectEagerCleanup();
            //}

            label1.BackColor      = Color.Transparent;
            linkLabel1.BackColor  = Color.Transparent;
            panel2.BackColor      = Color.Transparent;
            menuStrip1.BackColor  = Color.Transparent;
            panel1.BackColor      = Color.Transparent;
            menuStrip1.BackColor  = Color.Transparent;
            gmProgressBar1.XTheme = new Gdu.WinFormUI.ThemeProgressBarGreen();


            dataGridView1.Visible = false;
            string           SupportStatus     = StaticUtilFunctions.JsonGet("https://api.sayobot.cn/support");
            JavaScriptObject SupportStatusJson = (JavaScriptObject)JavaScriptConvert.DeserializeObject(SupportStatus);

            if (!SupportStatusJson.ContainsKey("data"))
            {
                MessageBox.Show("网络错误,请检查网络连接后重启程序", "SayobotBeatmapDownloader",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                Environment.Exit(-1);
            }

            JavaScriptObject Data = (JavaScriptObject)SupportStatusJson["data"];

            gmProgressBar1.Percentage = (Int32)(Convert.ToDouble(Data["total"]) / Convert.ToDouble(Data["target"]) * 100.0);
            linkLabel1.Text           = "投喂进度:$" + Data["total"].ToString() + "/$" + Data["target"].ToString();
            linkLabel1.Links.Add(0, linkLabel1.Text.Length, "https://sayobot.cn/home");


            PublicControlers.notifyIcon   = notifyIcon1;
            PublicControlers.mediaPlayer  = axWindowsMediaPlayer1;
            PublicControlers.dataGridView = dataGridView1;
            PublicControlers.mainForm     = this;
            PublicControlers.settingForm  = settingForm;
            PublicControlers.MemoryUsage  = label2;

            StaticUtilFunctions.SetFormMid(settingForm);
            StaticUtilFunctions.SetFormMid(beatmapDetailInfo);
            StaticUtilFunctions.SetFormMid(filter);

            if (File.Exists(ConfigFile.inifilepath))
            {
                ConfigFile.GetAllConfigsApply();
            }
            else
            {
                /*
                 * welcome = new Forms.Welcome();
                 * welcome.Show();
                 */
                FileStream streamtmp = File.Create(ConfigFile.inifilename);
                streamtmp.Close();
                ConfigFile.ResetAllConfigs();
            }
            if (Settings.MainFormImage != "")
            {
                StaticUtilFunctions.LoadingMainFormBackgroundPic();
            }
            StaticUtilFunctions.FindNanoPad();
            if (UtilValues.PublicValue.nanoPads.Length != 0)
            {
                notifyIcon1.ShowBalloonTip(500, "SayobotBeatmapDownloader",
                                           "发现" + UtilValues.PublicValue.nanoPads.Length.ToString() + "个触盘", ToolTipIcon.Info);
            }
            //WaitHandle.WaitAll(waits);
        }
Exemplo n.º 10
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text != "" && button1.Text == "搜索")
            {
                dataGridView1.Rows.Clear();
                DataTable table = new DataTable();
                table.Columns.Add("艺术家 - 标题", typeof(string));
                table.Columns.Add("sid", typeof(string));
                table.Columns.Add("谱面状态", typeof(string));
                table.Columns.Add("Mapper", typeof(string));
                string           GettedJsonString = StaticUtilFunctions.JsonGet(StaticUtilFunctions.Spawn_SearchHttpLink(textBox1.Text, 0));
                JavaScriptObject GettedJson       = (JavaScriptObject)JavaScriptConvert.DeserializeObject(GettedJsonString);
                if (!GettedJson.ContainsKey("status"))
                {
                    MessageBox.Show("请求API失败", "网络错误", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    return;
                }
                else if (Convert.ToInt32(GettedJson["status"]) == -1)
                {
                    MessageBox.Show("没有查询到数据", "SayobotBeatmapDownloader", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    dataGridView1.Visible = false;
                    label3.Visible        = true;
                    return;
                }
                label3.Visible = false;
                JavaScriptArray Data = (JavaScriptArray)GettedJson["data"];

                for (int tmp = 0; tmp < Data.Count; ++tmp)
                {
                    JavaScriptObject SingleMap = (JavaScriptObject)Data[tmp];
                    string           BasicInfo = SingleMap["artist"].ToString() + " - " + SingleMap["title"].ToString();
                    table.Rows.Add(BasicInfo, SingleMap["sid"].ToString(), UtilValues.PublicValue.MapStatus[Convert.ToInt32(SingleMap["approved"]) + 2], SingleMap["creator"].ToString());
                }
                while (Convert.ToInt32(GettedJson["endid"]) != 0 && table.Rows.Count < 1000)
                {
                    var offset = Convert.ToInt32(GettedJson["endid"]);
                    GettedJsonString = StaticUtilFunctions.JsonGet(StaticUtilFunctions.Spawn_SearchHttpLink(textBox1.Text, offset));
                    GettedJson       = (JavaScriptObject)JavaScriptConvert.DeserializeObject(GettedJsonString);
                    if (!GettedJson.ContainsKey("status"))
                    {
                        GettedJson.Add("endid", offset);
                        continue;
                    }
                    Data = (JavaScriptArray)GettedJson["data"];
                    for (int tmp = 0; tmp < Data.Count; ++tmp)
                    {
                        JavaScriptObject SingleMap = (JavaScriptObject)Data[tmp];
                        string           BasicInfo = SingleMap["artist"].ToString() + " - " + SingleMap["title"].ToString();
                        table.Rows.Add(BasicInfo, SingleMap["sid"].ToString(), UtilValues.PublicValue.MapStatus[Convert.ToInt32(SingleMap["approved"]) + 2], SingleMap["creator"].ToString());
                    }
                }
                if (29 + 23 * table.Rows.Count > 354)
                {
                    dataGridView1.Height = 354;
                }
                else
                {
                    dataGridView1.Height = 29 + 23 * table.Rows.Count;
                }
                foreach (DataRow row in table.Rows)
                {
                    dataGridView1.Rows.Add(row.ItemArray[0], row.ItemArray[1], row.ItemArray[2], row.ItemArray[3]);
                }
                dataGridView1.Visible = true;
                table.Clear();
                table.Dispose();
            }
            else if (textBox1.Text != "" && button1.Text == "查找")
            {
                bool flag = false;
                foreach (DataGridViewRow row in dataGridView1.Rows)
                {
                    for (int tmp = 0; tmp < 4; tmp++)
                    {
                        if (row.Cells[tmp].Value.ToString().Contains(textBox1.Text))
                        {
                            flag = true;
                            break;
                        }
                    }
                    if (!flag)
                    {
                        row.Visible = false;
                    }
                }
            }
            else if (button1.Text == "过滤器")
            {
                PublicControlers.SearchBtn = button1;
                filter.BackColor           = ColorTranslator.FromHtml(Settings.MainFormColor);
                filter.Show();
            }
        }