protected void btnUpload_Click(object sender, EventArgs e)
        {
            try
            {
                if (IsPassValidation())
                {
                    TBProductUploadService tbService = new TBProductUploadService();

                    tbService.UploadProduct(ddlProductSet.SelectedItem.Text);
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message.Replace("\n", "\\n").Replace("\r", "");
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('" + message + "')", true);
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (tbTitle.Text.Length <= 30)
                {
                    using (CatalogDataContext dct = new CatalogDataContext())
                    {
                        var p = dct.SS_Products.SingleOrDefault(o => o.product_id == productid);

                        if (p != null)
                        {
                            p.chinese_name = tbTitle.Text;
                            p.chinese_description = FCKeditor1.Value;
                            p.istranslated = true;
                            dct.SubmitChanges();

                            var tbp = dct.TB_Products.SingleOrDefault(t => t.SSProductID == productid);

                            if (tbp == null)
                            {

                                TBProductUploadService toTaobao = new TBProductUploadService();
                                toTaobao.ConvertSSProductToTaoBao(productid);
                            }
                            else
                            {
                                tbp.Title = tbTitle.Text;
                                tbp.Desc = FCKeditor1.Value;
                                dct.SubmitChanges();
                            }

                            ScriptManager.RegisterStartupScript(this, this.GetType(), "aa", "alert('提交成功');", true);
                        }

                        //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Close", "window.close()", true);

                    }
                }
                else
                    throw new ApplicationException("商品题目超过30个字节");
            }
            catch (Exception ex)
            {

                string message = ex.Message.Replace("\n", "\\n").Replace("\r", "").Replace("'", "\\'");
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('" + message + "')", true);
            }
        }
 protected void btnInitTBItemProp_Click(object sender, EventArgs e)
 {
     TBProductUploadService tbService = new TBProductUploadService();
     tbService.InitializationItemProp();
 }