Example #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         #region --- Kategoriler ---
         List <Kategori> kategoriler = KategoriMethods.GetMenu("galeri", false);
         kategoriler.Insert(0, new Kategori()
         {
             ID = "", Adi = "Kategoriye göre süz!"
         });
         ddlKategoriler.DataValueField = "id";
         ddlKategoriler.DataTextField  = "adi";
         ddlKategoriler.DataSource     = kategoriler;
         ddlKategoriler.DataBind();
         #endregion
         Core.GetProccesList("album", ddlIslemler);
         GetDataPaging();
     }
 }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                #region --- Kategoriler ---
                List <Kategori> kategoriler = KategoriMethods.GetMenu("makale", false);
                ddlKategoriler.DataMember     = "kategori";
                ddlKategoriler.DataValueField = "id";
                ddlKategoriler.DataTextField  = "adi";
                ddlKategoriler.Items.Add(new ListItem("Kategoriye göre süz!", "0"));
                ListItem item = null;
                foreach (Kategori kategori in kategoriler)
                {
                    switch (kategori.ParentID)
                    {
                    case "":
                        item = new ListItem(kategori.Adi, kategori.ID);
                        item.Attributes.CssStyle.Value = "padding-left: 5px; background: #f5f5f5; color: #454545; font-weight:bold;";
                        break;

                    case "0":
                        item = new ListItem(kategori.Adi, kategori.ID);
                        item.Attributes.CssStyle.Value = "padding-left: 25px; background: #f5f5f5; color: #fe760c; font-weight: bold;";
                        break;

                    default:
                        item = new ListItem(kategori.Adi, kategori.ID);
                        item.Attributes.CssStyle.Value = string.Format("padding-left: {0}px; background: #f5f5f5; color: #454545;", (BAYMYO.UI.Converts.NullToInt(kategori.ParentID.Split(',').Length + 1) * 25));
                        break;
                    }
                    ddlKategoriler.Items.Add(item);
                }
                kategoriler.Clear();
                #endregion
                Core.GetProccesList("makale", ddlIslemler);
                GetDataPaging();
            }
        }
Example #3
0
        protected override void OnInit(EventArgs e)
        {
            try
            {
                CustomizeControl1.FormTitle = string.Format(Settings.FormTitleFormat, "Bağlantı", "Tanımlama");
                if (Request.QueryString["fid"] != null)
                {
                    ViewState["tempID"] = Request.QueryString["fid"];
                }
                using (Firma m = FirmaMethods.GetFirma(BAYMYO.UI.Converts.NullToInt64(ViewState["tempID"])))
                {
                    bool notNull = (m.ID > 0), isAdmin = Core.IsUserAdmin;
                    if (notNull)
                    {
                        Default(m, isAdmin);
                    }

                    Image img = new Image();
                    img.ID      = "BuyukResim";
                    img.Width   = 250;
                    img.ToolTip = m.ResimUrl;
                    if (!string.IsNullOrEmpty(m.ResimUrl))
                    {
                        img.ImageUrl = Settings.ImagesPath + "firma/b/" + m.ResimUrl;
                    }
                    else
                    {
                        img.ImageUrl = Settings.ImagesPath + "admin-yok.png";
                    }
                    CustomizeControl1.AddControl("Büyük Resim", img);

                    FileUpload flu = new FileUpload();
                    flu.ID      = "ResimUrl";
                    flu.ToolTip = m.ResimUrl;
                    CustomizeControl1.AddControl("Resim Ekle", flu);

                    img       = new Image();
                    img.ID    = "KucukResim";
                    img.Width = 150;
                    if (!string.IsNullOrEmpty(m.ResimUrl))
                    {
                        img.ImageUrl = Settings.ImagesPath + "firma/" + m.ResimUrl;
                    }
                    else
                    {
                        img.ImageUrl = Settings.ImagesPath + "admin-yok.png";
                    }
                    CustomizeControl1.AddControl("Küçük Resim", img);

                    flu    = new FileUpload();
                    flu.ID = "KucukResimUrl";
                    CustomizeControl1.AddControl("Küçük Resim Ekle", flu, "<b>Bu alanda resim seçmezseniz büyük resim küçültülecektir.</b> Genişlik(W):350px/Yükseklik(H):140px");

                    TextBox txt = new TextBox();
                    txt.ID        = "Adi";
                    txt.CssClass  = "form-control";
                    txt.Text      = m.Adi;
                    txt.MaxLength = 75;
                    CustomizeControl1.AddControl("Bağlantı Adı", txt);

                    txt           = new TextBox();
                    txt.ID        = "Yetkili";
                    txt.CssClass  = "form-control";
                    txt.Text      = m.Yetkili;
                    txt.MaxLength = 40;
                    CustomizeControl1.AddControl("Yetkili", txt);

                    txt          = new TextBox();
                    txt.ID       = "Adres";
                    txt.CssClass = "form-control";
                    txt.Text     = m.Adres;
                    txt.TextMode = TextBoxMode.MultiLine;
                    CustomizeControl1.AddControl("Adres", txt);

                    txt           = new TextBox();
                    txt.ID        = "Mail";
                    txt.CssClass  = "form-control";
                    txt.Text      = m.Mail;
                    txt.MaxLength = 60;
                    CustomizeControl1.AddControl("Mail", txt);

                    txt           = new TextBox();
                    txt.ID        = "Web";
                    txt.CssClass  = "form-control";
                    txt.Text      = m.Web;
                    txt.MaxLength = 60;
                    CustomizeControl1.AddControl("Web", txt);

                    txt           = new TextBox();
                    txt.ID        = "Telefon1";
                    txt.CssClass  = "form-control";
                    txt.Text      = m.Telefon1;
                    txt.MaxLength = 16;
                    CustomizeControl1.AddControl("Telefon (1)", txt);

                    txt           = new TextBox();
                    txt.ID        = "Telefon2";
                    txt.CssClass  = "form-control";
                    txt.Text      = m.Telefon2;
                    txt.MaxLength = 16;
                    CustomizeControl1.AddControl("Telefon (2)", txt);

                    txt           = new TextBox();
                    txt.ID        = "GSM";
                    txt.CssClass  = "form-control";
                    txt.Text      = m.GSM;
                    txt.MaxLength = 16;
                    CustomizeControl1.AddControl("GSM", txt);

                    DropDownList ddl = new DropDownList();
                    ddl.ID             = "Kategori";
                    ddl.Width          = 250;
                    ddl.DataMember     = "kategori";
                    ddl.DataValueField = "id";
                    ddl.DataTextField  = "adi";
                    ddl.CssClass       = "form-control";
                    ddl.DataSource     = KategoriMethods.GetMenu("firma", true);
                    ddl.DataBind();
                    ddl.SelectedValue = BAYMYO.UI.Converts.NullToString(m.KategoriID);
                    CustomizeControl1.AddControl("Kategori", ddl, "<a href=\"" + Settings.PanelPath + "?go=kategori&mdl=firma\">[+] Yeni Kategori</a>");

                    ddl                = new DropDownList();
                    ddl.ID             = "Sehir";
                    ddl.Width          = 250;
                    ddl.DataMember     = "Sehir";
                    ddl.DataValueField = "Adi";
                    ddl.DataTextField  = "Adi";
                    ddl.CssClass       = "form-control";
                    SehirCollection sehirler = SehirMethods.GetSelect();
                    sehirler.Insert(0, new Sehir(0, ""));
                    ddl.DataSource = sehirler;
                    ddl.DataBind();
                    ddl.Text = BAYMYO.UI.Converts.NullToString(m.Sehir);
                    CustomizeControl1.AddControl("Şehir (İL)", ddl);

                    CheckBoxList chkList = new CheckBoxList();
                    chkList.ID = "chkList";
                    chkList.RepeatDirection = RepeatDirection.Horizontal;
                    chkList.Items.Add("Gösterim Sayı");
                    chkList.Items[0].Selected = (notNull) ? m.GosterimSayi : true;
                    chkList.Items.Add("Yönetici Onayı");
                    chkList.Items[1].Selected = (notNull) ? m.YoneticiOnay : isAdmin;
                    chkList.Items[1].Enabled  = isAdmin;
                    chkList.Items.Add("Yayımla");
                    chkList.Items[2].Selected = (notNull) ? m.Aktif : isAdmin;
                    chkList.Items[2].Enabled  = isAdmin;
                    CustomizeControl1.AddControl("Seçimler", chkList);

                    CustomizeControl1.SubmitClick += new CustomizeControl.ButtonEvent(CustomizeControl1_SubmitClick);
                    CustomizeControl1.RemoveClick += new CustomizeControl.ButtonEvent(CustomizeControl1_RemoveClick);
                }
            }
            catch (Exception ex)
            {
                CustomizeControl1.MessageText = MessageBox.Show(DialogResult.Error, ex.Message);
            }
            base.OnInit(e);
        }
