Beispiel #1
0
    protected void myList_ItemCommand(object sender, RepeaterCommandEventArgs e)
    {
        long   InfoID = Convert.ToInt64(e.CommandArgument);
        string msg    = "";

        Tz888.BLL.Info.MainInfoBLL bll = new Tz888.BLL.Info.MainInfoBLL();
        switch (e.CommandName)
        {
        case "Delete":
            string ErrorMsg = "";
            if (!bll.UpdatePromotionStatu(InfoID, 0))
            {
                msg += "[" + InfoID.ToString() + "]删除失败!" + ErrorMsg + "\n";
            }

            if (!string.IsNullOrEmpty(msg))
            {
                Tz888.Common.MessageBox.Show(this.Page, msg);
            }
            this.bind();
            break;

        default:
            break;
        }
    }
Beispiel #2
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();");
        }
    }