Exemple #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            AdminMenu adminMenu = new AdminMenu();

            adminMenu.IsActive = true;
            adminMenu.Link     = txtLink.Text;
            adminMenu.MenuIcon = "fa fa-" + ddlMenuIcon.SelectedItem.ToString();
            adminMenu.Name     = txtMenuName.Text;

            if (!chkSelectTopMenu.Checked)
            {
                adminMenu.TopMenuId = null;
            }
            else
            {
                adminMenu.TopMenuId = Convert.ToInt32(ddlTopMenu.SelectedValue);
            }

            GenericBS <AdminMenu> .Insert(adminMenu);

            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 Kaydedildi");
        }
        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");
        }
Exemple #3
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 Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         NotificationMessage.Success(divMessage, "Hoşgeldiniz" + SessionManager.ActiveUser.FullName);
     }
 }
        protected void btnKaydet_Click(object sender, EventArgs e)
        {
            string refString = "";

            User user = new User();

            user.Email           = txtEmail.Value;
            user.FullName        = txtFullName.Value;
            user.Password        = Hashing.HashWithMD5(txtPassword.Value);
            user.UserName        = txtUserName.Value;
            user.IsActive        = false;
            user.IsMailConfirmed = false;
            user.ActivationCode  = Guid.NewGuid();

            string filePath = FileUploader.UploadSingleFile(Request.Files, ref refString, 1024 * 1024, new string[] { "image/png", "image/jpg", "image/jpeg", "application/pdf" }, "/img/UserPhotos/");

            if (refString != "")
            {
                NotificationMessage.Error(divMessage, refString);
                return;
            }
            else
            {
                user.Photo = filePath;
                GenericBS <User> .Insert(user);

                string mailMessage = string.Format("Sayın <b>{0}</b>.Sistemimize hoşgeldiniz.Hesabınızın aktifleşebilmesi için lütfen aşağıdaki linke tıklayınız.<br/> <a href='http://localhost:57513/UserActivation.aspx?Code=" + user.ActivationCode + "'><b>http://localhost:57513/UserActivation.aspx?Code=" + user.ActivationCode + "</b></a>", user.FullName);
                MailSender.SendMail(user.Email, "Blog Aktivasyon", mailMessage);
                NotificationMessage.Success(divMessage, "Kullanıcı kaydı başarılı.Mail aktivasyonunu yapınız.");
            }
        }
        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ı");
        }
Exemple #7
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ı");
        }
Exemple #8
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                BlogEntry be = new BlogEntry();
                be.CategoryId = Convert.ToInt32(ddlCategory.SelectedValue);
                be.Content    = txtContent.Value;
                be.Date       = DateTime.Now;
                be.IsActive   = false;
                be.Title      = txtTitle.Value;
                be.UserId     = SessionManager.ActiveUser.Id;
                be.Abstract   = txtAbstract.Value;

                GenericBS <BlogEntry> .Insert(be);


                HttpFileCollection hfc = Request.Files;
                if (hfc.Count > 0)
                {
                    string isim = Guid.NewGuid().ToString();
                    for (int i = 0; i < hfc.Count; i++)
                    {
                        HttpPostedFile hpf      = hfc[i];
                        string         filePath = "~/img/BlogPhotos/" + isim + hpf.FileName;
                        hpf.SaveAs(Server.MapPath(filePath));
                        BlogEntryPhoto ph = new BlogEntryPhoto();
                        ph.BlogEntryId = be.Id;
                        ph.PhotoPath   = filePath;
                        GenericBS <BlogEntryPhoto> .Insert(ph);
                    }
                }
                NotificationMessage.Success(divMessage, "Kayıt Başarılı..");
                txtTitle.Value   = "";
                txtContent.Value = "";
            }
            catch (Exception)
            {
                NotificationMessage.Error(divMessage, "Kayıt Başarısız..");
            }
        }