Esempio n. 1
0
    private bool DoEdit(int _id)
    {
        try
        {
            Cms.BLL.sc_stores   bll   = new Cms.BLL.sc_stores();
            Cms.Model.sc_stores model = bll.GetModel(_id);


            model.location  = Province.SelectedValue;
            model.city      = City.SelectedValue;
            model.county    = District.SelectedValue;
            model.storename = txtTitle.Text.Trim();
            model.sort_id   = int.Parse(txtSortId.Text.Trim());
            string urlhot = Request.Url.Host.ToString();
            if (txtImgUrl.Value.IndexOf("http") > -1 || txtImgUrl.Value.IndexOf("HTTP") > -1 || txtImgUrl.Value.IndexOf("https") > -1 || txtImgUrl.Value.IndexOf("HTTPS") > -1)
            {
                urlhot = "";
            }
            else
            {
                urlhot = "http://" + urlhot;
            }

            model.picurl  = urlhot + txtImgUrl.Value.Trim();
            model.linkurl = txtLinkUrl.Text.Trim();

            model.info      = txtContent.Value;
            model.isHidden  = Convert.ToInt32(this.isHidden.SelectedValue);//显示状态
            model.latitude  = tblatitude.Text;
            model.longitude = tblongitude.Text;
            // model.updatetime = DateTime.Now;
            model.tel              = tbphone.Text;
            model.address          = tbaddress.Text;
            model.verificationPass = verificationPass.Text;

            if (bll.Update(model))
            {
                return(true);
            }
        }
        catch
        {
            return(false);
        }
        return(false);
    }
Esempio n. 2
0
    private void ShowInfo(int _id)
    {
        Cms.BLL.sc_stores   bll   = new Cms.BLL.sc_stores();
        Cms.Model.sc_stores model = bll.GetModel(_id);

        this.Province.SelectedValue = model.location;
        bind_City(Convert.ToInt32(model.location), City);
        this.City.SelectedValue = model.city;
        bind_District(Convert.ToInt32(model.city), District);
        this.District.SelectedValue = model.county;
        txtTitle.Text               = model.storename;
        txtSortId.Text              = model.sort_id.ToString();
        tblatitude.Text             = model.latitude;
        Application["latitude"]     = model.latitude;
        Application["longitude"]    = model.longitude;
        tblongitude.Text            = model.longitude;
        txtLinkUrl.Text             = model.linkurl;
        txtImgUrl.Value             = model.picurl;
        txtContent.Value            = model.info;
        this.isHidden.SelectedValue = model.isHidden.ToString();//显示状态
        tbphone.Text          = model.tel;
        tbaddress.Text        = model.address;
        verificationPass.Text = model.verificationPass;
    }
Esempio n. 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Cms.Model.sc_stores model)
 {
     return(dal.Update(model));
 }
Esempio n. 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Cms.Model.sc_stores model)
 {
     return(dal.Add(model));
 }