public static bool is_alike_name_by_db(string input1, string input2) { if (Match100Helper.convert_team_name(input1) == Match100Helper.convert_team_name(input2)) { return(true); } return(false); }
public void pick_from_single() { is_picking = true; //f_state: 0-未处理 1-已处理,值更新了时间 2-已处理,一个匹配 3-已处理,2个匹配 string id_min = "9999999999999999"; string sql = "select min(id) from europe_100_log where f_state='0' "; DataTable dt_min = SQLServerHelper.get_table(sql); if (!string.IsNullOrEmpty(dt_min.Rows[0][0].ToString())) { id_min = dt_min.Rows[0][0].ToString(); } sql = "select * from europe_100_log where f_state='0' "; DataTable dt = SQLServerHelper.get_table(sql); foreach (DataRow row in dt.Rows) { string id = row["id"].ToString(); string website = row["website"].ToString(); string start_time = row["start_time"].ToString(); string host = row["host"].ToString(); string client = row["client"].ToString(); string win = row["odd_win"].ToString(); string draw = row["odd_draw"].ToString(); string lose = row["odd_lose"].ToString(); string time_zone = row["time_zone"].ToString(); string time_add = row["time_add"].ToString(); string timespan = row["timespan"].ToString(); string convert_host = ""; string convert_client = ""; string convert_time = ""; string f_state = "1"; //try //{ convert_host = Match100Helper.convert_team_name(host); convert_client = Match100Helper.convert_team_name(client); DateTime time = Convert.ToDateTime(start_time).AddHours(8 - Convert.ToInt16(time_zone)); if (website == "pinnaclesports" && time.Minute % 5 != 0) { time = time.AddMinutes(Convert.ToInt16(time_add)); } convert_time = time.ToString("yyyy-MM-dd HH:mm:ss"); if (!string.IsNullOrEmpty(convert_host) || !string.IsNullOrEmpty(convert_client)) { f_state = "2"; } if (!string.IsNullOrEmpty(convert_host) && !string.IsNullOrEmpty(convert_client)) { f_state = "3"; } sql = " update europe_100_log set f_host='{0}',f_client='{1}',f_start_time='{2}' ,f_state='{3}' where id='{4}'"; sql = string.Format(sql, convert_host, convert_client, convert_time, f_state, id); SQLServerHelper.exe_sql(sql); sb.AppendLine(website.PR(10) + convert_time.PR(30) + convert_host.PR(50) + convert_client.PR(50)); this.txt_result.Text = sb.PR200(); Application.DoEvents(); //} //catch (Exception error) //{ // sql = " update europe_100_log set f_state='w' where id='{0}'"; // sql = string.Format(sql, id); // SQLServerHelper.exe_sql(sql); // sb.AppendLine(id + " Wrong!"); // this.txt_result.Text = sb.PRINT(); // Application.DoEvents(); //} } insert_office(); is_picking = false; }