Example #4
0
        void EditorHesap()
        {
            CustomizeControl1.AddTitle("Profil Bilgileri");

            Image img = new Image();

            img.ID       = "RprfImageUrl";
            img.Width    = 210;
            img.ImageUrl = Settings.ImagesPath + "yok.png";
            CustomizeControl1.AddControl("Fotoğraf", img);

            FileUpload flu = new FileUpload();

            flu.ID = "RprfResimUrl";
            CustomizeControl1.AddControl("Yeni Fotoğraf", flu, "Genişlik(W):160px - Yükseklik(H):170px");

            TextBox txt = new TextBox();

            txt.ID        = "RprfUrl";
            txt.CssClass  = "form-control";
            txt.MaxLength = 50;
            CustomizeControl1.AddControl("Url", txt, "Profil bağlantı adresi olacaktır ve sadece küçük harfler girebilirsiniz. Ör. " + Settings.SiteUrl + "<b class=\"toolTip titleFormat1\" title=\"Adres çubuğunda sitemizin adının yanına '/' ters slaş yaparak burada belirteceğiniz isim ile profilinizin görüntülenmesini sağlar.\">adisoyadi</b>");

            txt           = new TextBox();
            txt.ID        = "RprfAdi";
            txt.CssClass  = "form-control";
            txt.MaxLength = 50;
            CustomizeControl1.AddControl("Başlık", txt, "Profilde gösterilecek olan <b>başlıktır</b>. 'Ör. Sezgin'nin Sayfasına Hoş Geldiniz!'");

            txt           = new TextBox();
            txt.ID        = "RprfMail";
            txt.CssClass  = "form-control";
            txt.TextMode  = TextBoxMode.Email;
            txt.MaxLength = 60;
            CustomizeControl1.AddControl("Profil Maili", txt, "Profilde gösterilecek olan <b>'Mail'</b> adresidir. 'Not: Profiliniz üzerinden bu adrese mail gönderebilecekler!'");

            txt           = new TextBox();
            txt.ID        = "RprfWeb";
            txt.CssClass  = "form-control";
            txt.TextMode  = TextBoxMode.Url;
            txt.MaxLength = 60;
            CustomizeControl1.AddControl("Web Adresi", txt, "Profilde gösterilecek olan <b>'Web Site'</b> adresidir.");

            txt           = new TextBox();
            txt.ID        = "RprfTelefon";
            txt.CssClass  = "form-control";
            txt.TextMode  = TextBoxMode.Phone;
            txt.MaxLength = 16;
            CustomizeControl1.AddControl("Telefon", txt, "Profilde gösterilecek olan <b>'Telefon'</b> numarasıdır. Ör. <b>0326 6XX 2X 0X</b>");

            txt           = new TextBox();
            txt.ID        = "RprfGSM";
            txt.CssClass  = "form-control";
            txt.TextMode  = TextBoxMode.Phone;
            txt.MaxLength = 16;
            CustomizeControl1.AddControl("GSM", txt, "Profilde gösterilecek olan <b>'GSM'</b> numarasıdır. Ör. <b>0544 2XX 4X 5X</b>");

            DropDownList ddl = new DropDownList();

            ddl.ID             = "RprfSehir";
            ddl.Width          = 250;
            ddl.CssClass       = "form-control";
            ddl.DataMember     = "Sehir";
            ddl.DataValueField = "Adi";
            ddl.DataTextField  = "Adi";
            SehirCollection sehirler = SehirMethods.GetSelect();

            sehirler.Insert(0, new Sehir(0, ""));
            ddl.DataSource = sehirler;
            ddl.DataBind();
            CustomizeControl1.AddControl("Şehir (İL)", ddl, "<b>Şehir</b> adı harita üzerinde bulunmasını sağlayacaktır.");

            ddl                = new DropDownList();
            ddl.ID             = "RprfMeslekID";
            ddl.Width          = 250;
            ddl.CssClass       = "form-control";
            ddl.DataMember     = "kategori";
            ddl.DataValueField = "id";
            ddl.DataTextField  = "adi";
            ddl.DataSource     = KategoriMethods.GetMenu("meslek", true);
            ddl.DataBind();
            CustomizeControl1.AddControl("Meslek", ddl, "* Seçmesi zorunlu alan.");

            ddl                = new DropDownList();
            ddl.ID             = "RprfEgitimID";
            ddl.Width          = 250;
            ddl.CssClass       = "form-control";
            ddl.DataMember     = "kategori";
            ddl.DataValueField = "id";
            ddl.DataTextField  = "adi";
            ddl.DataSource     = KategoriMethods.GetMenu("egitim", true);
            ddl.DataBind();
            CustomizeControl1.AddControl("Eğitim", ddl, "* Seçmesi zorunlu alan.");

            txt           = new TextBox();
            txt.ID        = "RprfHakkimda";
            txt.CssClass  = "form-control";
            txt.Height    = 150;
            txt.TextMode  = TextBoxMode.MultiLine;
            txt.MaxLength = 500;
            CustomizeControl1.AddControl("Hakkimda", txt, "Bu alana <b>500</b> karaktere kadar bilgi girişi yapabilirsiniz.");
        }
Example #5
0
        protected override void OnInit(EventArgs e)
        {
            try
            {
                CustomizeControl1.FormTitle = string.Format(Settings.FormTitleFormat, "Hesap", "Ekleme/Düzeltme Formu");
                using (Hesap hsp = HesapMethods.GetHesap(BAYMYO.UI.Converts.NullToGuidString(Request.QueryString["uid"])))
                {
                    bool notNull = !string.IsNullOrEmpty(Request.QueryString["uid"]);
                    CustomizeControl1.RemoveVisible = notNull;
                    if (notNull)
                    {
                        CustomizeControl1.StatusText = string.Format("<div style=\"margin-top: 5px !important;padding-top: 5px !important;border-top: dashed 1px #c5c5c5;\"><a class=\"toolTip\" title=\"Hesap listesine geri dönmek için tıklayın!\" href=\"{1}\" target=\"_blank\"><b>Hesap Listesi!</b></a>&nbsp;-&nbsp;<a class=\"toolTip\" title=\"Önizleme için tıklayın!\" href=\"{0}\" target=\"_blank\"><b>Önizleme Yap!</b></a></div>", Settings.VirtualPath + hsp.ProfilObject.Url, Settings.PanelPath + "?go=hesapliste");
                    }
                    //if (hsp.ProfilObject == null)
                    //    hsp.ProfilObject = new Profil();
                    TextBox txt = new TextBox();
                    txt.ID        = "Adi";
                    txt.CssClass  = "form-control";
                    txt.Text      = hsp.Adi;
                    txt.MaxLength = 18;
                    CustomizeControl1.AddControl("Adı", txt);

                    txt           = new TextBox();
                    txt.ID        = "Soyadi";
                    txt.CssClass  = "form-control";
                    txt.Text      = hsp.Soyadi;
                    txt.MaxLength = 15;
                    CustomizeControl1.AddControl("Soyadı", txt);

                    txt           = new TextBox();
                    txt.ID        = "Mail";
                    txt.CssClass  = "form-control";
                    txt.Text      = hsp.Mail;
                    txt.TextMode  = TextBoxMode.Email;
                    txt.MaxLength = 60;
                    CustomizeControl1.AddControl("Mail", txt, "Sisteme giriş yapmak için kullanılacaktır.");

                    txt           = new TextBox();
                    txt.ID        = "Sifre";
                    txt.CssClass  = "form-control";
                    txt.ToolTip   = hsp.Sifre;
                    txt.TextMode  = TextBoxMode.Password;
                    txt.MaxLength = 25;
                    CustomizeControl1.AddControl("Şifre", txt, "Şifreyi değiştirmek istemiyorsanız boş bırakınız!");

                    DateTimeControl cnt = this.Page.LoadControl(Settings.DateTimeControlPath) as DateTimeControl;
                    cnt.ID         = "DogumTarihi";
                    cnt.FormatType = FormatTypes.BirthDate;
                    CustomizeControl1.AddControl("Doğum Tarihi", cnt, "* Seçilmesi zorunlu alan.");
                    cnt.Date = hsp.DogumTarihi;

                    DropDownList ddl = new DropDownList();
                    ddl.ID             = "Cinsiyet";
                    ddl.Width          = 195;
                    ddl.CssClass       = "form-control";
                    ddl.DataValueField = "Key";
                    ddl.DataTextField  = "Value";
                    ddl.DataSource     = Core.GetSexTypes();
                    ddl.DataBind();
                    ddl.SelectedValue = BAYMYO.UI.Converts.NullToByte(hsp.Cinsiyet).ToString();
                    CustomizeControl1.AddControl("Cinsiyet", ddl);

                    AccountType tipi;
                    if (!string.IsNullOrEmpty(Request.QueryString["type"]))
                    {
                        tipi = Core.GetAccountType(BAYMYO.UI.Converts.NullToByte(Request.QueryString["type"]));
                    }
                    else
                    {
                        tipi = hsp.Tipi;
                    }

                    ddl                = new DropDownList();
                    ddl.ID             = "Tipi";
                    ddl.Width          = 195;
                    ddl.CssClass       = "form-control";
                    ddl.DataValueField = "Key";
                    ddl.DataTextField  = "Value";
                    ddl.DataSource     = Core.GetAccountTypes();
                    ddl.DataBind();
                    ddl.SelectedValue = BAYMYO.UI.Converts.NullToByte(tipi).ToString();
                    CustomizeControl1.AddControl("Hesap Türü", ddl, "(Not: Sadece Admin yönetim panelini görebilir!)");

                    CheckBoxList chkList = new CheckBoxList();
                    chkList.ID = "chkList";
                    chkList.RepeatDirection = RepeatDirection.Horizontal;
                    chkList.Items.Add("Abonelik");
                    chkList.Items[0].Selected = notNull ? hsp.Abonelik : true;
                    chkList.Items.Add("Aktivasyon");
                    chkList.Items[1].Selected = notNull ? hsp.Aktivasyon : true;
                    chkList.Items.Add("Yorum Yapabilir");
                    chkList.Items[2].Selected = notNull ? hsp.Yorum : true;
                    chkList.Items.Add("Hesap Durumu");
                    chkList.Items[3].Selected = notNull ? hsp.Aktif : true;
                    CustomizeControl1.AddControl("Seçimler", chkList);
                    switch (tipi)
                    {
                    case AccountType.Admin:
                    case AccountType.Private:
                    case AccountType.Doctor:
                    case AccountType.Editor:
                        CustomizeControl1.AddTitle("Profil Bilgileri");
                        Image img = new Image();
                        img.ID       = "prfImageUrl";
                        img.Width    = 210;
                        img.ImageUrl = Settings.ImagesPath + ((!string.IsNullOrEmpty(hsp.ProfilObject.ResimUrl)) ? "profil/" + hsp.ProfilObject.ResimUrl : "profil/noavatar.png");
                        CustomizeControl1.AddControl("Fotoğraf", img);

                        FileUpload flu = new FileUpload();
                        flu.ID       = "prfResimUrl";
                        flu.CssClass = "form-control";
                        CustomizeControl1.AddControl("Yeni Fotoğraf", flu, "Genişlik(W):160px - Yükseklik(H):170px");

                        txt           = new TextBox();
                        txt.ID        = "prfUrl";
                        txt.Text      = hsp.ProfilObject.Url;
                        txt.CssClass  = "form-control";
                        txt.MaxLength = 50;
                        CustomizeControl1.AddControl("Url", txt, "Profil bağlantı adresi olacaktır ve sadece küçük harfler girebilirsiniz. Ör. " + Settings.SiteUrl + "<b class=\"toolTip titleFormat1\" title=\"Adres çubuğunda sitemizin adının yanına '/' ters slaş yaparak burada belirteceğiniz isim ile profilinizin görüntülenmesini sağlar.\">adisoyadi</b>");

                        txt           = new TextBox();
                        txt.ID        = "prfAdi";
                        txt.Text      = hsp.ProfilObject.Adi;
                        txt.CssClass  = "form-control";
                        txt.MaxLength = 50;
                        CustomizeControl1.AddControl("Başlık", txt, "Profilde gösterilecek olan <b>başlıktır</b>. 'Ör. Sezgin'in Sayfasına Hoş Geldiniz!'");

                        txt           = new TextBox();
                        txt.ID        = "prfMail";
                        txt.Text      = hsp.ProfilObject.Mail;
                        txt.CssClass  = "form-control";
                        txt.TextMode  = TextBoxMode.Email;
                        txt.MaxLength = 60;
                        CustomizeControl1.AddControl("Profil Maili", txt, "Profilde gösterilecek olan <b>'Mail'</b> adresidir. 'Not: Profiliniz üzerinden bu adrese mail gönderebilecekler!'");

                        txt           = new TextBox();
                        txt.ID        = "prfWeb";
                        txt.Text      = hsp.ProfilObject.Web;
                        txt.CssClass  = "form-control";
                        txt.MaxLength = 60;
                        CustomizeControl1.AddControl("Web Adresi", txt, "Profilde gösterilecek olan <b>'Web Site'</b> adresidir.");

                        txt           = new TextBox();
                        txt.ID        = "prfTelefon";
                        txt.Text      = hsp.ProfilObject.Telefon;
                        txt.CssClass  = "form-control";
                        txt.TextMode  = TextBoxMode.Phone;
                        txt.MaxLength = 16;
                        CustomizeControl1.AddControl("Telefon", txt, "Profilde gösterilecek olan <b>'Telefon'</b> numarasıdır. Ör. <b>0326 6XX 2X 0X</b>");

                        txt           = new TextBox();
                        txt.ID        = "prfGSM";
                        txt.Text      = hsp.ProfilObject.GSM;
                        txt.CssClass  = "form-control";
                        txt.TextMode  = TextBoxMode.Phone;
                        txt.MaxLength = 16;
                        CustomizeControl1.AddControl("GSM", txt, "Profilde gösterilecek olan <b>'GSM'</b> numarasıdır. Ör. <b>0544 2XX 4X 5X</b>");

                        ddl                = new DropDownList();
                        ddl.ID             = "Sehir";
                        ddl.Width          = 250;
                        ddl.CssClass       = "form-control";
                        ddl.DataMember     = "Sehir";
                        ddl.DataValueField = "Adi";
                        ddl.DataTextField  = "Adi";
                        SehirCollection sehirler = SehirMethods.GetSelect();
                        sehirler.Insert(0, new Sehir(0, ""));
                        ddl.DataSource = sehirler;
                        ddl.DataBind();
                        ddl.SelectedValue = BAYMYO.UI.Converts.NullToString(hsp.ProfilObject.Sehir);
                        CustomizeControl1.AddControl("Şehir (İL)", ddl, "<b>Şehir</b> adı harita üzerinde bulunmasını sağlayacaktır.");

                        ddl                = new DropDownList();
                        ddl.ID             = "prfMeslekID";
                        ddl.Width          = 250;
                        ddl.CssClass       = "form-control";
                        ddl.DataMember     = "kategori";
                        ddl.DataValueField = "id";
                        ddl.DataTextField  = "adi";
                        ddl.DataSource     = KategoriMethods.GetMenu("meslek", true);
                        ddl.DataBind();
                        ddl.SelectedValue = hsp.ProfilObject.Meslek;
                        CustomizeControl1.AddControl("Meslek", ddl, "<a href=\"" + Settings.PanelPath + "?go=kategori&mdl=meslek\">[+] Yeni Meslek Tanımla</a>");

                        ddl                = new DropDownList();
                        ddl.ID             = "prfEgitimID";
                        ddl.Width          = 250;
                        ddl.CssClass       = "form-control";
                        ddl.DataMember     = "kategori";
                        ddl.DataValueField = "id";
                        ddl.DataTextField  = "adi";
                        ddl.DataSource     = KategoriMethods.GetMenu("egitim", true);
                        ddl.DataBind();
                        ddl.SelectedValue = hsp.ProfilObject.Egitim;
                        CustomizeControl1.AddControl("Eğitim", ddl, "<a href=\"" + Settings.PanelPath + "?go=kategori&mdl=egitim\">[+] Yeni Eğitim Durumu</a>");

                        txt           = new TextBox();
                        txt.ID        = "prfHakkimda";
                        txt.Text      = hsp.ProfilObject.Hakkimda;
                        txt.CssClass  = "form-control noHtml";
                        txt.Height    = 150;
                        txt.TextMode  = TextBoxMode.MultiLine;
                        txt.MaxLength = 500;
                        CustomizeControl1.AddControl("Hakkimda", txt, "Bu alana <b>500</b> karaktere kadar bilgi girişi yapabilirsiniz.");

                        CustomizeControl1.AddTitle("Hesap Yetkileri");
                        chkList                 = new CheckBoxList();
                        chkList.ID              = "chkSecure";
                        chkList.Font.Bold       = true;
                        chkList.RepeatColumns   = 5;
                        chkList.RepeatDirection = RepeatDirection.Horizontal;
                        chkList.Items.Add(new ListItem("Panel", "P"));
                        chkList.Items.Add(new ListItem("Ayarlar", "A"));
                        //chkList.Items.Add(new ListItem("Ajans", "J"));
                        chkList.Items.Add(new ListItem("Manşet", "T"));
                        chkList.Items.Add(new ListItem("Haber", "H"));
                        chkList.Items.Add(new ListItem("Makale", "M"));
                        //chkList.Items.Add(new ListItem("Reklam", "R"));
                        //chkList.Items.Add(new ListItem("Resmi İlan", "I"));
                        chkList.Items.Add(new ListItem("Mesaj", "Q"));
                        //chkList.Items.Add(new ListItem("Firma", "F"));
                        //chkList.Items.Add(new ListItem("Seri İlan", "S"));
                        chkList.Items.Add(new ListItem("Video", "V"));
                        chkList.Items.Add(new ListItem("Galeri", "G"));
                        chkList.Items.Add(new ListItem("Yorum", "Y"));
                        chkList.Items.Add(new ListItem("<a class=\"toolTip\" href=\"#\">Diğerleri ..</a>", "O"));
                        if (!string.IsNullOrEmpty(hsp.Roller))
                        {
                            foreach (string rol in hsp.Roller.Split(','))
                            {
                                if (chkList.Items.FindByValue(rol) != null)
                                {
                                    chkList.Items.FindByValue(rol).Selected = true;
                                }
                            }
                        }
                        CustomizeControl1.AddControl("Yetkiler", chkList);
                        CustomizeControl1.SubmitClick += new CustomizeControl.ButtonEvent(editorHesap_SubmitClick);
                        break;

                    default:
                        CustomizeControl1.SubmitClick += new CustomizeControl.ButtonEvent(standartHesap_SubmitClick);
                        break;
                    }
                    CustomizeControl1.RemoveClick += new CustomizeControl.ButtonEvent(hesap_RemoveClick);
                }
            }
            catch (Exception ex)
            {
                CustomizeControl1.MessageText = MessageBox.Show(DialogResult.Error, ex.Message);
            }
            base.OnInit(e);
        }
