private void initControl(int Id)
 {
     if (Id > 0)
     {
         btn_add.Visible = false;
         btn_edit.Visible = true;
         try
         {
             LinkBSO linkBSO = new LinkBSO();
             Link link = linkBSO.GetLinkById(Id);
             hddLinkID.Value = Convert.ToString(link.LinkID);
             hddLinkImageThumb.Value = link.LinkImage;
             uploadPreview.Src = ResolveUrl("~/Upload/Link/") + link.LinkImage;
             txtLinkUrl.Text = link.LinkUrl;
             txtLinkWidth.Text = Convert.ToString(link.LinkWidth);
             txtLinkHeight.Text = Convert.ToString(link.LinkHeight);
             rdbLinkStatus.SelectedValue = Convert.ToString(link.LinkStatus);
         }
         catch (Exception ex)
         {
             clientview.Text = ex.Message.ToString();
         }
     }
     else
     {
         btn_add.Visible = true;
         btn_edit.Visible = false;
     }
 }
 private void ViewLogo()
 {
     LinkBSO linkBSO = new LinkBSO();
     DataTable table = linkBSO.GetLinkAll();
     DataView dv = new DataView(table);
     dv.RowFilter = "LinkType=1";
     commonBSO commonBSO = new commonBSO();
     commonBSO.FillToGridView(grvLink, dv.ToTable());
 }
Ejemplo n.º 3
0
 public void LoadDoiTac()
 {
     LinkBSO linkBSO = new LinkBSO();
     DataTable table = linkBSO.GetLinkAll();
     if (table.Rows.Count > 0)
     {
     cdcatalog.DataSource=table;
     cdcatalog.DataBind();
     }
 }
        private void ViewAdv()
        {
            LinkBSO advBSO = new LinkBSO();
            DataTable table = advBSO.GetLinkAll();
            DataView dataView = new DataView(table);
            dataView.RowFilter = "LinkStatus = 'True' and LinkType=1";

            //  RadRotator1.RotatorType = RotatorType.AutomaticAdvance;
            RadRotator1.DataSource = dataView;
            RadRotator1.DataBind();
        }
 protected void grvLink_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     int Id = Convert.ToInt32(e.CommandArgument.ToString());
     string cName = e.CommandName.ToLower();
     switch (cName)
     {
         case "_edit":
             Response.Redirect("~/Admin/EditImageSlideShow/" + Id + "/Default.aspx");
             break;
         case "_delete":
             LinkBSO linkBSO = new LinkBSO();
             linkBSO.DeleteLink(Id);
             ViewLogo();
             break;
     }
 }
 protected void btn_add_Click(object sender, EventArgs e)
 {
     try
     {
         Link link = ReceiveHtml();
         if (String.IsNullOrEmpty(link.LinkImage))
         {
             clientview.Text = String.Format(Resources.StringAdmin.CheckImage);
         }
         else
         {
             LinkBSO linkBSO = new LinkBSO();
             linkBSO.CreateLink(link);
             clientview.Text = String.Format(Resources.StringAdmin.AddNewsSuccessful);
         }
     }
     catch (Exception ex)
     {
         clientview.Text = ex.Message.ToString();
     }
 }