Exemplo n.º 1
0
        /// <summary>
        /// 从一个MySqlDataReader里读数据
        /// </summary>
        /// <param name="Reader">MySqlDataReader</param>
        /// <returns>opponent_goodsExample</returns>
        public static opponent_goods GetByReader(MySqlDataReader Reader)
        {
            opponent_goods opponent_goodsExample = new opponent_goods();

            opponent_goodsExample.ogid         = Reader["ogid"] == DBNull.Value ? 0 : (int)Reader["ogid"];
            opponent_goodsExample.odpid        = Reader["odpid"] == DBNull.Value ? 0 : (int)Reader["odpid"];
            opponent_goodsExample.ocollectdate = Reader["ocollectdate"] == DBNull.Value ? null : Reader["ocollectdate"].ToString();
            opponent_goodsExample.ogurl        = Reader["ogurl"] == DBNull.Value ? null : Reader["ogurl"].ToString();
            opponent_goodsExample.ogtittle     = Reader["ogtittle"] == DBNull.Value ? null : Reader["ogtittle"].ToString();
            opponent_goodsExample.ogprice1     = Reader["ogprice1"] == DBNull.Value ? null : Reader["ogprice1"].ToString();
            opponent_goodsExample.ogprice2     = Reader["ogprice2"] == DBNull.Value ? null : Reader["ogprice2"].ToString();
            opponent_goodsExample.ogdiscount   = Reader["ogdiscount"] == DBNull.Value ? null : Reader["ogdiscount"].ToString();
            opponent_goodsExample.ogimg        = Reader["ogimg"] == DBNull.Value ? null : Reader["ogimg"].ToString();
            opponent_goodsExample.ogsales      = Reader["ogsales"] == DBNull.Value ? null : Reader["ogsales"].ToString();
            opponent_goodsExample.ogpostage    = Reader["ogpostage"] == DBNull.Value ? null : Reader["ogpostage"].ToString();
            opponent_goodsExample.ogSKU        = Reader["ogSKU"] == DBNull.Value ? null : Reader["ogSKU"].ToString();
            opponent_goodsExample.ogUPdate     = Reader["ogUPdate"] == DBNull.Value ? null : Reader["ogUPdate"].ToString();
            opponent_goodsExample.ogDowndate   = Reader["ogDowndate"] == DBNull.Value ? null : Reader["ogDowndate"].ToString();
            opponent_goodsExample.ogTBid       = Reader["ogTBid"] == DBNull.Value ? null : Reader["ogTBid"].ToString();
            opponent_goodsExample.ogxiaoliang  = Reader["ogxiaoliang"] == DBNull.Value ? null : Reader["ogxiaoliang"].ToString();
            opponent_goodsExample.ogshoucang   = Reader["ogshoucang"] == DBNull.Value ? null : Reader["ogshoucang"].ToString();
            opponent_goodsExample.ogremark     = Reader["ogremark"] == DBNull.Value ? null : Reader["ogremark"].ToString();
            opponent_goodsExample.ogremark1    = Reader["ogremark1"] == DBNull.Value ? null : Reader["ogremark1"].ToString();
            opponent_goodsExample.oshopid      = Reader["oshopid"] == DBNull.Value ? null : Reader["oshopid"].ToString();
            opponent_goodsExample.ogremark2    = Reader["ogremark2"] == DBNull.Value ? null : Reader["ogremark2"].ToString();
            opponent_goodsExample.ogremark3    = Reader["ogremark3"] == DBNull.Value ? null : Reader["ogremark3"].ToString();
            opponent_goodsExample.ogremark4    = Reader["ogremark4"] == DBNull.Value ? null : Reader["ogremark4"].ToString();
            opponent_goodsExample.ogremark5    = Reader["ogremark5"] == DBNull.Value ? null : Reader["ogremark5"].ToString();
            return(opponent_goodsExample);
        }
