예제 #1
0
 private void PromotionType()
 {
     Tz888.Model.SubscribeSet model = new Tz888.Model.SubscribeSet();
     Tz888.BLL.SubscribeSet   bll   = new Tz888.BLL.SubscribeSet();
     model         = bll.GetModels(id, out infotypeid, out htmlFile);
     SubscribeType = model.SubscribeType.Split(new char[] { ',' });    //推广类型
 }
예제 #2
0
    private void bind()
    {
        Tz888.BLL.Conn           dal       = new Tz888.BLL.Conn();
        Tz888.BLL.SubscribeSet   bll       = new Tz888.BLL.SubscribeSet();
        Tz888.BLL.InnerInfo      infoBLL   = new Tz888.BLL.InnerInfo();
        Tz888.Model.InnerInfo    infomodel = new Tz888.Model.InnerInfo();
        Tz888.Model.SubscribeSet model     = new Tz888.Model.SubscribeSet();
        model  = bll.GetModels(id, out infotypeid, out htmlFile);
        InfoID = model.InfoID;
        title  = model.Title;
        bll.GetDescript(InfoID, infotypeid.Trim(), out descript);
        long CurrPage   = Convert.ToInt64(ViewState["CurrPage"]);
        long TotalCount = 0;

        string[] countryCode    = model.CountryCode.Split(new char[] { ',' });
        string[] provinceID     = model.ProvinceID.Split(new char[] { ',' });
        string[] cityid         = model.CityID.Split(new char[] { ',' });
        string[] countyId       = model.CountyID.Split(new char[] { ',' });
        string[] objectGradeID  = model.objectGradeID.Split(new char[] { ',' });
        string[] ManageTypeId   = model.ManageTypeId.Split(new char[] { ',' });
        string[] Promotioncount = model.Promotioncount.Split(new char[] { ',' }); //推广条数
        SubscribeType = model.SubscribeType.Split(new char[] { ',' });            //推广类型

        SubType = model.SubscribeType;
        ViewState["SubType"] = SubType;
        string strWhere   = "";
        int    countTatol = 0;

        for (int i = 0; i < countryCode.Length - 1; i++)
        {
            if (objectGradeID[i] != "")
            {
                strWhere += " memberGradeId='" + objectGradeID[i] + "'";//'1001'";
            }
            if (ManageTypeId[i] != "")
            {
                strWhere += " and ManageTypeId='" + ManageTypeId[i] + "'";//'2003'"
            }
            ViewState["strWhere"] = strWhere;
            if (provinceID[i] != "")
            {
                if (countyId[i] != "" && cityid[i] != "") //区

                {
                    strWhere += " and countyId='" + countyId[i] + "'";
                    SendSummey(dal, descript, htmlFile, ref CurrPage, ref TotalCount, Promotioncount, SubscribeType, ref strWhere, ref countTatol);
                }
                if (!site || !email || !phone)
                {
                    if (cityid[i] != "")//市

                    {
                        strWhere += " and CityId='" + cityid[i] + "'";
                        SendSummey(dal, descript, htmlFile, ref CurrPage, ref TotalCount, Promotioncount, SubscribeType, ref strWhere, ref countTatol);
                    }
                }
            }
            if (!site || !email || !phone)
            {
                if (provinceID[i] != "")//省

                {
                    strWhere += " and provinceID='" + provinceID[i] + "'";
                    SendSummey(dal, descript, htmlFile, ref CurrPage, ref TotalCount, Promotioncount, SubscribeType, ref strWhere, ref countTatol);
                }
            }
            if (!site || !email || !phone)
            {
                if (countryCode[i] != "")
                {
                    strWhere += " countryCode='" + countryCode[i] + "'";//国家
                    SendSummey(dal, descript, htmlFile, ref CurrPage, ref TotalCount, Promotioncount, SubscribeType, ref strWhere, ref countTatol);
                }
            }
            if (!site || !email || !phone)
            {
                SendSummey(dal, descript, htmlFile, ref CurrPage, ref TotalCount, Promotioncount, SubscribeType, ref strWhere, ref countTatol);
            }
            break;
        }
    }