Example #6
0
        protected override void OnInit(EventArgs e)
        {
            try
            {
                CustomizeControl1.FormTitle = string.Format(Settings.FormTitleFormat, "Galeri", "Ekleme/Düzeltme Formu");
                using (Album m = AlbumMethods.GetAlbum(BAYMYO.UI.Converts.NullToInt64(Request.QueryString["raid"])))
                {
                    bool notNull = (m.ID > 0), isAdmin = Core.IsUserAdmin;
                    if (notNull)
                    {
                        CustomizeControl1.RemoveVisible = isAdmin;
                        CreateLinks(m);
                    }

                    TextBox txt = new TextBox();
                    txt.ID        = "Adi";
                    txt.CssClass  = "form-control";
                    txt.Text      = m.Adi;
                    txt.MaxLength = 75;
                    CustomizeControl1.AddControl("Album Adı", txt);

                    txt           = new TextBox();
                    txt.ID        = "Etiket";
                    txt.CssClass  = "form-control";
                    txt.Text      = m.Etiket;
                    txt.MaxLength = 100;
                    CustomizeControl1.AddControl("Etiket", txt, string.Format("Lütfen virgül({0}) ile ayrıarak ve boşluk bırakmadan yazınız! Örnek: elma{0}meyve{0}sebze{0}bahçe", Settings.SplitFormat));

                    DropDownList ddl = new DropDownList();
                    ddl.ID             = "Kategori";
                    ddl.Width          = 250;
                    ddl.CssClass       = "form-control";
                    ddl.DataMember     = "kategori";
                    ddl.DataValueField = "id";
                    ddl.DataTextField  = "adi";
                    ddl.DataSource     = KategoriMethods.GetMenu("galeri", true);
                    ddl.DataBind();
                    ddl.SelectedValue = BAYMYO.UI.Converts.NullToString(m.KategoriID);
                    CustomizeControl1.AddControl("Kategori", ddl, "<a href=\"" + Settings.PanelPath + "?go=kategori&mdl=galeri\">[+] Yeni Kategori</a>");

                    CheckBoxList chkList = new CheckBoxList();
                    chkList.ID = "chkList";
                    chkList.RepeatDirection = RepeatDirection.Horizontal;
                    chkList.Items.Add("Gösterim Sayı");
                    chkList.Items[0].Selected = notNull ? m.GosterimSayi : true;
                    chkList.Items.Add("Üyelere Özel");
                    chkList.Items[1].Selected = m.Uye;
                    chkList.Items.Add("Yorumları Göster");
                    chkList.Items[2].Selected = notNull ? m.Yorum : false;
                    chkList.Items.Add("Yönetici Onayı");
                    chkList.Items[3].Selected = notNull ? m.YoneticiOnay : isAdmin;
                    chkList.Items[3].Enabled  = isAdmin;
                    chkList.Items.Add("Yayımla");
                    chkList.Items[4].Selected = notNull ? m.Aktif : isAdmin;
                    chkList.Items[4].Enabled  = isAdmin;
                    CustomizeControl1.AddControl("Seçimler", chkList);

                    int index = 1;
                    CustomizeControl1.AddTitle(index + ". Resim Bilgileri");

                    FileUpload flu = new FileUpload();
                    flu.ID       = "Resim" + index;
                    flu.CssClass = "form-control";
                    CustomizeControl1.AddControl("Resim", flu, "Genişlik(W):600px");

                    txt           = new TextBox();
                    txt.ID        = "Aciklama" + index;
                    txt.TextMode  = TextBoxMode.MultiLine;
                    txt.CssClass  = "form-control";
                    txt.MaxLength = 500;
                    CustomizeControl1.AddControl("Açıklama", txt);

                    index++;
                    CustomizeControl1.AddTitle(index + ". Resim Bilgileri");

                    flu          = new FileUpload();
                    flu.ID       = "Resim" + index;
                    flu.CssClass = "form-control";
                    CustomizeControl1.AddControl("Resim", flu, "Genişlik(W):600px");

                    txt           = new TextBox();
                    txt.ID        = "Aciklama" + index;
                    txt.TextMode  = TextBoxMode.MultiLine;
                    txt.CssClass  = "form-control";
                    txt.MaxLength = 500;
                    CustomizeControl1.AddControl("Açıklama", txt);

                    index++;
                    CustomizeControl1.AddTitle(index + ". Resim Bilgileri");

                    flu          = new FileUpload();
                    flu.ID       = "Resim" + index;
                    flu.CssClass = "form-control";
                    CustomizeControl1.AddControl("Resim", flu, "Genişlik(W):600px");

                    txt           = new TextBox();
                    txt.ID        = "Aciklama" + index;
                    txt.TextMode  = TextBoxMode.MultiLine;
                    txt.CssClass  = "form-control";
                    txt.MaxLength = 500;
                    CustomizeControl1.AddControl("Açıklama", txt);

                    RadioButtonList radioList = new RadioButtonList();
                    radioList.ID = "Kapak";
                    radioList.RepeatDirection = RepeatDirection.Horizontal;
                    radioList.Items.Add("1. Resim");
                    radioList.Items.Add("2. Resim");
                    radioList.Items.Add("3. Resim");
                    CustomizeControl1.AddControl("Kapak Olarak", radioList);

                    CustomizeControl1.SubmitClick += new CustomizeControl.ButtonEvent(CustomizeControl1_SubmitClick);
                    CustomizeControl1.RemoveClick += new CustomizeControl.ButtonEvent(CustomizeControl1_RemoveClick);
                }
            }
            catch (Exception ex)
            {
                CustomizeControl1.MessageText = MessageBox.Show(DialogResult.Error, ex.Message);
            }
            base.OnInit(e);
        }