Exemplo n.º 2
0
 void AddRow(opponent_goods goods)
 {
     try
     {
         DataGridViewRow         row  = new DataGridViewRow();
         DataGridViewTextBoxCell txt1 = new DataGridViewTextBoxCell();
         txt1.Value = goods.ogTBid;
         row.Cells.Add(txt1);
         DataGridViewImageCell img1 = new DataGridViewImageCell();
         img1.Value = goods.ogimg;
         row.Cells.Add(img1);
         DataGridViewTextBoxCell txt2 = new DataGridViewTextBoxCell();
         txt2.Value = goods.ogtittle;
         row.Cells.Add(txt2);
         DataGridViewTextBoxCell txt3 = new DataGridViewTextBoxCell();
         txt3.Value = goods.ogsales;
         row.Cells.Add(txt3);
         DataGridViewTextBoxCell txt4 = new DataGridViewTextBoxCell();
         txt4.Value = goods.ogshoucang;
         row.Cells.Add(txt4);
         DataGridViewTextBoxCell txt5 = new DataGridViewTextBoxCell();
         txt5.Value = goods.ogxiaoliang;
         row.Cells.Add(txt5);
         DataGridViewTextBoxCell txt6 = new DataGridViewTextBoxCell();
         txt6.Value = goods.ogprice1;
         row.Cells.Add(txt6);
         DataGridViewTextBoxCell txt7 = new DataGridViewTextBoxCell();
         txt7.Value = goods.ogprice2;
         row.Cells.Add(txt7);
         DataGridViewTextBoxCell txt8 = new DataGridViewTextBoxCell();
         txt8.Value = Manager.GetZheKou(goods.ogprice1, goods.ogprice2).ToString();
         row.Cells.Add(txt8);
         DataGridViewTextBoxCell txt9 = new DataGridViewTextBoxCell();
         txt9.Value = goods.ogpostage;
         row.Cells.Add(txt9);
         DataGridViewTextBoxCell txt10 = new DataGridViewTextBoxCell();
         txt10.Value = goods.ogSKU;
         row.Cells.Add(txt10);
         DataGridViewTextBoxCell txt11 = new DataGridViewTextBoxCell();
         txt11.Value = goods.ocollectdate;
         row.Cells.Add(txt11);
         //DataGridViewComboBoxCell comboxcell = new DataGridViewComboBoxCell();
         //row.Cells.Add(comboxcell);
         dgv1.Rows.Add(row);
     }
     catch (Exception ex)
     {
         Debug.WriteLine("======================================================================");
         Debug.WriteLine("网址:" + Browser.urlstr);
         Debug.WriteLine(DateTime.Now.ToString());
         Debug.WriteLine("全店采集信息失败:" + ex.Message);
         MessageBox.Show("全店采集信息失败:" + ex.Message);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// 查询全部数据
        /// </summary>
        /// <returns>IList</returns>
        /*查看是否为视图*/
        public IList <opponent_goods> SearchAll()
        {
            DBHelper.sqlstr = "select * from opponent_goods ";
            List <opponent_goods> list   = new List <opponent_goods>();
            MySqlDataReader       reader = DBHelper.ExecuteReader();

            while (reader.Read())
            {
                opponent_goods Obj = GetByReader(reader);
                list.Add(Obj);
            }
            reader.Close();
            return(list);
        }
Exemplo n.º 4
0
        private void dgv1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            //注释:

            //dataGridView1.Columns[e.ColumnIndex] is DataGridViewButtonColumn 说明点击的列是DataGridViewButtonColumn列,当然你也根据e.ColumnIndex == 你的按钮列的索引来做
            // e.RowIndex > -1 ,说明点击的不是列头
            if (dgv1.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex > -1)
            {
                opponent_goods og = (opponent_goods)dgv1.CurrentRow.DataBoundItem;
                if (og != null)
                {
                    //BindingCollection<object> objList = new BindingCollection<object>();
                    //objList = 你的结果集;
                    //this.dataGridView1.DataSource = objList;

                    IList <opponent_goods> list = BLL2.opponent_goodsManager.Search(1, 99999, "", "", og.ogTBid, "", "");

                    dgv1.DataSource = Manager.BindingSort_opponent_goods(list);
                    //var bindingList = new BindingList<opponent_goods>();
                    //var source = new BindingSource(bindingList, null);
                    //dgv1.DataSource = source;
                    //dgv1.DataSource =
                }

                //获取当前被点击的单元格
                //DataGridViewButtonCell vCell = (DataGridViewButtonCell)dgv1.CurrentCell;
                //if (vCell.Tag == null)
                //{
                //    vCell.Value = "停用";
                //    vCell.Tag = true;
                //}
                //else
                //{
                //    vCell.Value = "停用1";
                //    vCell.Tag = null;
                //}
            }
            else if (e.RowIndex == -1)
            {
                try
                {
                    dgv1.Sort(dgv1.Columns[e.ColumnIndex], ListSortDirection.Descending);
                }
                catch (Exception ex)
                {
                    Debug.WriteLine("排序出错=========================" + ex.Message);
                }
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 根据ogid,查询一条数据
        /// </summary>
        /// <param name="ogid">编号</param>
        /// <returns></returns>
        /*查看是否为视图*/

        public opponent_goods SearchByID(int ogid)
        {
            DBHelper.sqlstr = "select * from opponent_goods where ogid = @ogid";
            MySqlParameter[] param = new MySqlParameter[] {
                new MySqlParameter("@ogid", ogid)
            };
            MySqlDataReader reader = DBHelper.ExecuteReader(param);
            opponent_goods  Obj    = null;

            if (reader.Read())
            {
                Obj = GetByReader(reader);
            }
            reader.Close();
            return(Obj);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 搜索
        /// </summary>
        /// <param name="s">起始位置</param>
        /// <param name="e">结束为止</param>
        /// <param name="key">关键词</param>
        /// <param name="dpid">店铺ID</param>
        /// <param name="TBid">淘宝商品ID</param>
        /// <param name="caijidate">采集时间</param>
        /// <param name="orderby">排序</param>
        /// <returns></returns>
        public IList <opponent_goods> Search(int s, int e, string key, string shopid, string TBid, string caijidate, string orderby)
        {
            string sql1  = "select  *   from opponent_goods where ";
            string sql2  = string.IsNullOrEmpty(key) ? " 1=1 " : " (  ogurl like '%" + key + "%' or  ogtittle like '%" + key + "%'   or  ogprice1 like '%" + key + "%'   or  ogprice2 like '%" + key + "%'   or  ogdiscount like '%" + key + "%'   or  ogimg like '%" + key + "%'   or  ogsales like '%" + key + "%'   or  ogpostage like '%" + key + "%'   or  ogSKU like '%" + key + "%'   or  ogUPdate like '%" + key + "%'   or  ogDowndate like '%" + key + "%'    or  ogxiaoliang like '%" + key + "%'   or  ogshoucang like '%" + key + "%'   or  ogremark like '%" + key + "%'   or  ogremark1 like '%" + key + "%'   or  oshopid like '%" + key + "%'   or  ogremark2 like '%" + key + "%'   or  ogremark3 like '%" + key + "%'   or  ogremark4 like '%" + key + "%'   or  ogremark5 like '%" + key + "%'    ) ";
            string sql3  = string.IsNullOrEmpty(shopid) ? "" : " and oshopid = '" + shopid + "' ";
            string sql4  = string.IsNullOrEmpty(caijidate) ? "" : " and ocollectdate like '%" + caijidate + "%' ";
            string sql5  = string.IsNullOrEmpty(TBid) ? "" : " and ogTBid = '" + TBid + "' ";
            string sql8  = string.IsNullOrEmpty(orderby) ? " order by ocollectdate desc " : " order by " + orderby;
            string sql10 = e == 0 ? " " : " limit " + s + "," + e;

            DBHelper.sqlstr = sql1 + sql2 + sql3 + sql4 + sql5 + sql8 + sql10;
            List <opponent_goods> list   = new List <opponent_goods>();
            MySqlDataReader       reader = DBHelper.ExecuteReader();

            while (reader.Read())
            {
                opponent_goods Obj = GetByReader(reader);
                list.Add(Obj);
            }
            reader.Close();
            return(list);
        }
Exemplo n.º 7
0
        private void dgv1_DoubleClick(object sender, EventArgs e)
        {
            Point hit = this.dgv1.PointToClient(Cursor.Position);

            DataGridView.HitTestInfo hitTest = this.dgv1.HitTest(hit.X, hit.Y);
            //MessageBox.Show(hitTest.Type + " Row=" + hitTest.RowIndex + " Col" + hitTest.ColumnIndex);
            //判断不是首行
            if (hitTest.RowIndex != -1)
            {
                int            a  = dgv1.CurrentRow.Index;
                opponent_goods og = (opponent_goods)dgv1.CurrentRow.DataBoundItem;
                if (og != null)
                {
                    Manager.OpenProgram(og.ogurl);
                }
                //string str = dgv1.Rows[a].Cells["strName"].Value.ToString();
            }


            //if (dgv1.FocusedRowHandle >= 0)
            //{

            //}
        }
Exemplo n.º 8
0
        private void btn_caiji1_Click(object sender, EventArgs e)
        {
            GC.Collect();
            dgv1.Rows.Clear();
            string str = txt_key.Text.Trim();


            //判断是否已经选择采集店铺
            string temp_dp = cb_dianpu.SelectedValue.ToString();

            if (!string.IsNullOrEmpty(temp_dp))
            {
                IList <opponent_dianpu> temp_listdp2 = BLL2.opponent_dianpuManager.Search(1, 100, temp_dp, "");
                if (temp_listdp2.Count > 0)
                {
                    str = temp_listdp2[0].odwangwang;
                }
            }



            //str = "https://item.taobao.com/item.htm?spm=a1z10.3-c-s.w4002-14460596614.23.XM7KUF&id=540733715384";//sunny家网址
            if (string.IsNullOrEmpty(str))
            {
                MessageBox.Show("请输入要分析的店铺");
                return;
                //str = "miss原创定制";
            }
            //判断是否是网址
            int    temp_isurl = str.IndexOf("http");
            string id         = Manager.GetValueByURL(str, "id");
            string datenow    = DateTime.Now.ToString("yyyy年MM月dd日HH时mm分");

            //如果是网址
            if (temp_isurl > -1 && !string.IsNullOrEmpty(id))
            {
                //string url = Manager.GetDPurlByWangwang(str);
                Browser.urlstr = str;
                webBrowser1.Navigate(Browser.urlstr);
                //判断是否加载完成
                if (Browser.WaitWebPageLoad(webBrowser1))
                {
                    try
                    {
                        if (webBrowser1.Document != null)
                        {
                            //判断是否是邮费链接
                            HtmlElementCollection elem1 = webBrowser1.Document.GetElementById("attributes").GetElementsByTagName("ul")[0].GetElementsByTagName("li");

                            if (elem1.Count > 0)
                            {
                                //string datenow = DateTime.Now.ToString("yyyy年MM月dd日HH时mm分");
                                //先采集商品
                                opponent_goods        og   = CaiJi.CaijiGoods(datenow, webBrowser1);
                                List <opponent_goods> list = new List <opponent_goods>();
                                if (og != null)
                                {
                                    list.Add(og);
                                    dgv1.DataSource = Manager.BindingSort_opponent_goods(list);
                                    //再采集店铺信息,需要跳转页面
                                    Entity.opponent_dianpu dp = CaiJi.CaijiDP(datenow, webBrowser1);
                                    BLL2.opponent_dianpuManager.Insert(dp);

                                    opponent_dianpu_info dpinfo = CaiJi.CaijiDPSDR(datenow, webBrowser1);
                                    dpinfo = bind_dianpu_info(list, dpinfo);
                                    BLL2.opponent_dianpu_infoManager.Insert(dpinfo);

                                    BLL2.opponent_goodsManager.Insert(og);
                                    GC.Collect();//释放内存
                                }
                            }
                            else
                            {
                                Debug.WriteLine("======================================================================");
                                Debug.WriteLine("网址:" + Browser.urlstr);
                                Debug.WriteLine("该商品可能是 邮费链接 ");
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        //MessageBox.Show("采集信息失败:" + ex.Message);
                        Debug.WriteLine("======================================================================");
                        Debug.WriteLine("网址:" + Browser.urlstr);
                        Debug.WriteLine(DateTime.Now.ToString());
                        Debug.WriteLine("单品采集信息失败:" + ex.Message);
                    }
                }
            }
            else
            {
                //如果不是网址
                string url = CaiJi.GetShopSearchURL(str);
                url = Browser.UrlEncode(url, Encoding.UTF8);
                //Debug.WriteLine(url);
                //跳转到搜索店铺页面
                Browser.urlstr = url;
                webBrowser1.Navigate(Browser.urlstr);
                //判断是否加载完成
                if (Browser.WaitWebPageLoad(webBrowser1))
                {
                    try
                    {
                        if (webBrowser1.Document != null)
                        {
                            string url_shop = CaiJi.GetShopUrlByWangWang(str, webBrowser1);
                            //如果没有找到店铺网址,或者没有开店信息
                            if (string.IsNullOrEmpty(url_shop))
                            {
                                Debug.WriteLine("采集店铺时,没有找到店铺网址,或者没有开店信息");
                                MessageBox.Show("没有采集到该店铺信息");
                                return;
                            }
                            List <string>         list_url   = new List <string>();
                            List <opponent_goods> list_goods = new List <opponent_goods>();

                            //默认查询20页
                            for (int i = 0; i < 20; i++)
                            {
                                string url_goodslist = CaiJi.GetShopGoodsListURL(url_shop, i + 1);
                                Browser.urlstr = url_goodslist;
                                //跳转到商品列表页面
                                webBrowser1.Navigate(Browser.urlstr);
                                //break;
                                //判断是否加载完成
                                if (Browser.WaitWebPageLoad(webBrowser1))
                                {
                                    if (webBrowser1.Document != null)
                                    {
                                        //判断是否还有商品
                                        Browser.jsstr = "  getClassName('no-result-new').length;  ";
                                        if (Browser.JS_WebBrowser(webBrowser1) == "1")
                                        {
                                            break;
                                        }
                                        else
                                        {
                                            //================
                                            //list_url = CaiJi.GetGoodsUrlList(webBrowser1);
                                            //获取本页面商品网址List
                                            List <string> temp_list_url = CaiJi.GetGoodsUrlList(webBrowser1);
                                            Debug.WriteLine("获取本页面商品网址List" + temp_list_url.Count.ToString());
                                            if (temp_list_url.Count > 0)
                                            {
                                                foreach (string temp_url1 in temp_list_url)
                                                {
                                                    Browser.urlstr = temp_url1;
                                                    //跳转到商品页面
                                                    webBrowser1.Navigate(Browser.urlstr);
                                                    if (Browser.WaitWebPageLoad(webBrowser1))
                                                    {
                                                        if (webBrowser1.Document != null)
                                                        {
                                                            //判断是否是邮费链接
                                                            HtmlElementCollection elem1 = webBrowser1.Document.GetElementById("attributes").GetElementsByTagName("ul")[0].GetElementsByTagName("li");

                                                            if (elem1.Count > 0)
                                                            {
                                                                opponent_goods og = CaiJi.CaijiGoods(datenow, webBrowser1);
                                                                if (og != null)
                                                                {
                                                                    list_goods.Add(og);
                                                                    dgv1.DataSource = Manager.BindingSort_opponent_goods(list_goods);
                                                                    BLL2.opponent_goodsManager.Insert(og);
                                                                    Debug.WriteLine("添加商品:" + og.ogtittle);

                                                                    //绑定店铺信息
                                                                    opponent_dianpu_info dpinfo2 = new opponent_dianpu_info();
                                                                    dpinfo2 = bind_dianpu_info(list_goods, dpinfo2);

                                                                    GC.Collect();//释放内存
                                                                }
                                                            }
                                                            else
                                                            {
                                                                Debug.WriteLine("======================================================================");
                                                                Debug.WriteLine("网址:" + Browser.urlstr);
                                                                Debug.WriteLine("该商品可能是 邮费链接 ");
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }

                            dgv1.DataSource = Manager.BindingSort_opponent_goods(list_goods);

                            //在本页获取店铺信息
                            opponent_dianpu dp = CaiJi.CaijiDP(datenow, webBrowser1);
                            //在本页获取店铺信息
                            opponent_dianpu_info dpinfo = CaiJi.CaijiDPSDR(datenow, webBrowser1);
                            //从商品列表获取店铺信息

                            dpinfo = bind_dianpu_info(list_goods, dpinfo);


                            BLL2.opponent_dianpu_infoManager.Insert(dpinfo);
                            BLL2.opponent_dianpuManager.Insert(dp);


                            GC.Collect();//释放内存
                        }
                    }
                    catch (Exception ex)
                    {
                        Debug.WriteLine("======================================================================");
                        Debug.WriteLine("网址:" + Browser.urlstr);
                        Debug.WriteLine(DateTime.Now.ToString());
                        Debug.WriteLine("全店采集信息失败:" + ex.Message);
                        MessageBox.Show("全店采集信息失败:" + ex.Message);
                    }
                }
            }

            bind_dianpu();
            MessageBox.Show("采集完成");
        }
Exemplo n.º 9
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="opponent_goods">opponent_goods表实例</param>
 /// <returns>int</returns>
 public static int Update(opponent_goods opponent_goodsExample)
 {
     return(Service.Update(opponent_goodsExample));
 }
Exemplo n.º 10
0
 /// <summary>
 /// 插入方法
 /// </summary>
 /// <param name="opponent_goods">opponent_goods表实例</param>
 /// <returns>int</returns>
 public static int Insert(opponent_goods opponent_goodsExample)
 {
     return(Service.Insert(opponent_goodsExample));
 }
Exemplo n.º 11
0
 /// <summary>
 /// 更新
 /// </summary>
 /// <param name="opponent_goods">opponent_goods表实例</param>
 /// <returns>int</returns>
 public int Update(opponent_goods opponent_goodsExample)
 {
     DBHelper.sqlstr = "update opponent_goods set odpid=@odpid,ocollectdate=@ocollectdate,ogurl=@ogurl,ogtittle=@ogtittle,ogprice1=@ogprice1,ogprice2=@ogprice2,ogdiscount=@ogdiscount,ogimg=@ogimg,ogsales=@ogsales,ogpostage=@ogpostage,ogSKU=@ogSKU,ogUPdate=@ogUPdate,ogDowndate=@ogDowndate,ogTBid=@ogTBid,ogxiaoliang=@ogxiaoliang,ogshoucang=@ogshoucang,ogremark=@ogremark,ogremark1=@ogremark1,oshopid=@oshopid,ogremark2=@ogremark2,ogremark3=@ogremark3,ogremark4=@ogremark4,ogremark5=@ogremark5 where ogid=" + opponent_goodsExample.ogid;
     return(DBHelper.ExecuteNonQuery(GetSqlParameters(opponent_goodsExample)));
 }
Exemplo n.º 12
0
 /// <summary>
 /// 插入方法
 /// </summary>
 /// <param name="opponent_goods">opponent_goods表实例</param>
 /// <returns>int</returns>
 public int Insert(opponent_goods opponent_goodsExample)
 {
     DBHelper.sqlstr = "insert into  opponent_goods (odpid,ocollectdate,ogurl,ogtittle,ogprice1,ogprice2,ogdiscount,ogimg,ogsales,ogpostage,ogSKU,ogUPdate,ogDowndate,ogTBid,ogxiaoliang,ogshoucang,ogremark,ogremark1,oshopid,ogremark2,ogremark3,ogremark4,ogremark5)values(@odpid,@ocollectdate,@ogurl,@ogtittle,@ogprice1,@ogprice2,@ogdiscount,@ogimg,@ogsales,@ogpostage,@ogSKU,@ogUPdate,@ogDowndate,@ogTBid,@ogxiaoliang,@ogshoucang,@ogremark,@ogremark1,@oshopid,@ogremark2,@ogremark3,@ogremark4,@ogremark5)";
     return(DBHelper.ExecuteNonQuery(GetSqlParameters(opponent_goodsExample)));
 }
Exemplo n.º 13
0
        /// <summary>
        /// 根据表,获取一个MySqlParameter数组
        /// </summary>
        /// <returns>MySqlParameter[]</returns>
        public static MySqlParameter[] GetSqlParameters(opponent_goods opponent_goodsExample)
        {
            List <MySqlParameter> list_param = new List <MySqlParameter>();

            if (opponent_goodsExample.odpid != 0)
            {
                list_param.Add(new MySqlParameter("@odpid", opponent_goodsExample.odpid));
            }
            else
            {
                list_param.Add(new MySqlParameter("@odpid", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ocollectdate))
            {
                list_param.Add(new MySqlParameter("@ocollectdate", opponent_goodsExample.ocollectdate));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ocollectdate", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ogurl))
            {
                list_param.Add(new MySqlParameter("@ogurl", opponent_goodsExample.ogurl));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ogurl", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ogtittle))
            {
                list_param.Add(new MySqlParameter("@ogtittle", opponent_goodsExample.ogtittle));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ogtittle", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ogprice1))
            {
                list_param.Add(new MySqlParameter("@ogprice1", opponent_goodsExample.ogprice1));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ogprice1", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ogprice2))
            {
                list_param.Add(new MySqlParameter("@ogprice2", opponent_goodsExample.ogprice2));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ogprice2", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ogdiscount))
            {
                list_param.Add(new MySqlParameter("@ogdiscount", opponent_goodsExample.ogdiscount));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ogdiscount", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ogimg))
            {
                list_param.Add(new MySqlParameter("@ogimg", opponent_goodsExample.ogimg));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ogimg", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ogsales))
            {
                list_param.Add(new MySqlParameter("@ogsales", opponent_goodsExample.ogsales));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ogsales", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ogpostage))
            {
                list_param.Add(new MySqlParameter("@ogpostage", opponent_goodsExample.ogpostage));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ogpostage", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ogSKU))
            {
                list_param.Add(new MySqlParameter("@ogSKU", opponent_goodsExample.ogSKU));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ogSKU", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ogUPdate))
            {
                list_param.Add(new MySqlParameter("@ogUPdate", opponent_goodsExample.ogUPdate));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ogUPdate", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ogDowndate))
            {
                list_param.Add(new MySqlParameter("@ogDowndate", opponent_goodsExample.ogDowndate));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ogDowndate", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ogTBid))
            {
                list_param.Add(new MySqlParameter("@ogTBid", opponent_goodsExample.ogTBid));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ogTBid", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ogxiaoliang))
            {
                list_param.Add(new MySqlParameter("@ogxiaoliang", opponent_goodsExample.ogxiaoliang));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ogxiaoliang", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ogshoucang))
            {
                list_param.Add(new MySqlParameter("@ogshoucang", opponent_goodsExample.ogshoucang));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ogshoucang", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ogremark))
            {
                list_param.Add(new MySqlParameter("@ogremark", opponent_goodsExample.ogremark));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ogremark", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ogremark1))
            {
                list_param.Add(new MySqlParameter("@ogremark1", opponent_goodsExample.ogremark1));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ogremark1", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.oshopid))
            {
                list_param.Add(new MySqlParameter("@oshopid", opponent_goodsExample.oshopid));
            }
            else
            {
                list_param.Add(new MySqlParameter("@oshopid", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ogremark2))
            {
                list_param.Add(new MySqlParameter("@ogremark2", opponent_goodsExample.ogremark2));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ogremark2", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ogremark3))
            {
                list_param.Add(new MySqlParameter("@ogremark3", opponent_goodsExample.ogremark3));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ogremark3", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ogremark4))
            {
                list_param.Add(new MySqlParameter("@ogremark4", opponent_goodsExample.ogremark4));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ogremark4", DBNull.Value));
            }

            if (!string.IsNullOrEmpty(opponent_goodsExample.ogremark5))
            {
                list_param.Add(new MySqlParameter("@ogremark5", opponent_goodsExample.ogremark5));
            }
            else
            {
                list_param.Add(new MySqlParameter("@ogremark5", DBNull.Value));
            }
            MySqlParameter[] param = new MySqlParameter[list_param.Count];
            int index = 0;

            foreach (MySqlParameter p in list_param)
            {
                param[index] = p;
                index++;
            }
            return(param);
        }