Beispiel #1
0
    protected void btn_seo_Click(object sender, EventArgs e)
    {
        Seo s = new Seo()
        {
            Title    = txt_seo_title.Text,
            Meta     = txt_seo_meta.Text,
            MetaKeys = txt_seo_keywords.Text
        };

        dcx.Seos.InsertOnSubmit(s);
        dcx.SubmitChanges();
    }
Beispiel #2
0
    protected void btnSend_Click(object sender, EventArgs e)
    {
        string ad    = txtAd.Text;
        string email = txtEmail.Text;
        string tel   = txtTel.Text;
        string mesaj = txtMesaj.Text;

        try
        {
            Contact c = new Contact
            {
                Email   = txtEmail.Text,
                Name    = txtAd.Text,
                Message = txtMesaj.Text,
                Phone   = txtTel.Text,
                Date    = DateTime.Now,
                Summary = txtKonu.Text
            };
            dcx.Contacts.InsertOnSubmit(c);
            dcx.SubmitChanges();
            KavsitWeb.SendMail("*****@*****.**", "Blog İletişim Mesajı", "Gönderen Adı: " + ad + "<br />" + "Gönderen E-Posta: " + email + "<br />" + "Telefonu: " + tel + "<br />" + "Mesajı: " + mesaj + "");
            success.Visible = true;
        }
        catch (Exception a)
        {
            error.Visible = true;
            Response.Write(a.Message);
        }
    }
Beispiel #3
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string rndsayi = KavsitWeb.CreateRandomPassword(7);
        string yukleme = Request.PhysicalApplicationPath + "Images/newsImage/";

        if (FileUpload1.HasFile)
        {
            string extension = Path.GetExtension(FileUpload1.PostedFile.FileName);
            FileUpload1.SaveAs(yukleme + rndsayi + extension);
            path = (rndsayi + extension).ToString();
        }

        New n = new New()
        {
            Title       = txtBaslik.Text,
            Content     = CKEditor1.Text,
            Summary     = txtOzet.Text,
            Image       = path.ToString(),
            ShowComment = chk_comment.Checked,
            //CatagoryID = dropdown_category.SelectedIndex
        };

        dcx.News.InsertOnSubmit(n);
        dcx.SubmitChanges();
    }
Beispiel #4
0
    protected void bntRegister_Click(object sender, EventArgs e)
    {
        string ActivationKey = KavsitWeb.CreateRandomPassword(7);
        string Domain        = Request.Url.Authority;
        string MD5pass       = KavsitWeb.CreateMD5Hash(pass.Text);
        Member m             = new Member()
        {
            Name          = name.Text,
            Surname       = sur.Text,
            Email         = mail.Text,
            UserName      = user.Text,
            Password      = MD5pass,
            ActivationKey = ActivationKey
        };

        dcx.Members.InsertOnSubmit(m);
        dcx.SubmitChanges();
        success.Visible = true;

        try
        {
            KavsitWeb.SendMail(mail.Text, KavsitWeb.Company("companyName") + " Aktivasyon Kodu", "<a href='http://" + Domain + "/Theme/Activation.aspx?key=" + ActivationKey + "'>Aktivasyon İçin Tıklayınız.<a>");
        }
        catch (Exception ex)
        {
            lblerror.Text = ex.Message;
        }
    }
Beispiel #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        LuffeyCMSDataContext dcx = new LuffeyCMSDataContext();
        string q   = Request.QueryString["q"];
        string del = Request.QueryString["del"];

        if (q != null)
        {
            var Search = from a in dcx.Pages.Where(x => x.Title.Contains(q)) select a;

            rptr_pages.DataSource = Search;
            rptr_pages.DataBind();
        }
        else
        {
            var SelectAll = from a in dcx.Pages select a;
            rptr_pages.DataSource = SelectAll;
            rptr_pages.DataBind();
        }
        if (del != null)
        {
            Page p = dcx.Pages.SingleOrDefault(x => x.ID == int.Parse(del));
            dcx.Pages.DeleteOnSubmit(p);
            dcx.SubmitChanges();
            Response.Redirect("Pages.aspx");
        }
    }
Beispiel #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var query = from a in dcx.Sliders orderby a.Queue ascending select a;

        slidersgrid.DataSource = query;
        slidersgrid.DataBind();

        string q = Request.QueryString["q"];

        if (q != null)
        {
            Slider s = dcx.Sliders.SingleOrDefault(x => x.ID == int.Parse(q));
            dcx.Sliders.DeleteOnSubmit(s);
            dcx.SubmitChanges();
            File.Delete(Request.PhysicalApplicationPath + "Images/slider/" + s.Image);
            Response.Redirect("sliders.aspx");
        }
    }
