예제 #1
0
    public void bind()
    {
        Tz888.BLL.SubscribeSet      bll   = new Tz888.BLL.SubscribeSet();
        Tz888.Model.SubscribeGetSet model = bll.GetModel(loginname);
        if (model == null)
        {
            return;
        }
        string[] type = model.ReveiveType.ToString().Split(new char[] { ',' });
        for (int i = 0; i < type.Length; i++)
        {
            switch (type[i].Trim())
            {
            case "1":
                cbkEmail.Checked = true;
                break;

            case "3":
                cbkMobile.Checked = true;
                break;

            default:
                break;
            }
        }
        Tz888.BLL.Conn dalConn = new Tz888.BLL.Conn();
        DataTable      dt      = dalConn.GetList("UserParametersTab", "NoticeEmail,NoticeMobile,infocheckNotice", "ParID", 1, 1, 0, 1, "LoginName='" + loginname + "'");

        if (dt.Rows.Count > 0)
        {
            ViewState["Email"] = dt.Rows[0]["NoticeEmail"].ToString();
            txtMobile.Value    = dt.Rows[0]["NoticeMobile"].ToString();
        }
        int isget = model.IsGet;

        if (isget == 1)
        {
            isShow.Style.Add("display", "");
        }
        else
        {
            isShow.Style.Add("display", "none");
        }
        //rabIsGet.SelectedValue = model.IsGet.ToString();
        rabGradeID.SelectedValue = model.objectGradeID.Trim();
        string need = model.objectNeed.Trim();
        string strneed;

        for (int i = 0; i < chkNeed.Items.Count; i++)
        {
            strneed = chkNeed.Items[i].Value;
            if (need.IndexOf(strneed) != -1)
            {
                chkNeed.Items[i].Selected = true;
            }
        }
        //地区
        List <Tz888.Model.Info.CapitalInfoAreaModel> lists = new List <Tz888.Model.Info.CapitalInfoAreaModel>();

        string[] countrycode = model.CountryCode.Trim().Split(',');
        string[] province    = model.ProvinceID.Split(',');
        string[] city        = model.CityID.Trim().Split(',');
        string[] county      = model.CountyID.Trim().Split(',');
        for (int i = 0; i < countrycode.Length - 1; i++)
        {
            Tz888.Model.Info.CapitalInfoAreaModel Areamodel = new Tz888.Model.Info.CapitalInfoAreaModel();
            Areamodel.CountryCode = countrycode[i].Trim();
            try { Areamodel.ProvinceID = province[i].Trim(); }
            catch { Areamodel.ProvinceID = ""; };
            try { Areamodel.CityID = city[i].Trim(); }
            catch { Areamodel.CityID = ""; }
            try { Areamodel.CountyID = county[i].Trim(); }
            catch { Areamodel.CountyID = ""; }
            lists.Add(Areamodel);
            this.ZoneControl.CapitalInfoAreaModels = lists;
        }
        //行业
        //this.IndustryControl.IndustryString = model.Industry.Trim();
        //接收方式
        string gettype = model.ReveiveType.Trim();
        string str;
        //for (int i = 0; i < chkGetType.Items.Count; i++)
        //{
        //    str = chkGetType.Items[i].Value;
        //    if (gettype.IndexOf(str) != -1)
        //        chkGetType.Items[i].Selected = true;
        //}
    }
예제 #2
0
    public void bind()
    {
        if (InfoIDArrList.Length == 1 || InfoIDArrList.Length == 2)
        {
            Tz888.BLL.Conn dal = new Tz888.BLL.Conn();
            DataTable      dt  = dal.GetList("SubscribeSetTab", "*", "ID", 1, 1, 0, 1, "LoginName='" + loginname + "' and InfoID=" + Convert.ToInt64(InfoIDArrList[0].Trim()));
            if (dt.Rows.Count > 0)
            {
                rabGradeID.SelectedValue = dt.Rows[0]["objectGradeID"].ToString();
                //txtSendCount.Text = dt.Rows[0]["SubscribeCount"].ToString();
                if (dt.Rows[0]["objectNeed"].ToString().Trim() != "")
                {
                    string need = dt.Rows[0]["objectNeed"].ToString().Trim();
                    string strneed;
                    for (int i = 0; i < chkType.Items.Count; i++)
                    {
                        strneed = chkType.Items[i].Value;
                        if (need.IndexOf(strneed) != -1)
                        {
                            chkType.Items[i].Selected = true;
                        }
                    }
                }
                //2010-06-18
                if (dt.Rows[0]["SubscribeType"].ToString().Trim() != "")
                {
                    string[] SubscribeType  = dt.Rows[0]["SubscribeType"].ToString().Split(new char[] { ',' });
                    string[] Promotioncount = dt.Rows[0]["Promotioncount"].ToString().Split(new char[] { ',' });
                    if (SubscribeType.Length > 0)
                    {
                        for (int i = 0; i < SubscribeType.Length; i++)
                        {
                            try
                            {
                                switch (SubscribeType[i].ToString())
                                {
                                case "1":     //站内短信
                                    cbkShort.Checked = true;
                                    if (Promotioncount[i] != "")
                                    {
                                        txtPromotionShortSum.Text = Promotioncount[i].ToString();
                                    }
                                    break;

                                case "3":     //手机短信
                                    cbkPhone.Checked = true;
                                    if (Promotioncount[i] != "")
                                    {
                                        txtPromotionPhoneSum.Text = Promotioncount[i].ToString();
                                    }
                                    break;

                                default:
                                    break;
                                }
                            }
                            catch (Exception) { throw; }
                        }
                    }
                }
                //end
                //地区
                List <Tz888.Model.Info.CapitalInfoAreaModel> lists = new List <Tz888.Model.Info.CapitalInfoAreaModel>();
                string[] countrycode = dt.Rows[0]["countrycode"].ToString().Trim().Split(',');
                string[] province    = dt.Rows[0]["provinceid"].ToString().Trim().Split(',');
                string[] city        = dt.Rows[0]["cityid"].ToString().Trim().Split(',');
                string[] county      = dt.Rows[0]["countyid"].ToString().Trim().Split(',');
                for (int i = 0; i < countrycode.Length - 1; i++)
                {
                    Tz888.Model.Info.CapitalInfoAreaModel Areamodel = new Tz888.Model.Info.CapitalInfoAreaModel();

                    Areamodel.CountryCode = countrycode[i].Trim();
                    try { Areamodel.ProvinceID = province[i].Trim(); }
                    catch { Areamodel.ProvinceID = ""; };
                    try { Areamodel.CityID = city[i].Trim(); }
                    catch { Areamodel.CityID = ""; }
                    try { Areamodel.CountyID = county[i].Trim(); }
                    catch { Areamodel.CountyID = ""; }
                    lists.Add(Areamodel);
                    this.Zone.CapitalInfoAreaModels = lists;
                }
                //行业
                //this.Industry.IndustryString = dt.Rows[0]["Industry"].ToString().Trim();
            }
        }
    }