using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class webXabara_shop_clear : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        XabaraCom xc = new XabaraCom();        
        xc.CheckAdminLogin("");

        dbDataFunction db = new dbDataFunction();
        DataTable dt;
        DateTime t = DateTime.Now;

        string strSql;

        strSql = "delete from taobaoKe where isBad=1 and updateDate<'" + t.ToString() + "'";
        db.exeSql(strSql);

        Response.Write("清除无效淘客完成！<br />");
        Response.Flush();

        //---------------------------------------------
        string[] strValue = new string[1];
        strValue[0] = "0";
        dt = db.getDataTable("SELECT id FROM taobaoke WHERE volume<20 AND isGood=1 AND commission <20");
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            db.InsertUpdateDB("taobaoKe", "@isGood", strValue, dt.Rows[i]["id"].ToString().Trim());
        }
        dt.Dispose();

        Response.Write("清理滞销商品完成！");
    }
}