Пример #1
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";
         }
     }
 }
Пример #2
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);
     }
 }
Пример #3
0
 protected void btnUploadFile_Click(object sender, EventArgs e)
 {
     if (fuImage.HasFile)
     {
         string   path         = Server.MapPath("~") + "Admin\\assets\\images\\";
         string   extension    = Path.GetExtension(fuImage.FileName);
         string   orgImagePath = string.Empty;
         string[] name         = fuImage.FileName.Split(new string[] { extension }, StringSplitOptions.None);
         IMAGE = name[0];
         if (DALAboutUs.HasImage(IMAGE))
         {
             // once orjinal dosyayi bir kaydedelim
             orgImagePath = path + IMAGE + extension;
             fuImage.SaveAs(orgImagePath);
             // simdi sizelara gore kaydedelim
             SaveImage(orgImagePath, Convert.ToInt32(GetPrameterValue("ABOUTUSWIDTH")), Convert.ToInt32(GetPrameterValue("ABOUTUSHEIGHT")), "_l");
             SaveImage(orgImagePath, Convert.ToInt32(GetPrameterValue("SLIDERADMINWIDTH")), Convert.ToInt32(GetPrameterValue("SLIDERADMINHEIGHT")), "_s");
             tdImage.Visible        = false;
             tdImagePreview.Visible = true;
             imgImage.ImageUrl      = Functions.SITEURL.PathAndQuery + "Admin/assets/images/" + IMAGE + "_s" + extension;
             imgImage.Width         = new Unit(GetPrameterValue("SLIDERADMINWIDTH"));
             imgImage.Height        = new Unit(GetPrameterValue("SLIDERADMINHEIGHT"));
         }
         else
         {
             NotificationAdd(NotificationType.error, "Lütfen Resmin Adını Değiştiriniz");
         }
     }
 }
Пример #4
0
 private void fillAbout()
 {
     rptrAbout.Bind(DALAboutUs.GetAll().OrderBy(p => p.ID));
     lblCountAboutUs.Text = "(" + rptrAbout.Items.Count.ToString() + ")";
     foreach (RepeaterItem item in rptrAbout.Items)
     {
         HiddenField hdn = item.FindControl("hdnImage") as HiddenField;
         Image       img = item.FindControl("imgImage") as Image;
         img.ImageUrl = Functions.SITEURL.PathAndQuery + "Admin/assets/images/" + hdn.Value + "_s.jpg";
         img.Width    = new Unit(GetPrameterValue("SLIDERADMINWIDTH"));
         img.Height   = new Unit(GetPrameterValue("SLIDERADMINHEIGHT"));
     }
     rptrCounter.Bind(DALAboutUsCounter.GetAll().OrderBy(p => p.ID));
     lblCountCounter.Text = "(" + rptrCounter.Items.Count.ToString() + ")";
 }