Example #7
0
        protected override void OnInit(EventArgs e)
        {
            try
            {
                CustomizeControl1.FormTitle = string.Format(Settings.FormTitleFormat, "Video", "Ekleme/Düzeltme Formu");
                if (Request.QueryString["vid"] != null)
                {
                    ViewState["tempID"] = Request.QueryString["vid"];
                }
                using (Video m = VideoMethods.GetVideo(BAYMYO.UI.Converts.NullToInt64(ViewState["tempID"])))
                {
                    bool notNull = (m.ID > 0), isAdmin = Core.IsUserAdmin;
                    if (notNull)
                    {
                        Default(m, isAdmin);
                    }

                    TextBox txt = new TextBox();
                    txt.ID           = "Baslik";
                    txt.CssClass     = "form-control";
                    txt.Text         = m.Baslik;
                    txt.MaxLength    = 75;
                    txt.ClientIDMode = ClientIDMode.Static;
                    CustomizeControl1.AddControl("Başlık", txt);

                    txt              = new TextBox();
                    txt.ID           = "Embed";
                    txt.CssClass     = "form-control";
                    txt.Text         = m.Embed;
                    txt.TextMode     = TextBoxMode.MultiLine;
                    txt.MaxLength    = 750;
                    txt.ClientIDMode = ClientIDMode.Static;
                    CustomizeControl1.AddControl("Embed", txt, "Her hangi bir video sitesinden 'embed' kodu almanız gereklidir.");

                    txt              = new TextBox();
                    txt.ID           = "Etiket";
                    txt.CssClass     = "form-control";
                    txt.Text         = m.Etiket;
                    txt.MaxLength    = 100;
                    txt.ClientIDMode = ClientIDMode.Static;
                    CustomizeControl1.AddControl("Etiket", txt, string.Format("Lütfen virgül({0}) ile ayrıarak ve boşluk bırakmadan yazınız! Örnek: elma{0}meyve{0}sebze{0}bahçe", Settings.SplitFormat));

                    DropDownList ddl = new DropDownList();
                    ddl.ID             = "Kategori";
                    ddl.Width          = 250;
                    ddl.CssClass       = "form-control";
                    ddl.DataMember     = "kategori";
                    ddl.DataValueField = "id";
                    ddl.DataTextField  = "adi";
                    ddl.DataSource     = KategoriMethods.GetMenu("video", true);
                    ddl.DataBind();
                    ddl.SelectedValue = BAYMYO.UI.Converts.NullToString(m.KategoriID);
                    CustomizeControl1.AddControl("Kategori", ddl, "<a href=\"" + Settings.PanelPath + "?go=kategori&mdl=video\">[+] Yeni Kategori</a>");

                    Image img = new Image();
                    img.ID           = "VideoResim";
                    img.Width        = 250;
                    img.ToolTip      = m.ResimUrl;
                    img.ClientIDMode = ClientIDMode.Static;
                    if (!string.IsNullOrEmpty(m.ResimUrl))
                    {
                        img.ImageUrl = Settings.ImagesPath + "video/" + m.ResimUrl;
                    }
                    else
                    {
                        img.ImageUrl = Settings.ImagesPath + "admin-yok.png";
                    }
                    CustomizeControl1.AddControl("Resim", img);

                    txt              = new TextBox();
                    txt.ID           = "ImgUrl";
                    txt.CssClass     = "form-control";
                    txt.ClientIDMode = ClientIDMode.Static;
                    CustomizeControl1.AddControl("Image Url", txt, "Video bağlantısı eklendiğinde otomatik olarak resim adresi alır.");

                    FileUpload flu = new FileUpload();
                    flu.ID       = "ResimUrl";
                    flu.CssClass = "form-control";
                    flu.ToolTip  = m.ResimUrl;
                    CustomizeControl1.AddControl("Resim Ekle", flu, "Genişlik(W):300px - Yükseklik(H):150px");

                    CheckBoxList chkList = new CheckBoxList();
                    chkList.ID = "chkList";
                    chkList.RepeatDirection = RepeatDirection.Horizontal;
                    chkList.Items.Add("Gösterim Sayı");
                    chkList.Items[0].Selected = notNull ? m.GosterimSayi : true;
                    chkList.Items.Add("Üyelere Özel");
                    chkList.Items[1].Selected = m.Uye;
                    chkList.Items.Add("Yorumları Göster");
                    chkList.Items[2].Selected = notNull ? m.Yorum : false;
                    chkList.Items.Add("Yönetici Onayı");
                    chkList.Items[3].Selected = notNull ? m.YoneticiOnay : isAdmin;
                    chkList.Items[3].Enabled  = isAdmin;
                    chkList.Items.Add("Yayımla");
                    chkList.Items[4].Selected = notNull ? m.Aktif : isAdmin;
                    chkList.Items[4].Enabled  = isAdmin;
                    CustomizeControl1.AddControl("Seçimler", chkList);

                    CustomizeControl1.SubmitClick += new CustomizeControl.ButtonEvent(CustomizeControl1_SubmitClick);
                    CustomizeControl1.RemoveClick += new CustomizeControl.ButtonEvent(CustomizeControl1_RemoveClick);
                }
            }
            catch (Exception ex)
            {
                CustomizeControl1.MessageText = MessageBox.Show(DialogResult.Error, ex.Message);
            }
            base.OnInit(e);
        }
