Example #1
0
    public void Del(string LinkId)
    {
        string Logo = "";

        try
        {
            if (bll.GetLinkById(LinkId) != null)
            {
                Logo = (bll.GetLinkById(LinkId).Rows[0]["Logo"] == DBNull.Value) ? "" : bll.GetLinkById(LinkId).Rows[0]["Logo"].ToString();
            }
            if (bll.DelLinkById(LinkId))
            {
                if (Logo.Length > 0)
                {
                    string[]       str    = Logo.Split('/');
                    imgBiz.Service serBiz = new imgBiz.Service(); //webservice
                    serBiz.delCrmImage(str[5], str[4]);
                }
                Tz888.Common.MessageBox.ShowAndRedirect(this.Page, "删除成功!", "LinkManage.aspx", false);
            }
            else
            {
                Tz888.Common.MessageBox.Show(this.Page, "删除失败!");
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
Example #2
0
 protected void BtnModfiy_Click(object sender, EventArgs e)
 {
     try
     {
         Tz888.Model.Link.LinkInfoTab Model = new Tz888.Model.Link.LinkInfoTab();
         Model.LinkInfoId   = (ViewState["LinkInfoId"] == null) ? 0 : Convert.ToInt32(ViewState["LinkInfoId"].ToString());
         Model.LinkInfoName = txtLinkName.Value.Trim();
         Model.ChannelId    = Convert.ToInt32(DropChannel.SelectedValue);
         Model.LinkId       = Convert.ToInt32(DropLinkType.SelectedValue);
         Model.LinkUrl      = txtLinkUrl.Value.Trim();
         Model.Sort         = (txtSort.Value.Trim() == "") ? 0 : Convert.ToInt32(txtSort.Value.Trim());
         Model.Logo         = (ViewState["Logo"] == null) ? "" : ViewState["Logo"].ToString();
         Model.Remarks      = txtRemarks.Value.Trim();
         if (LinkInfoBll.ModfiyLink(Model))
         {
             string strs = ViewState["odlLogo"].ToString();
             if (strs.Length > 0)
             {
                 string[]       str    = strs.Split('/');
                 imgBiz.Service serBiz = new imgBiz.Service(); //webservice
                 serBiz.delCrmImage(str[5], str[4]);
             }
             Tz888.Common.MessageBox.ShowAndRedirect(this.Page, "修改成功!", "LinkManage.aspx", false);
         }
         else
         {
             Tz888.Common.MessageBox.Show(this.Page, "修改失败!");
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }