Ejemplo n.º 1
0
        //(LinkButton) Edit butonu için,tıklayınca düzenmele kısmı gelecek
        //Repeter içindeki eleman sayfayı post ediyorsa çalışır (OnItemCommand argümanıyla) LinkButton için
        protected void rptAdminMenus_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "Update")
            {
                int       adminMenuId       = Convert.ToInt32(e.CommandArgument);
                AdminMenu adminMenuToUpdate = GenericBS <AdminMenu> .GetSingleItemByCriteria(x => x.Id == adminMenuId);

                txtLinkUpdate.Text = adminMenuToUpdate.Link;
                txtNameUpdate.Text = adminMenuToUpdate.Name;
                ddlMenuIconUpdate.SelectedItem.Text = adminMenuToUpdate.MenuIcon;
                if (adminMenuToUpdate.TopMenuId != null)
                {
                    chkTopMenuUpdate.Checked = true;
                    divTopMenuUpdate.Style.Add("display", "block");
                    ddlTopMenuUpdate.SelectedValue = adminMenuToUpdate.TopMenuId.Value.ToString();
                }
                else
                {
                    chkTopMenuUpdate.Checked = false;
                    divTopMenuUpdate.Style.Add("display", "none");
                }


                ClientScriptManager scr = Page.ClientScript;
                string script           = @"<script>$(document).ready(function(){
                                  $('#divUpdateAdminMenu').css('display','block');
                                  $('#divUpdateAdminMenu').removeClass('modal fade');
                                  $('#divUpdateAdminMenu').addClass('modal fade in');
                                   $('#ContentPlaceHolder1_AdminMenuYonetim1_hfUpdateAdminMenuId').val('" + adminMenuId + "');});</script>";


                scr.RegisterClientScriptBlock(Page.GetType(), "deneme", script);
            }
        }
Ejemplo n.º 2
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            int       adminMenuId       = Convert.ToInt32(hfUpdateAdminMenuId.Value);
            AdminMenu adminMenuToUpdate = GenericBS <AdminMenu> .GetSingleItemByCriteria(x => x.Id == adminMenuId);

            adminMenuToUpdate.Name     = txtNameUpdate.Text;
            adminMenuToUpdate.Link     = txtLinkUpdate.Text;
            adminMenuToUpdate.MenuIcon = "fa fa-" + ddlMenuIconUpdate.SelectedItem.ToString();
            //top menuye bak
            if (!chkTopMenuUpdate.Checked)
            {
                adminMenuToUpdate.TopMenuId = null;
            }
            else
            {
                adminMenuToUpdate.TopMenuId = Convert.ToInt32(ddlTopMenuUpdate.SelectedValue);
            }

            GenericBS <AdminMenu> .Update(adminMenuToUpdate);

            GetAdminMenus();


            //kaydet butonuna basınçda admin menü eklerken aynı anda left menüdede gözükmesi için
            (Page.Master.FindControl("LeftMenu") as LeftMenu).GetLeftMainAdminMenus();

            NotificationMessage.Success(divMessage, "Yeni Menü Başarı İle Güncellendi");
        }
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            string    refString         = "";
            int       adminUserId       = Convert.ToInt32(hfUpdateAdminId.Value);
            AdminUser adminUserToUpdate = GenericBS <AdminUser> .GetSingleItemByCriteria(x => x.Id == adminUserId);

            adminUserToUpdate.FullName = txtAdminFullNameUpdate.Text;
            adminUserToUpdate.UserName = txtAdminUsernameUpdate.Text;
            adminUserToUpdate.Password = txtAdminPasswordUpdate.Text;
            adminUserToUpdate.Email    = txtAdminEmailUpdate.Text;
            adminUserToUpdate.Job      = txtAdminJobUpdate.Text;

            string filePath = SavePhoto(ref refString);

            if (refString != "")
            {
                NotificationMessage.Error(divMessage, refString);
                return;
            }
            else
            {
                adminUserToUpdate.Photo = filePath;
                GenericBS <AdminUser> .Update(adminUserToUpdate);

                GetAdminUser();
            }



            //kaydet butonuna basınçda admin menü eklerken aynı anda left menüdede gözükmesi için
            //(Page.Master.FindControl("LeftMenu") as LeftMenu).GetLeftMainAdminMenus();

            NotificationMessage.Success(divMessage, "Yeni Menü Başarı İle Güncellendi");
        }
        protected void rptAdminUser_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "Update")
            {
                int       adminUserId       = Convert.ToInt32(e.CommandArgument);
                AdminUser adminUserToUpdate = GenericBS <AdminUser> .GetSingleItemByCriteria(x => x.Id == adminUserId);

                imgAdminPhotoUpdate.ImageUrl = adminUserToUpdate.Photo;
                txtAdminFullNameUpdate.Text  = adminUserToUpdate.FullName;
                txtAdminUsernameUpdate.Text  = adminUserToUpdate.UserName;
                //txtAdminPasswordUpdate.Text = adminUserToUpdate.Password;
                txtAdminEmailUpdate.Text = adminUserToUpdate.Email;
                txtAdminJobUpdate.Text   = adminUserToUpdate.Job;



                ClientScriptManager scr = Page.ClientScript;
                string script           = @"<script>$(document).ready(function(){
                                  $('#divUpdateAdmin').css('display','block');
                                  $('#divUpdateAdmin').removeClass('modal fade');
                                  $('#divUpdateAdmin').addClass('modal fade in');
                                   $('#ContentPlaceHolder1_AdminDuzenle1_hfUpdateAdminId').val('" + adminUserId + "');});</script>";


                scr.RegisterClientScriptBlock(Page.GetType(), "deneme", script);
            }
        }
Ejemplo n.º 5
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string userNameOrEmail = txtUserOrEmail.Text;
            string password        = Hashing.HashWithMD5(txtPassword.Text);

            User user =
                GenericBS <User> .
                GetSingleItemByCriteria(x => (x.UserName == userNameOrEmail && x.Password == password) || (x.Email == userNameOrEmail && x.Password == password));

            if (user != null)
            {
                if (!user.IsMailConfirmed.Value)
                {
                    NotificationMessage.Error(divMessage, "Henüz mail aktivasyonu yapmadınız!");
                }
                else if (!user.IsActive.Value)
                {
                    NotificationMessage.Error(divMessage, "Hesabınız henüz yönetici tarafından onaylanmamış!");
                }
                else
                {
                    SessionManager.ActiveUser = user;
                    Response.Redirect("~/UserPanel.aspx");
                }
            }
            else
            {
                NotificationMessage.Error(divMessage, "Böyle bir kullanıcı bulunamadı!");
            }
        }
        protected void lnkDeleteAdminUser_Click(object sender, EventArgs e)
        {
            int       adminUserId     = Convert.ToInt32(hfAdminUserId.Value);
            AdminUser adminUserDelete = GenericBS <AdminUser> .GetSingleItemByCriteria(x => x.Id == adminUserId);

            // silme işlemi
            //  GenericBS<AdminMenu>.Delete(adminMenuDelete);

            adminUserDelete.IsActive = false;
            GenericBS <AdminUser> .Update(adminUserDelete);

            GetAdminUser();
            NotificationMessage.Warning(divMessage, "Başarıyla Silindi");
        }
        protected void lnkApprove_Click(object sender, EventArgs e)
        {
            int       blogId      = Convert.ToInt32(hfBlogIdApprove.Value);
            BlogEntry blogApprove = GenericBS <BlogEntry> .GetSingleItemByCriteria(x => x.Id == blogId);

            // silme işlemi
            //  GenericBS<AdminMenu>.Delete(adminMenuDelete);

            blogApprove.IsActive = true;
            GenericBS <BlogEntry> .Update(blogApprove);

            GetBlogEntry();
            NotificationMessage.Success(divMessage, "Başarıyla Onaylandı");
        }
        protected void lnkDeleteUser_Click(object sender, EventArgs e)
        {
            int       blogId     = Convert.ToInt32(hfBlogId.Value);
            BlogEntry blogDelete = GenericBS <BlogEntry> .GetSingleItemByCriteria(x => x.Id == blogId);

            // silme işlemi
            //  GenericBS<AdminMenu>.Delete(adminMenuDelete);

            blogDelete.IsActive = false;
            GenericBS <BlogEntry> .Update(blogDelete);

            GetBlogEntry();
            NotificationMessage.Warning(divMessage, "Başarıyla Silindi");
        }
Ejemplo n.º 9
0
        protected void lnkApprove_Click(object sender, EventArgs e)
        {
            int  userId     = Convert.ToInt32(hfUserIdApprove.Value);
            User UserDelete = GenericBS <User> .GetSingleItemByCriteria(x => x.Id == userId);

            // silme işlemi
            //  GenericBS<AdminMenu>.Delete(adminMenuDelete);

            UserDelete.IsActive = true;
            GenericBS <User> .Update(UserDelete);

            GetUser();
            NotificationMessage.Success(divMessage, "Başarıyla Onaylandı");
        }
Ejemplo n.º 10
0
        protected void btnDeleteAdminMenu_Click(object sender, EventArgs e)
        {
            int       adminMenuId     = Convert.ToInt32(hfAdminMenuId.Value);
            AdminMenu adminMenuDelete = GenericBS <AdminMenu> .GetSingleItemByCriteria(x => x.Id == adminMenuId);

            // silme işlemi
            //  GenericBS<AdminMenu>.Delete(adminMenuDelete);

            adminMenuDelete.IsActive = false;
            GenericBS <AdminMenu> .Update(adminMenuDelete);

            NotificationMessage.Warning(divMessage, "Başarıyla Silindi");
            GetAdminMenus();
            (Page.Master.FindControl("LeftMenu") as LeftMenu).GetLeftMainAdminMenus();
        }
        private void GetBlogEntryDetails(int blogEntryId)
        {
            BlogEntry entry = GenericBS <BlogEntry> .GetSingleItemByCriteria(x => x.Id == blogEntryId && x.IsActive.Value);

            if (entry != null)
            {
                ltContent.Text   = entry.Content;
                ltTitle.Text     = entry.Title;
                ltCategory.Text  = entry.Category.CategoryName;
                ltUser.Text      = entry.User.FullName;
                ltDateDay.Text   = entry.Date.Value.Day.ToString();
                ltDateMonth.Text = ((MonthName)entry.Date.Value.Month).ToString();

                ControlBinder.BindRepeater(rptBlogEntryPhotos, entry.BlogEntryPhotoes.ToList());
            }
            else
            {
                Response.Redirect("/Default.aspx");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Guid code = Guid.Parse(Request.QueryString["Code"]);
                User user = GenericBS <User> .GetSingleItemByCriteria(x => x.ActivationCode == code);

                if (user != null)
                {
                    user.IsMailConfirmed = true;
                    GenericBS <User> .Update(user);

                    NotificationMessage.Error(divMessage, "Aktivasyon Başarılı.Yönetici onayından sonra giriş yapabilirsiniz.");
                }
                else
                {
                    NotificationMessage.Error(divMessage, "Aktivasyon Başarısız.Lütfen maildeki linke tıklayın.");
                }
            }
        }
Ejemplo n.º 13
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            string userName = txtUsername.Text;
            string password = Hashing.HashWithMD5(txtPassword.Text);



            AdminUser user = GenericBS <AdminUser> .GetSingleItemByCriteria(x => x.UserName == userName && x.Password == password);

            SessionManager.ActiveAdmin = user;

            if (user != null)
            {
                Response.Redirect("Default.aspx");
            }
            else
            {
                ltMessage.Text = "<div class='alert alert-danger'>Böyle bir kullanıcı bulunamadı..! </div>";
            }
        }
        protected void rptArticle_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "Article")
            {
                int       blogentryId = Convert.ToInt32(e.CommandArgument);
                BlogEntry articleId   = GenericBS <BlogEntry> .GetSingleItemByCriteria(x => x.Id == blogentryId);

                ltContext.Text = articleId.Content;
                ltTitle.Text   = articleId.Title;

                ClientScriptManager scr = Page.ClientScript;
                string script           = @"<script>$(document).ready(function(){
                                  $('#divArticle').css('display','block');
                                  $('#divArticle').removeClass('modal fade');
                                  $('#divArticle').addClass('modal fade in');
                                   $('#ContentPlaceHolder1_YaziOnaylama1_hdfArticleId').val('" + blogentryId + "');});</script>";


                scr.RegisterClientScriptBlock(Page.GetType(), "deneme", script);
            }
        }