Example #8
0
        protected override void OnInit(EventArgs e)
        {
            try
            {
                CustomizeControl1.FormTitle = string.Format(Settings.FormTitleFormat, "Haber", "Ekleme/Düzeltme Formu");
                if (Request.QueryString["hid"] != null)
                {
                    ViewState["tempID"] = Request.QueryString["hid"];
                }
                using (Haber m = HaberMethods.GetHaber(BAYMYO.UI.Converts.NullToInt64(ViewState["tempID"])))
                {
                    bool notNull = (m.ID > 0), isAdmin = Core.IsUserAdmin;
                    if (notNull)
                    {
                        Default(m, isAdmin);
                    }

                    TextBox txt = new TextBox();
                    txt.ID        = "Baslik";
                    txt.CssClass  = "form-control";
                    txt.Text      = m.Baslik;
                    txt.MaxLength = 75;
                    CustomizeControl1.AddControl("Başlık", txt);

                    txt           = new TextBox();
                    txt.ID        = "Ozet";
                    txt.CssClass  = "form-control";
                    txt.Text      = m.Ozet;
                    txt.TextMode  = TextBoxMode.MultiLine;
                    txt.MaxLength = 250;
                    CustomizeControl1.AddControl("Özet", txt, "Liste ve RSS'ler için gösterilecek içeriktir.");

                    CKEditor.NET.CKEditorControl fck = new CKEditor.NET.CKEditorControl();
                    fck.ID     = "Icerik";
                    fck.Height = 400;
                    fck.Text   = m.Icerik;
                    CustomizeControl1.AddControl("Editör", fck);

                    txt           = new TextBox();
                    txt.ID        = "Etiket";
                    txt.CssClass  = "form-control";
                    txt.Text      = m.Etiket;
                    txt.MaxLength = 100;
                    CustomizeControl1.AddControl("Etiket", txt, string.Format("Lütfen virgül({0}) ile ayrıarak ve boşluk bırakmadan yazınız! Örnek: elma{0}meyve{0}sebze{0}bahçe", Settings.SplitFormat));

                    DropDownList ddl = null;
                    //    = new DropDownList();
                    //ddl.ID = "Galeri";
                    //ddl.Width = 746;
                    //ddl.CssClass = "form-control";
                    //ddl.DataMember = "album";
                    //ddl.DataValueField = "id";
                    //ddl.DataTextField = "adi";
                    //AlbumCollection albumler = AlbumMethods.GetSelect(20);
                    //albumler.Insert(0, new Album { ID = 0, Adi = "<Seçiniz>" });
                    //ddl.DataSource = albumler;
                    //ddl.DataBind();
                    //ddl.SelectedValue = BAYMYO.UI.Converts.NullToString(m.Galeri);
                    //CustomizeControl1.AddControl("İlgili Galeri", ddl, m.Galeri > 0 ? string.Format("İlgili <b>Galeri</b>'ye resim yüklemek yada düzeltmek için <a href=\"{0}\" target=\"_blank\">buraya tıklayın.</a>", Settings.PanelPath + "?go=galeri&raid=" + m.Galeri) : "");

                    Image img = new Image();
                    img.ID      = "BuyukResim";
                    img.Width   = 250;
                    img.ToolTip = m.ResimUrl;
                    if (!string.IsNullOrEmpty(m.ResimUrl))
                    {
                        img.ImageUrl = Settings.ImagesPath + "haber/b/" + m.ResimUrl;
                    }
                    else
                    {
                        img.ImageUrl = Settings.ImagesPath + "admin-yok.png";
                    }
                    CustomizeControl1.AddControl("Büyük Resim", img);

                    FileUpload flu = new FileUpload();
                    flu.ID      = "ResimUrl";
                    flu.ToolTip = m.ResimUrl;
                    CustomizeControl1.AddControl("Resim Ekle", flu, "Tavsiye edilen, Genişlik(W):728px - Yükseklik(H):300px");

                    img       = new Image();
                    img.ID    = "KucukResim";
                    img.Width = 150;
                    if (!string.IsNullOrEmpty(m.ResimUrl))
                    {
                        img.ImageUrl = Settings.ImagesPath + "haber/" + m.ResimUrl;
                    }
                    else
                    {
                        img.ImageUrl = Settings.ImagesPath + "admin-yok.png";
                    }
                    CustomizeControl1.AddControl("Küçük Resim", img);

                    flu    = new FileUpload();
                    flu.ID = "KucukResimUrl";
                    CustomizeControl1.AddControl("Küçük Resim Ekle", flu, "<b>Bu alanda resim seçmezseniz büyük resim küçültülecektir.</b> Genişlik(W):350px/Yükseklik(H):140px");

                    ddl                = new DropDownList();
                    ddl.ID             = "Kategori";
                    ddl.Width          = 300;
                    ddl.CssClass       = "form-control";
                    ddl.DataMember     = "kategori";
                    ddl.DataValueField = "id";
                    ddl.DataTextField  = "adi";
                    List <Kategori> kategoriler = KategoriMethods.GetMenu("haber", true);
                    ListItem        item        = null;
                    foreach (Kategori kategori in kategoriler)
                    {
                        switch (kategori.ParentID)
                        {
                        case "":
                            item = new ListItem(kategori.Adi, kategori.ID);
                            item.Attributes.CssStyle.Value = "padding-left: 5px; background: #f5f5f5; color: #454545;";
                            break;

                        case "0":
                            item = new ListItem(kategori.Adi, kategori.ID);
                            item.Attributes.CssStyle.Value = "padding-left: 25px; background: #f5f5f5; color: #fe760c; font-weight: bold;";
                            break;

                        default:
                            item = new ListItem(kategori.Adi, kategori.ID);
                            item.Attributes.CssStyle.Value = string.Format("padding-left: {0}px; background: #f5f5f5; color: #454545;", (BAYMYO.UI.Converts.NullToInt(kategori.ParentID.Split(',').Length + 1) * 25));
                            break;
                        }
                        ddl.Items.Add(item);
                    }
                    kategoriler.Clear();
                    ddl.SelectedValue = BAYMYO.UI.Converts.NullToString(m.KategoriID);
                    CustomizeControl1.AddControl("Kategori", ddl, "<a href=\"" + Settings.PanelPath + "?go=kategori&mdl=haber\">[+] Yeni Kategori</a>");

                    //ddl = new DropDownList();
                    //ddl.ID = "Sehir";
                    //ddl.Width = 300;
                    //ddl.CssClass = "form-control";
                    //ddl.DataMember = "Sehir";
                    //ddl.DataValueField = "Adi";
                    //ddl.DataTextField = "Adi";
                    //SehirCollection sehirler = SehirMethods.GetSelect();
                    //sehirler.Insert(0, new Sehir(0, ""));
                    //ddl.DataSource = sehirler;
                    //ddl.DataBind();
                    //ddl.SelectedValue = BAYMYO.UI.Converts.NullToString(m.Sehir);
                    //CustomizeControl1.AddControl("Şehir (İL)", ddl);

                    //ddl = new DropDownList();
                    //ddl.ID = "Anasayfa";
                    //ddl.Width = 300;
                    //ddl.CssClass = "form-control";
                    //ddl.DataMember = "MainViewStates";
                    //ddl.DataValueField = "Key";
                    //ddl.DataTextField = "Value";
                    //ddl.DataSource = Core.GetMainViewStates();
                    //ddl.DataBind();
                    //ddl.SelectedValue = notNull ? m.Anasayfa.ToString() : "1";
                    //CustomizeControl1.AddControl("Anasayfa", ddl);

                    //DateTimeControl cnt = this.Page.LoadControl(Settings.DateTimeControlPath) as DateTimeControl;
                    //cnt.ID = "Tarih";
                    //cnt.FormatType = FormatTypes.DateTime;
                    //CustomizeControl1.AddControl("Yayın Tarihi", cnt, "* Seçilmesi zorunlu alan. Belirtilen tarihte haber yayımlanacaktır.");
                    //cnt.Date = (m.ID > 1) ? m.KayitTarihi : DateTime.Now;

                    CheckBoxList chkList = new CheckBoxList();
                    chkList.ID = "chkList";
                    chkList.RepeatDirection = RepeatDirection.Horizontal;
                    chkList.Items.Add("Gösterim Sayı");
                    chkList.Items[0].Selected = notNull ? m.GosterimSayi : true;
                    chkList.Items.Add("Üyelere Özel");
                    chkList.Items[1].Selected = m.Uye;
                    chkList.Items.Add("Yorumları Göster");
                    chkList.Items[2].Selected = notNull ? m.Yorum : false;
                    chkList.Items.Add("Yönetici Onayı");
                    chkList.Items[3].Selected = notNull ? m.YoneticiOnay : isAdmin;
                    chkList.Items[3].Enabled  = isAdmin;
                    chkList.Items.Add("Yayımla");
                    chkList.Items[4].Selected = notNull ? m.Aktif : isAdmin;
                    chkList.Items[4].Enabled  = isAdmin;

                    CustomizeControl1.AddControl("Seçimler", chkList);

                    //CustomizeControl1.AddTitle("HABER İÇERİSİNE VİDEO EKLE");

                    //ddl = new DropDownList();
                    //ddl.ID = "Video";
                    //ddl.Width = 746;
                    //ddl.CssClass = "form-control";
                    //ddl.DataMember = "video";
                    //ddl.DataValueField = "id";
                    //ddl.DataTextField = "baslik";
                    //VideoCollection videolar = VideoMethods.GetSelect(m.Video, 20);
                    //Video v = VideoMethods.GetVideo(m.Video);
                    //if (v.ID > 0)
                    //    videolar.Add(v);
                    //videolar.Insert(0, new Video { ID = 0, Baslik = "<Seçiniz>" });
                    //ddl.DataSource = videolar;
                    //ddl.DataBind();
                    //ddl.SelectedValue = BAYMYO.UI.Converts.NullToString(m.Video);
                    //CustomizeControl1.AddControl("İlgili Video", ddl, m.Video > 0 ? string.Format("İlgili <b>Video</b>'yu güncellemek için <a href=\"{0}\" target=\"_blank\">buraya tıklayın.</a>", Settings.PanelPath + "?go=video&vid=" + m.Video) : "Eğer listeden video seçilirse aşağıdaki embed kod ve kategori dikkate alınmayacaktır.");

                    //txt = new TextBox();
                    //txt.ID = "HaberEmbed";
                    //txt.Text = v.Embed;
                    //txt.CssClass = "form-control";
                    //txt.TextMode = TextBoxMode.MultiLine;
                    //txt.MaxLength = 750;
                    //txt.ClientIDMode = ClientIDMode.Static;
                    //CustomizeControl1.AddControl("Video Embed", txt, "Her hangi bir video sitesinden 'embed' kodu almanız gereklidir.");

                    //ddl = new DropDownList();
                    //ddl.ID = "KategoriVideo";
                    //ddl.Width = 250;
                    //ddl.CssClass = "form-control";
                    //ddl.DataMember = "kategori";
                    //ddl.DataValueField = "id";
                    //ddl.DataTextField = "adi";
                    //ddl.DataSource = KategoriMethods.GetMenu("video", true);
                    //ddl.DataBind();
                    //ddl.SelectedValue = BAYMYO.UI.Converts.NullToString(v.KategoriID);
                    //CustomizeControl1.AddControl("Video Kategorileri", ddl, "Sadece <b>Embed</b> kod girildiğinde kategori seçilmezse video yüklenmez.");

                    CustomizeControl1.SubmitClick += new CustomizeControl.ButtonEvent(CustomizeControl1_SubmitClick);
                    CustomizeControl1.RemoveClick += new CustomizeControl.ButtonEvent(CustomizeControl1_RemoveClick);
                }
            }
            catch (Exception ex)
            {
                CustomizeControl1.MessageText = MessageBox.Show(DialogResult.Error, ex.Message);
            }
            base.OnInit(e);
        }
