Exemplo n.º 1
0
 protected void Update_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         Data.Advertise obj = new Data.Advertise();
         obj.Id       = Id;
         obj.Name     = txtName.Text;
         obj.Image    = txtImage.Text;
         obj.Width    = txtWidth.Text;
         obj.Height   = txtHeight.Text;
         obj.Link     = txtLink.Text;
         obj.Target   = ddlTarget.SelectedValue;
         obj.Content  = "";
         obj.Position = ddlPosition.SelectedValue;
         obj.PageId   = "0";
         obj.Ord      = txtOrd.Text != "" ? txtOrd.Text : "1";
         obj.Active   = chkActive.Checked ? "1" : "0";
         obj.Click    = "0";
         obj.Language = ddlLanguage.SelectedValue;
         if (Insert == true)
         {
             AdvertiseService.Advertise_Insert(obj);
         }
         else
         {
             AdvertiseService.Advertise_Update(obj);
         }
         BindGrid();
         pnView.Visible   = true;
         pnUpdate.Visible = false;
         Insert           = false;
     }
 }