Example #1
0
        public static bool AddTask(string itemNo)
        {
            Item itm = TBOnSalePro.GetItemByID(Users.SessionKey, itemNo);

            if (itm != null)
            {
                TuiguangPro obj = new TuiguangPro();
                obj.ItemNo     = itemNo;
                obj.SellerNick = Users.Nick;
                obj.ItemPicUrl = itm.PicUrl;
                obj.ItemTitle  = itm.Title;
                obj.ItemUrl    = itm.DetailUrl;
                obj.Price      = itm.Price;
                obj.Inventory  = itm.SoldQuantity.ToString();
                obj.TuiStatus  = "1";// 1:推广中 0:下架中
                obj.EndUseTime = Users.Deadline == null ? "" : Users.Deadline;
                //分配或者获取Openid
                string    openID   = "";
                DataTable tbOpenid = tuiGuangDAL.GetTuiGuangOpenID(Users.Nick);
                if (tbOpenid != null && tbOpenid.Rows.Count == 1)
                {
                    openID = tbOpenid.Rows[0]["openId"].ToString();
                }
                else
                {
                    DataTable tbSytemOpenIds = tuiGuangDAL.GetSystemOpenIDs();
                    if (tbSytemOpenIds != null && tbSytemOpenIds.Rows.Count > 0)
                    {
                        for (int i = 0; i < tbSytemOpenIds.Rows.Count; i++)
                        {
                            string openId = tbSytemOpenIds.Rows[i]["openid"].ToString();
                            if (tuiGuangDAL.ChekOpenIDCanUsed(openId))
                            {
                                openID = openId;
                                //执行更新操作,将分配的OPENID占用
                                tuiGuangDAL.UpdateOpenStatus(openId);
                                break;
                            }
                        }
                    }
                }
                obj.OpenId = openID;
                if (!string.IsNullOrEmpty(openID))
                {
                    obj.TuiAddress = "http://youmuya.wx.jaeapp.com/index.php/Home/Choice/shareGoodsDetail/gid/" + openID + ".html";
                    if (tuiGuangDAL.AddTuiGuang(obj))
                    {
                        return(true);
                    }
                }
                else
                {
                    return(false);
                }
            }
            return(false);
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                //if (!Users.OrderVersion.Equals("流量推广") && !Users.OrderVersion.Equals("全功能版"))
                //{
                //    Response.Write("<script languge='javascript'>alert('没有权限使用,请订购对应的软件版本'); window.location.href='http://fuwu.taobao.com/ser/detail.htm?service_code=ts-1811102'</script>");
                //    return;
                //}

                lab_Nick.Text        = Users.Nick;
                lbVersion.Text       = Users.OrderVersion;
                Label1.Text          = Users.Nick;
                totalOnsalCount.Text = TBOnSalePro.GetAllOnSalePro(Users.SessionKey);
                DataTable tb = tuiGuangBLL.GetTuiGuangItems();
                Label2.Text = tb == null ? "0" : tb.Rows.Count.ToString();
            }
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                lab_Nick.Text              = Users.Nick;
                lbVersion.Text             = Users.OrderVersion;
                txt_nick.Text              = Users.Nick;
                drpCatsList.DataSource     = TBOnSalePro.GetCatsList(Users.SessionKey, Users.Nick);
                drpCatsList.DataTextField  = "name";
                drpCatsList.DataValueField = "cid";
                drpCatsList.DataBind();
                drpCatsList.Items.Insert(0, "--选择店铺主营目录--");

                //BandData
                DataTable tb = tuiGuangBLL.GetShopInfo(Users.Nick);
                if (tb != null && tb.Rows.Count == 1)
                {
                    lab_Nick.Text = tb.Rows[0]["shopName"].ToString();
                    drpCatsList.SelectedItem.Text = tb.Rows[0]["cateName"].ToString();
                    if (tb.Rows[0]["type"].ToString().Equals("个人兼职"))
                    {
                        rdoLst1.SelectedIndex = 0;
                    }
                    if (tb.Rows[0]["type"].ToString().Equals("个人全职"))
                    {
                        rdoLst1.SelectedIndex = 1;
                    }
                    if (tb.Rows[0]["type"].ToString().Equals("公司开店"))
                    {
                        rdoLst1.SelectedIndex = 2;
                    }
                    txtAdderss.Text = tb.Rows[0]["address"].ToString();
                    if (tb.Rows[0]["huoyuan"].ToString().Equals("线下批发市场"))
                    {
                        rdoLst2.SelectedIndex = 0;
                    }
                    if (tb.Rows[0]["huoyuan"].ToString().Equals("实体店拿货"))
                    {
                        rdoLst2.SelectedIndex = 1;
                    }
                    if (tb.Rows[0]["huoyuan"].ToString().Equals("阿里巴巴批发"))
                    {
                        rdoLst2.SelectedIndex = 2;
                    }
                    if (tb.Rows[0]["huoyuan"].ToString().Equals("分销/代销"))
                    {
                        rdoLst2.SelectedIndex = 3;
                    }
                    if (tb.Rows[0]["huoyuan"].ToString().Equals("自己生产"))
                    {
                        rdoLst2.SelectedIndex = 4;
                    }
                    if (tb.Rows[0]["huoyuan"].ToString().Equals("代工生产"))
                    {
                        rdoLst2.SelectedIndex = 5;
                    }
                    if (tb.Rows[0]["huoyuan"].ToString().Equals("自由公司渠道"))
                    {
                        rdoLst2.SelectedIndex = 6;
                    }
                    if (tb.Rows[0]["huoyuan"].ToString().Equals("货源还未确定"))
                    {
                        rdoLst2.SelectedIndex = 7;
                    }

                    if (tb.Rows[0]["hasShiTiShop"].ToString().Equals("是"))
                    {
                        rdoLst3.SelectedIndex = 0;
                    }
                    if (tb.Rows[0]["hasShiTiShop"].ToString().Equals("否"))
                    {
                        rdoLst3.SelectedIndex = 1;
                    }
                    if (tb.Rows[0]["hasFactory"].ToString().Equals("是"))
                    {
                        rdoLst4.SelectedIndex = 0;
                    }
                    if (tb.Rows[0]["hasFactory"].ToString().Equals("否"))
                    {
                        rdoLst4.SelectedIndex = 1;
                    }
                }
            }
            lbMsg.Text = "";
        }