예제 #3
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        #region
        int phone = 0;
        int email = 0;
        if (Zone.CapitalInfoAreaModels.Count == 0)
        {
            lblMsg.Text = "你选择你要推广的区域";
            Zone.CapitalInfoAreaModels.Clear();
            return;
        }
        if (chkType.SelectedValue == "")
        {
            lblMsg.Text = "请至少选择一个受众需求";
            return;
        }
        if (!cbkPhone.Checked && !cbkShort.Checked)
        {
            lblMsg1.Text = "请至少选择一个推广方式";
            return;
        }
        if (txtPromotionShortSum.Text.Trim() == "0")
        {
            lblMsg1.Text = "推广数量不能为零";
            return;
        }
        if (cbkShort.Checked && string.IsNullOrEmpty(txtPromotionShortSum.Text.Trim()))
        {
            lblMsg1.Text = "请输入你要推广的数量";
            return;
        }
        if (txtPromotionShortSum.Text.IndexOf("-") != -1)
        {
            lblMsg1.Text = "推广的数量只能为整数";
            return;
        }
        try
        {
            email = int.Parse(txtPromotionShortSum.Text.Trim());
        }
        catch (Exception) { lblMsg1.Text = "推广数量只能为整数"; return; }
        if (txtPromotionPhoneSum.Text.Trim() == "0")
        {
            lblMsg1.Text = "推广数量不能为零";
            return;
        }
        if (txtPromotionPhoneSum.Text.IndexOf("-") != -1)
        {
            lblMsg1.Text = "推广的数量只能为整数";
            return;
        }
        if (cbkPhone.Checked && string.IsNullOrEmpty(txtPromotionPhoneSum.Text.Trim()))
        {
            lblMsg1.Text = "请输入你要推广的数量";
            return;
        }
        if (!cbkPhone.Checked && txtPromotionPhoneSum.Text.Trim() != "")
        {
            lblMsg1.Text = "请选中您的推广方式";
            return;
        }
        try
        {
            if (txtPromotionPhoneSum.Text == "")
            {
                txtPromotionPhoneSum.Text = "0";
            }
            else
            {
                phone = int.Parse(txtPromotionPhoneSum.Text.Trim());
            }
        }
        catch (Exception)
        { lblMsg1.Text = "推广数量只能为整数"; return; }
        #endregion
        Tz888.BLL.SubscribeSet   dal   = new Tz888.BLL.SubscribeSet();
        Tz888.Model.SubscribeSet model = new Tz888.Model.SubscribeSet();
        List <Tz888.Model.Common.IndustryModel>      industryModel = new List <Tz888.Model.Common.IndustryModel>();      //融资行业实体列表
        List <Tz888.Model.Info.CapitalInfoAreaModel> AreaModel     = new List <Tz888.Model.Info.CapitalInfoAreaModel>(); //投资区域信息实体列表

        model.LoginName     = loginname;
        model.objectGradeID = rabGradeID.SelectedValue.ToString();
        string type   = "";
        string matype = "";
        for (int i = 0; i < chkType.Items.Count; i++)
        {
            if (chkType.Items[i].Selected)
            {
                switch (chkType.Items[i].Value.ToString())
                {
                case "2001":    //政府招商机构
                    matype += "2001,";
                    break;

                case "2002":     //投资方
                    matype += "2002, ";
                    break;

                case "2003":    //项目方
                    matype += "2003,";
                    break;

                case "2004":    //中介机构
                    matype += "2004,";
                    break;

                case "2006":    //中介机构
                    matype += "2006,";
                    break;

                default:
                    break;
                }
                type += chkType.Items[i].Value.ToString() + ",";
            }
        }
        model.ManageTypeId = matype;
        model.objectNeed   = type;
        AreaModel          = this.Zone.CapitalInfoAreaModels;
        //industryModel = this.Industry.IndustryModels;
        for (int i = 0; i < AreaModel.Count; i++)
        {
            model.CountryCode += AreaModel[i].CountryCode + ",";
            model.ProvinceID  += AreaModel[i].ProvinceID + ",";
            model.CityID      += AreaModel[i].CityID + ",";
            model.CountyID    += AreaModel[i].CountyID + ",";
        }
        string industry = "";
        for (int j = 0; j < industryModel.Count; j++)
        {
            industry += industryModel[j].IndustryBID + ",";
        }
        model.Industry = industry;
        //2010-06-18
        if (cbkShort.Checked)
        {
            model.SubscribeType  += "1,2" + ","; //站内短信
            model.Promotioncount += txtPromotionShortSum.Text.Trim() + "," + txtPromotionShortSum.Text.Trim() + ",";
        }
        else
        {
            model.SubscribeType  += ","; //站内短信
            model.Promotioncount += ",";
        }
        if (cbkPhone.Checked)
        {
            model.SubscribeType  += "3,"; //手机短信
            model.Promotioncount += txtPromotionPhoneSum.Text.Trim() + ",";
        }
        else
        {
            model.SubscribeType  += ","; //手机短信
            model.Promotioncount += ",";
        }

        model.SubscribeCount = phone + email;
        int totalPrice = phone * 1 + email * 1;
        //end
        bool b  = false;
        int  id = 0;
        for (int i = 0; i < InfoIDArrList.Length; i++)
        {
            if (InfoIDArrList[i].ToString() != "")
            {
                model.InfoID = Convert.ToInt32(InfoIDArrList[i]);
                id           = 0;
                b            = dal.SendSet1(model, out id);
            }
        }
        if (b)
        {
            //2010-06-18新增
            Tz888.BLL.Info.MainInfoBLL bll = new Tz888.BLL.Info.MainInfoBLL();
            bll.UpdatePromotionStatu(long.Parse(InfoID), 1);
            Response.Redirect("order_item_promotion.aspx?smscount=" + Server.UrlEncode(model.SubscribeCount.ToString()) + "&price=" + totalPrice + "&Id=" + id, false);
            //Response.Redirect("http://union2.topfo.com/IndexUnion.aspx");
            //Tz888.Common.MessageBox.ResponseScript(this.Page, "alert('设置成功!'),window.close();");
        }
    }