Ejemplo n.º 1
0
        protected void bt_all_Click(object sender, EventArgs e)
        {
            int j = 0;

            if (dt != null && dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    try
                    {
                        string seller    = Convert.ToString(dt.Rows[i]["sellerNick"]);
                        string seller_id = SellersBLL.GetSellerIdByNick(seller);
                        if (!string.IsNullOrEmpty(seller_id))
                        {
                            long count = Convert.ToInt32(BuyerBLL.GetBuyerCount("1", seller));
                            if (count > 0)
                            {
                            }
                            else
                            {
                                SellersDAL sellerdl = new SellersDAL();
                                sellerdl.addBuyerData(seller_id);
                                j++;
                            }
                        }
                    }
                    catch
                    {
                        continue;
                    }
                    lb_num.Text = j.ToString();
                }
            }
        }
Ejemplo n.º 2
0
 protected void gv_seller_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         string nick  = e.Row.Cells[0].Text;
         string count = BuyerBLL.GetBuyerCount("1", nick);
         if (string.IsNullOrEmpty(count))
         {
             count = "0";
         }
         e.Row.Cells[3].Text = count;
         e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#999999'");
         e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
         ((LinkButton)e.Row.Cells[3].FindControl("lbt_qBuerys")).CommandName = e.Row.Cells[0].Text;
     }
 }
Ejemplo n.º 3
0
        //读取会员api
        protected void Button2_Click(object sender, EventArgs e)
        {
            string sellerNick = TextBox2.Text.Trim();
            string session    = txtSession.Text.Trim();
            //如果没有会员,则尝试建立会员列表  20160704 yao
            string memberNum = BuyerBLL.GetBuyerCount("1", sellerNick);

            if (memberNum.Equals("0") == true)
            {
                if (string.IsNullOrEmpty(sellerNick) == true)
                {
                    lbError.Text = "请输入昵称!"; return;
                }
                ;
                string seller_id = SellersBLL.GetSellerIdByNick(sellerNick);
                if (string.IsNullOrEmpty(seller_id) == false)
                {
                    SellersDAL sellerdl = new SellersDAL();
                    sellerdl.addBuyerData(seller_id);
                }
            }

            try
            {
                //下载淘宝数据到本地
                //初始化系统分组
                InitGroup(sellerNick);
                BuyerBLL buyerObj = new BuyerBLL();
                if (buyerObj.SynicBuyersInformation(sellerNick, session))
                {
                    //将最新同步数据时间更新写入DB
                    Sellers objSeller = new Sellers();
                    objSeller.Nick = sellerNick;
                    SellersBLL.UpdateSellerSynDate(objSeller);
                }
                lbError.Text      = "会员同步完成!";
                lbError.ForeColor = Color.Blue;
            }
            catch (Exception err)
            {
                ExceptionReporter.WriteLog(err, ExceptionPostion.TBApply_Data);
                lbError.Text = "会员同步完成,但出现异常,详情请看日志!";
            }
        }
Ejemplo n.º 4
0
 public string SyncMemDele(string strUserName, string strSession, string strTime)
 {
     try
     {
         Console.WriteLine("开始同步,卖家:" + strUserName);
         //初始化系统分组
         InitGroup(strUserName);
         //同步系统订单,全部同步
         if (string.IsNullOrEmpty(strTime))
         {
             //获取会员数据量
             string memberNum = BuyerBLL.GetBuyerCount("1", strUserName);
             if (memberNum.Equals("0") == true)
             {//如果会员数量为0则添加一个表
                 //获取id
                 string seller_id = SellersBLL.GetSellerIdByNick(strUserName);
                 if (string.IsNullOrEmpty(seller_id) == false)
                 {//如果seller_id不为空则创建一个新表
                     SellersDAL.addBuyer(seller_id);
                 }
             }
             BuyerBLL buyerObj = new BuyerBLL();
             if (buyerObj.SynicBuyersInformation(strUserName, strSession))
             {
                 //将最新同步数据时间更新写入DB
                 Sellers objSeller = new Sellers();
                 objSeller.Nick = strUserName;
                 SellersBLL.UpdateSellerSynDate(objSeller);
                 SellersBLL.SetSyncProcess(strUserName, 0);
             }
         }
     }
     catch (Exception err)
     {
         ExceptionReporter.WriteLog(err, ExceptionPostion.TBApply_Data);
     }
     return(strUserName);
 }
Ejemplo n.º 5
0
        protected void Button5_Click(object sender, EventArgs e)
        {
            string nick = TextBox3.Text.Trim();

            Label6.Text = "店铺有效会员总数为:" + BuyerBLL.GetBuyerCount("0", nick) + "个";
        }