Example #9
0
        protected override void OnInit(EventArgs e)
        {
            if (!Core.IsUserActive)
            {
                CustomizeControl1.PanelVisible = false;
                Response.Redirect(Settings.VirtualPath + "?go=login", false);
                return;
            }

            using (Hesap hsp = Core.CurrentUser)
            {
                if (!string.IsNullOrEmpty(hsp.ID))
                {
                    this.Page.Title = hsp.Adi + " " + hsp.Soyadi + " - Hesap Ayarları";
                    System.Web.UI.HtmlControls.HtmlMeta meta = new System.Web.UI.HtmlControls.HtmlMeta();
                    meta.Attributes.Add("name", "googlebot");
                    meta.Attributes.Add("content", "noindex");
                    this.Page.Header.Controls.Add(meta);

                    CustomizeControl1.AddTitle("Hesap Bilgileri");
                    CustomizeControl1.RemoveVisible = false;
                    TextBox txt = new TextBox();
                    txt.ID        = "hspAdi";
                    txt.Text      = hsp.Adi;
                    txt.CssClass  = "form-control";
                    txt.MaxLength = 18;
                    CustomizeControl1.AddControl("Adı", txt);

                    txt           = new TextBox();
                    txt.ID        = "hspSoyadi";
                    txt.CssClass  = "form-control";
                    txt.Text      = hsp.Soyadi;
                    txt.MaxLength = 15;
                    CustomizeControl1.AddControl("Soyadı", txt);

                    txt           = new TextBox();
                    txt.ID        = "hspMail";
                    txt.CssClass  = "form-control";
                    txt.Text      = hsp.Mail;
                    txt.MaxLength = 60;
                    txt.Enabled   = true;
                    txt.ReadOnly  = true;
                    CustomizeControl1.AddControl("Mail", txt, "Sisteme giriş yapmak için kullanılacaktır.");

                    txt           = new TextBox();
                    txt.ID        = "hspSifre";
                    txt.CssClass  = "form-control noHtml";
                    txt.ToolTip   = hsp.Sifre;
                    txt.TextMode  = TextBoxMode.Password;
                    txt.MaxLength = 25;
                    CustomizeControl1.AddControl("Şifre", txt, "Şifreyi değiştirmek istemiyorsanız boş bırakınız!");

                    DateTimeControl cnt = this.Page.LoadControl(Settings.DateTimeControlPath) as DateTimeControl;
                    cnt.ID         = "DogumTarihi";
                    cnt.FormatType = FormatTypes.BirthDate;
                    CustomizeControl1.AddControl("Doğum Tarihi", cnt, "* Seçilmesi zorunlu alan.");
                    cnt.Date = hsp.DogumTarihi;

                    DropDownList ddl = new DropDownList();
                    ddl.ID             = "hspCinsiyet";
                    ddl.Width          = 195;
                    ddl.DataValueField = "Key";
                    ddl.DataTextField  = "Value";
                    ddl.DataSource     = Core.GetSexTypes();
                    ddl.DataBind();
                    ddl.SelectedValue = BAYMYO.UI.Converts.NullToByte(hsp.Cinsiyet).ToString();
                    CustomizeControl1.AddControl("Cinsiyet", ddl);

                    CheckBox chk = new CheckBox();
                    chk.ID      = "hspAbonelik";
                    chk.Checked = hsp.Abonelik;
                    CustomizeControl1.AddControl("Abonelik", chk);

                    if (hsp.ProfilObject != null)
                    {
                        switch (hsp.Tipi)
                        {
                        case AccountType.Admin:
                        case AccountType.Private:
                        case AccountType.Doctor:
                        case AccountType.Editor:
                            CustomizeControl1.AddTitle("Profil Bilgileri");

                            Image img = new Image();
                            img.ID       = "prfImageUrl";
                            img.Width    = 210;
                            img.ImageUrl = Settings.ImagesPath + ((!string.IsNullOrEmpty(hsp.ProfilObject.ResimUrl)) ? "profil/" + hsp.ProfilObject.ResimUrl : "yok.png");
                            CustomizeControl1.AddControl("Fotoğraf", img);

                            FileUpload flu = new FileUpload();
                            flu.ID = "prfResimUrl";
                            CustomizeControl1.AddControl("Yeni Fotoğraf", flu, "Genişlik(W):160px - Yükseklik(H):170px");

                            txt           = new TextBox();
                            txt.ID        = "prfUrl";
                            txt.Text      = hsp.ProfilObject.Url;
                            txt.CssClass  = "form-control";
                            txt.MaxLength = 50;
                            CustomizeControl1.AddControl("Url", txt, "Sadece küçük harf ve en az '<b>4</b>' karakter den oluşan içerik girebilirsiniz. Ör. " + Settings.SiteUrl + "<b class=\"toolTip titleFormat1\" title=\"Adres çubuğunda sitemizin adının yanına '/' ters slaş yaparak burada belirteceğiniz isim ile profilinizin görüntülenmesini sağlar.\">adisoyadi</b>");

                            txt           = new TextBox();
                            txt.ID        = "prfAdi";
                            txt.Text      = hsp.ProfilObject.Adi;
                            txt.CssClass  = "form-control";
                            txt.MaxLength = 50;
                            CustomizeControl1.AddControl("Başlık", txt, "Profilde gösterilecek olan <b>başlıktır</b>. 'Ör. Sezgin'nin Sayfasına Hoş Geldiniz!'");

                            txt           = new TextBox();
                            txt.ID        = "prfMail";
                            txt.Text      = hsp.ProfilObject.Mail;
                            txt.CssClass  = "form-control";
                            txt.MaxLength = 60;
                            CustomizeControl1.AddControl("Profil Maili", txt, "Profilde gösterilecek olan <b>'Mail'</b> adresidir. 'Not: Profiliniz üzerinden bu adrese mail gönderebilecekler!'");

                            txt           = new TextBox();
                            txt.ID        = "prfWeb";
                            txt.Text      = hsp.ProfilObject.Web;
                            txt.CssClass  = "form-control noHtml";
                            txt.MaxLength = 60;
                            CustomizeControl1.AddControl("Web Adresi", txt, "Profilde gösterilecek olan <b>'Web Site'</b> adresidir.");

                            txt           = new TextBox();
                            txt.ID        = "prfTelefon";
                            txt.Text      = hsp.ProfilObject.Telefon;
                            txt.CssClass  = "form-control noHtml isNumber";
                            txt.MaxLength = 16;
                            CustomizeControl1.AddControl("Telefon", txt, "Profilde gösterilecek olan <b>'Telefon'</b> numarasıdır. Ör. <b>0326 6XX 2X 0X</b>");

                            txt           = new TextBox();
                            txt.ID        = "prfGSM";
                            txt.Text      = hsp.ProfilObject.GSM;
                            txt.CssClass  = "form-control noHtml isNumber";
                            txt.MaxLength = 16;
                            CustomizeControl1.AddControl("GSM", txt, "Profilde gösterilecek olan <b>'GSM'</b> numarasıdır. Ör. <b>0544 2XX 4X 5X</b>");

                            ddl                = new DropDownList();
                            ddl.ID             = "RprfSehir";
                            ddl.Width          = 250;
                            ddl.DataMember     = "Sehir";
                            ddl.DataValueField = "Adi";
                            ddl.DataTextField  = "Adi";
                            SehirCollection sehirler = SehirMethods.GetSelect();
                            sehirler.Insert(0, new Sehir(0, ""));
                            ddl.DataSource = sehirler;
                            ddl.DataBind();
                            ddl.SelectedValue = hsp.ProfilObject.Sehir;
                            CustomizeControl1.AddControl("Şehir (İL)", ddl, "<b>Şehir</b> adı harita üzerinde bulunmasını sağlayacaktır.");

                            ddl                = new DropDownList();
                            ddl.ID             = "prfMeslekID";
                            ddl.Width          = 250;
                            ddl.DataMember     = "kategori";
                            ddl.DataValueField = "id";
                            ddl.DataTextField  = "adi";
                            ddl.DataSource     = KategoriMethods.GetMenu("meslek", true);
                            ddl.DataBind();
                            ddl.SelectedValue = hsp.ProfilObject.Meslek;
                            CustomizeControl1.AddControl("Meslek", ddl, "* Seçmesi zorunlu alan.");

                            ddl                = new DropDownList();
                            ddl.ID             = "prfEgitimID";
                            ddl.Width          = 250;
                            ddl.DataMember     = "kategori";
                            ddl.DataValueField = "id";
                            ddl.DataTextField  = "adi";
                            ddl.DataSource     = KategoriMethods.GetMenu("egitim", true);
                            ddl.DataBind();
                            ddl.SelectedValue = hsp.ProfilObject.Egitim;
                            CustomizeControl1.AddControl("Eğitim", ddl, "* Seçmesi zorunlu alan.");

                            txt           = new TextBox();
                            txt.ID        = "prfHakkimda";
                            txt.Text      = hsp.ProfilObject.Hakkimda;
                            txt.CssClass  = "form-control noHtml";
                            txt.Height    = 150;
                            txt.TextMode  = TextBoxMode.MultiLine;
                            txt.MaxLength = 500;
                            CustomizeControl1.AddControl("Hakkimda", txt, "Bu alana <b>500</b> karaktere kadar bilgi girişi yapabilirsiniz.");

                            CustomizeControl1.SubmitClick += new CustomizeControl.ButtonEvent(editorHesap_SubmitClick);
                            break;

                        default:
                            CustomizeControl1.SubmitClick += new CustomizeControl.ButtonEvent(standartHesap_SubmitClick);
                            break;
                        }
                    }
                }
            }
            base.OnInit(e);
        }
