コード例 #1
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (ValidateItem())
     {
         ABOUTUS rec = new ABOUTUS();
         if (RECid > 0)
         {
             rec = DALAboutUs.Get(RECid);
             if (!string.IsNullOrEmpty(IMAGE))
             {
                 rec.IMAGE = IMAGE;
             }
             rec.ALT      = txtAlt.Text;
             rec.ISACTIVE = chkActive.Checked;
             rec.MAINTEXT = Server.HtmlEncode(hdnDescription.Value);
             rec.TITLE    = txtTitle.Text;
             DALAboutUs.Update(rec);
         }
         else
         {
             rec.IMAGE    = IMAGE;
             rec.ALT      = txtAlt.Text;
             rec.ISACTIVE = chkActive.Checked;
             rec.MAINTEXT = Server.HtmlEncode(hdnDescription.Value);
             rec.TITLE    = txtTitle.Text;
             DALAboutUs.Insert(rec);
         }
         ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ClosePage", "CloseModal(true);", true);
     }
 }
コード例 #2
0
 private void InitializePage()
 {
     if (!string.IsNullOrEmpty(Request.QueryString["ID"]))
     {
         RECid = Convert.ToInt16(Request.QueryString["ID"]);
         ABOUTUS item = DALAboutUs.Get(RECid);
         if (item != null)
         {
             if (string.IsNullOrEmpty(item.IMAGE))
             {
                 tdImage.Visible = true;
             }
             else
             {
                 tdImage.Visible        = true;
                 tdImagePreview.Visible = true;
             }
             imgImage.ImageUrl    = Functions.SITEURL.PathAndQuery + "Admin/assets/images/" + item.IMAGE + "_s.jpg";
             imgImage.Width       = new Unit(GetPrameterValue("SLIDERADMINWIDTH"));
             imgImage.Height      = new Unit(GetPrameterValue("SLIDERADMINHEIGHT"));
             txtAlt.Text          = item.ALT;
             txtTitle.Text        = item.TITLE;
             chkActive.Checked    = item.ISACTIVE;
             hdnDescription.Value = Server.HtmlDecode(item.MAINTEXT);
             btnSave.Text         = "Güncelle";
         }
     }
 }