Beispiel #7
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        int  id = Convert.ToInt16(Request.QueryString["edit"]);
        Menu m  = dcx.Menus.SingleOrDefault(x => x.ID == id);

        m.Title = txtBaslik.Text;
        m.Link  = txtLink.Text;
        m.Queue = int.Parse(txtMenuSira.Text);

        dcx.SubmitChanges();
        Response.Redirect("~/Panel/menus.aspx");
    }
Beispiel #8
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        int qString = int.Parse(Request.QueryString["edit"]);

        New n = dcx.News.SingleOrDefault(x => x.ID == qString);

        n.Title   = txtBaslik.Text;
        n.Content = CKEditor1.Text;
        n.Summary = txtOzet.Text;

        dcx.SubmitChanges();
    }
Beispiel #9
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (txtLink.Text == null)
        {
            Menu menu = new Menu()
            {
                Title    = txtBaslik.Text,
                Link     = DrpdDahili.SelectedValue,
                Queue    = int.Parse(txtMenuSira.Text),
                UpMenuID = int.Parse(TopMenu.SelectedValue)
            };
            dcx.Menus.InsertOnSubmit(menu);
            dcx.SubmitChanges();
            success.Visible = true;
        }
        else
        {
            if (DrpdDahili.AutoPostBack)
            {
                //Menu menu = new Menu()
                //{
                //    Title = txtBaslik.Text,
                //    Link = DrpdDahili.SelectedValue,
                //    Queue = int.Parse(txtMenuSira.Text),
                //    UpMenuID = int.Parse(TopMenu.SelectedValue)
                //};
                Menu menu = new Menu();
                menu.Title = txtBaslik.Text;
                menu.Link  = DrpdDahili.SelectedValue;
                menu.Queue = int.Parse(txtMenuSira.Text);
                //menu.UpMenuID = int.Parse(TopMenu.SelectedValue);

                dcx.Menus.InsertOnSubmit(menu);
                dcx.SubmitChanges();
                success.Visible = true;
            }
        }
    }
Beispiel #10
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        Page p = new Page()
        {
            Title      = txtBaslik.Text,
            Content    = CKEditor1.Text,
            SeoTitle   = txtseo.Text,
            SeoMeta    = txtMeta.Text,
            SeoMetaKey = txtMetaKeywords.Text
        };

        dcx.Pages.InsertOnSubmit(p);
        dcx.SubmitChanges();
        success.Visible = true;
    }
Beispiel #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var query = from a in dcx.Sliders select a;

        slidersgrid.DataSource = query;
        slidersgrid.DataBind();

        string q = Request.QueryString["q"];

        if (q != null)
        {
            Slider s = dcx.Sliders.SingleOrDefault(x => x.ID == int.Parse(q));
            dcx.Sliders.DeleteOnSubmit(s);
            dcx.SubmitChanges();
            Response.Redirect("sliders.aspx");
        }
    }
Beispiel #12
0
    protected void btn_comment_Click(object sender, EventArgs e)
    {
        string Name    = txtName.Text;
        string Comment = txtComment.Text;
        string NewsID  = Page.RouteData.Values["ID"] as string;
        string Date    = DateTime.Now.ToShortDateString();

        NewsComment nc = new NewsComment()
        {
            Name        = Name,
            Description = Comment,
            NewsID      = int.Parse(NewsID)
        };

        dcx.NewsComments.InsertOnSubmit(nc);
        dcx.SubmitChanges();
        Response.Redirect(Page.Request.Url.ToString(), true);
    }
Beispiel #13
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string rndsayi = KavsitWeb.CreateRandomPassword(7);
        string yukleme = Request.PhysicalApplicationPath + "Library/";

        if (FileUpload1.HasFile)
        {
            string extension = Path.GetExtension(FileUpload1.PostedFile.FileName);
            FileUpload1.SaveAs(yukleme + rndsayi + extension);
            yol = (rndsayi + extension).ToString();
        }
        Library lb = new Library()
        {
            Content = yol.ToString()
        };

        dcx.Libraries.InsertOnSubmit(lb);
        dcx.SubmitChanges();
        Response.Redirect("~/Panel/library.aspx");
    }
Beispiel #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        var query = from a in dcx.Contacts select a;

        contactgrid.DataSource = query;
        contactgrid.DataBind();


        int q = Convert.ToInt16(Request.QueryString["q"]);

        if (q != 0)
        {
            Contact c = new Contact();
            c = dcx.Contacts.SingleOrDefault(u => u.ID == q);
            dcx.Contacts.DeleteOnSubmit(c);
            dcx.SubmitChanges();

            Response.Redirect("contactUs.aspx");
        }
        else
        {
        }
    }
Beispiel #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string edit = Request.QueryString["edit"];
        string del  = Request.QueryString["del"];

        var query = from a in dcx.News orderby a.ID descending select a;;

        newsgrid.DataSource = query;
        newsgrid.DataBind();


        if (del != null)
        {
            int deleteID = int.Parse(Request.QueryString["del"]);
            New n        = dcx.News.SingleOrDefault(x => x.ID == deleteID);
            dcx.News.DeleteOnSubmit(n);
            dcx.SubmitChanges();
            Response.Redirect("news.aspx");
        }
        if (edit != null)
        {
            Response.Redirect("newsEdit.aspx?edit=" + edit);
        }
    }
Beispiel #16
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string rndsayi = KavsitWeb.CreateRandomPassword(7);
        string yukleme = Request.PhysicalApplicationPath + "Images/slider/";

        if (FileUpload1.HasFile)
        {
            string extension = Path.GetExtension(FileUpload1.PostedFile.FileName);
            FileUpload1.SaveAs(yukleme + rndsayi + extension);
            yol = (rndsayi + extension).ToString();
        }


        Slider s = new Slider()
        {
            Image = yol,
            Queue = int.Parse(TextBox1.Text),
            Text  = TextBox2.Text
        };

        dcx.Sliders.InsertOnSubmit(s);
        dcx.SubmitChanges();
        success.Visible = true;
    }
Beispiel #17
0
    protected void btn_save_Click(object sender, EventArgs e)
    {
        Product pr = new Product
        {
            Title   = txt_product_title.Text,
            Code    = txt_product_code.Text,
            Content = CKEditor1.Text,
            Price   = int.Parse(txt_product_price.Text),
            Date    = DateTime.Now
        };

        dcx.Products.InsertOnSubmit(pr);
        dcx.SubmitChanges();

        IList <HttpPostedFile> SecilenDosyalar = uploadImages.PostedFiles;

        for (int i = 0; i < SecilenDosyalar.Count; i++)
        {
            d.Image orjinalImage = d.Bitmap.FromStream(uploadImages.PostedFiles[i].InputStream);
            string  photoName    = uploadImages.PostedFiles[i].FileName;
            string  newName      = pr.Title + Guid.NewGuid() + Path.GetExtension(photoName);
            string  sPath        = "/Images/ProductImage/_s/" + newName;
            string  mPath        = "/Images/ProductImage/_m/" + newName;
            string  lPath        = "/Images/ProductImage/_l/" + newName;

            int swidth  = int.Parse(ConfigurationManager.AppSettings["smallPhotoWidth"]);
            int sheight = int.Parse(ConfigurationManager.AppSettings["smallPhotoHeight"]);

            int mwidth  = int.Parse(ConfigurationManager.AppSettings["mediumPhotoWidth"]);
            int mheight = int.Parse(ConfigurationManager.AppSettings["mediumPhotoHeight"]);

            int lwidth  = int.Parse(ConfigurationManager.AppSettings["largePhotoWidth"]);
            int lheight = int.Parse(ConfigurationManager.AppSettings["largePhotoHeight"]);

            if (orjinalImage.Width > orjinalImage.Height)
            {
                sheight = sheight * orjinalImage.Width / swidth;
                mheight = mheight * orjinalImage.Width / mwidth;
                lheight = lheight * orjinalImage.Width / lwidth;
            }
            else
            {
                swidth = swidth * orjinalImage.Height / sheight;
                mwidth = mwidth * orjinalImage.Height / mheight;
                lwidth = lwidth * orjinalImage.Height / lheight;
            }
            d.Bitmap imageSmall  = new d.Bitmap(orjinalImage, swidth, sheight);
            d.Bitmap imageMedium = new d.Bitmap(orjinalImage, mwidth, mheight);
            d.Bitmap imageLarge  = new d.Bitmap(orjinalImage, lwidth, lheight);

            imageSmall.Save(Server.MapPath("~/" + sPath));
            imageMedium.Save(Server.MapPath("~/" + mPath));
            imageLarge.Save(Server.MapPath("~/" + lPath));

            ProductImage pi = new ProductImage
            {
                SmallSize  = sPath,
                MediumSize = mPath,
                LargeSize  = lPath
            };
            dcx.ProductImages.InsertOnSubmit(pi);
            dcx.SubmitChanges();

            Product_ProductImage ppi = new Product_ProductImage
            {
                ProductID      = pr.ID,
                ProductImageID = pi.ID
            };
            dcx.Product_ProductImages.InsertOnSubmit(ppi);
            dcx.SubmitChanges();
        }
    }