Example #10
0
        protected override void OnInit(EventArgs e)
        {
            try
            {
                CustomizeControl1.FormTitle = string.Format(Settings.FormTitleFormat, "Makale", "Ekleme/Düzeltme Formu");
                if (Request.QueryString["mklid"] != null)
                {
                    ViewState["tempID"] = Request.QueryString["mklid"];
                }
                using (Makale m = MakaleMethods.GetMakale(BAYMYO.UI.Converts.NullToInt64(ViewState["tempID"])))
                {
                    bool notNull = (m.ID > 0), isAdmin = Core.IsUserAdmin;
                    if (notNull)
                    {
                        Default(m, isAdmin);
                    }

                    TextBox txt = new TextBox();
                    txt.ID        = "Baslik";
                    txt.CssClass  = "form-control";
                    txt.Text      = m.Baslik;
                    txt.MaxLength = 75;
                    CustomizeControl1.AddControl("Başlık", txt);

                    txt           = new TextBox();
                    txt.ID        = "Ozet";
                    txt.CssClass  = "form-control";
                    txt.Text      = m.Ozet;
                    txt.TextMode  = TextBoxMode.MultiLine;
                    txt.MaxLength = 150;
                    CustomizeControl1.AddControl("Özet", txt, "Liste ve RSS'ler için gösterilecek içeriktir.");

                    CKEditor.NET.CKEditorControl fck = new CKEditor.NET.CKEditorControl();
                    fck.ID     = "Icerik";
                    fck.Height = 400;
                    fck.Text   = m.Icerik;
                    CustomizeControl1.AddControl("Editör", fck);

                    txt           = new TextBox();
                    txt.ID        = "Etiket";
                    txt.CssClass  = "form-control";
                    txt.Text      = m.Etiket;
                    txt.MaxLength = 100;
                    CustomizeControl1.AddControl("Etiket", txt, string.Format("Lütfen virgül({0}) ile ayrıarak ve boşluk bırakmadan yazınız! Örnek: elma{0}meyve{0}sebze{0}bahçe", Settings.SplitFormat));

                    //DateTimeControl cnt = this.Page.LoadControl(Settings.DateTimeControlPath) as DateTimeControl;
                    //cnt.ID = "Tarih";
                    //cnt.FormatType = FormatTypes.DateTime;
                    //CustomizeControl1.AddControl("Tarih", cnt, "* Seçilmesi zorunlu alan.");
                    //cnt.Date = m.KayitTarihi;

                    DropDownList ddl = new DropDownList();
                    ddl.ID             = "Yazar";
                    ddl.Width          = 250;
                    ddl.CssClass       = "form-control";
                    ddl.DataMember     = "hesap";
                    ddl.DataValueField = "id";
                    ddl.DataTextField  = "adi";
                    using (BAYMYO.UI.Web.CustomSqlQuery data = new BAYMYO.UI.Web.CustomSqlQuery(ddl, "select id, concat_ws(' ',adi,soyadi) as adi from hesap where tipi in(1,2,5)"))
                    {
                        data.Execute();
                    }
                    ddl.Items.Insert(0, new ListItem("<Seçiniz>", ""));
                    ddl.SelectedValue = BAYMYO.UI.Converts.NullToString(m.HesapID);
                    CustomizeControl1.AddControl("Yazarlar", ddl, "<a href=\"" + Settings.PanelPath + "?go=hesap&type=2\">[+] Yeni Yazar</a> (Not: Buraya sadece <b>Admin</b>, <b>Moderatör</b> ve <b>Private</b> olan yazarlar getirilir.)");

                    ddl                = new DropDownList();
                    ddl.ID             = "Kategori";
                    ddl.Width          = 250;
                    ddl.CssClass       = "form-control";
                    ddl.DataMember     = "kategori";
                    ddl.DataValueField = "id";
                    ddl.DataTextField  = "adi";
                    List <Kategori> kategoriler = KategoriMethods.GetMenu("makale", true);
                    ListItem        item        = null;
                    foreach (Kategori kategori in kategoriler)
                    {
                        switch (kategori.ParentID)
                        {
                        case "":
                            item = new ListItem(kategori.Adi, kategori.ID);
                            item.Attributes.CssStyle.Value = "padding-left: 5px;background: #f5f5f5; color: #454545;";
                            break;

                        case "0":
                            item = new ListItem(kategori.Adi, kategori.ID);
                            item.Attributes.CssStyle.Value = "padding-left: 25px;background: #f5f5f5; color: #fe760c; font-weight: bold;";
                            break;

                        default:
                            item = new ListItem(kategori.Adi, kategori.ID);
                            item.Attributes.CssStyle.Value = string.Format("padding-left: {0}px;background: #f5f5f5; color: #454545;", (BAYMYO.UI.Converts.NullToInt(kategori.ParentID.Split(',').Length + 1) * 25));
                            break;
                        }
                        ddl.Items.Add(item);
                    }
                    kategoriler.Clear();
                    ddl.SelectedValue = BAYMYO.UI.Converts.NullToString(m.KategoriID);
                    CustomizeControl1.AddControl("Kategori", ddl, "<a href=\"" + Settings.PanelPath + "?go=kategori&mdl=makale\">[+] Yeni Kategori</a>");

                    Image img = new Image();
                    img.ID      = "BuyukResim";
                    img.ToolTip = m.ResimUrl;
                    if (!string.IsNullOrEmpty(m.ResimUrl))
                    {
                        img.ImageUrl = Settings.ImagesPath + "makale/" + m.ResimUrl;
                    }
                    else
                    {
                        img.ImageUrl = Settings.ImagesPath + "admin-yok.png";
                    }
                    CustomizeControl1.AddControl("Makale Resim", img);

                    FileUpload flu = new FileUpload();
                    flu.ID       = "ResimUrl";
                    flu.ToolTip  = m.ResimUrl;
                    flu.CssClass = "form-control";
                    CustomizeControl1.AddControl("Resim Ekle", flu, "Genişlik(W):728px - Yükseklik(H):300px");

                    CheckBoxList chkList = new CheckBoxList();
                    chkList.ID = "chkList";
                    chkList.RepeatDirection = RepeatDirection.Horizontal;
                    chkList.Items.Add("Gösterim Sayı");
                    chkList.Items[0].Selected = notNull ? m.GosterimSayi : true;
                    chkList.Items.Add("Üyelere Özel");
                    chkList.Items[1].Selected = m.Uye;
                    chkList.Items.Add("Yorumları Göster");
                    chkList.Items[2].Selected = notNull ? m.Yorum : false;
                    chkList.Items.Add("Yönetici Onayı");
                    chkList.Items[3].Selected = notNull ? m.YoneticiOnay : isAdmin;
                    chkList.Items[3].Enabled  = isAdmin;
                    chkList.Items.Add("Yayımla");
                    chkList.Items[4].Selected = notNull ? m.Aktif : isAdmin;
                    chkList.Items[4].Enabled  = isAdmin;
                    CustomizeControl1.AddControl("Seçimler", chkList);

                    CustomizeControl1.SubmitClick += new CustomizeControl.ButtonEvent(CustomizeControl1_SubmitClick);
                    CustomizeControl1.RemoveClick += new CustomizeControl.ButtonEvent(CustomizeControl1_RemoveClick);
                }
            }
            catch (Exception ex)
            {
                CustomizeControl1.MessageText = MessageBox.Show(DialogResult.Error, ex.Message);
            }
            base.OnInit(e);
        }