protected void Page_Load(object sender, EventArgs e)
        {
            user = (Users)Session["USER"];

            lblUserName.Text          = user.UserName.ToString().Clean();
            lblNameSurname.Text       = user.NameSurname.ToString().Clean();
            lblNameSurname2.Text      = user.NameSurname.ToString().Clean();
            lblNameSurname3.Text      = user.NameSurname.ToString().Clean();
            lblemail.Text             = user.Email.ToString().Clean();
            ImgContact.ImageUrl       = "Content\\img\\ImgContact.jpg";
            ImgProfilePhoto1.ImageUrl = user.ProfilePhoto.Clean();
            ImgProfilePhoto2.ImageUrl = user.ProfilePhoto.Clean();
            ImgProfilePhoto3.ImageUrl = user.ProfilePhoto.Clean();
            if (ImgProfilePhoto1.ImageUrl == "")
            {
                ImgProfilePhoto1.ImageUrl = "Content\\img\\user2-160x160.jpg";
            }
            if (ImgProfilePhoto2.ImageUrl == "")
            {
                ImgProfilePhoto2.ImageUrl = "Content\\img\\user2-160x160.jpg";
            }
            if (ImgProfilePhoto3.ImageUrl == "")
            {
                ImgProfilePhoto3.ImageUrl = "Content\\img\\user2-160x160.jpg";
            }

            languagess        = jobs.Languages();
            contacts          = jobs.Contact();
            pages             = jobs.Pages();
            productcategories = jobs.Productcategory();
            products          = jobs.Products();
            notifications     = jobs.NotificationTop5(); // Top 5
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            products = jobs.Products();

            languagess     = jobs.Languages();
            BtnAddNew.Text = Resources.Index.AddProduct;
        }
        protected void Application_PostAuthenticateRequest(object sender, EventArgs e)
        {
            // This will work with every request..

            HttpCookie cookie = Request.Cookies["locale"];

            if (cookie != null)
            {
                Thread.CurrentThread.CurrentCulture = new CultureInfo(cookie.Value);

                Thread.CurrentThread.CurrentUICulture = new CultureInfo(cookie.Value);
            }
            else
            {
                //Querying the languages

                string language = Request.UserLanguages[0].ToLowerInvariant().Trim();

                CultureInfo cultureInfo = CultureInfo.CreateSpecificCulture(language);

                Languages lang = jobs.Languages().Where(x => x.DisplayName == cultureInfo.DisplayName).SingleOrDefault();
                // The languages will chosing on browser will compare with the languages which are comes from dbase
                // otherwise default lang will be set as current language
                if (lang != null)
                {
                    Thread.CurrentThread.CurrentCulture = new CultureInfo(lang.DisplayName);

                    Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang.DisplayName);

                    HttpCookie newCookie = new HttpCookie("locale");

                    newCookie.Value = lang.DisplayName;

                    newCookie.Expires = DateTime.UtcNow.AddDays(7);

                    Response.Cookies.Add(newCookie);
                }
                else
                {
                    // Chosing the default language

                    Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");

                    Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");

                    HttpCookie newCookie = new HttpCookie("locale");

                    newCookie.Value = "en-US";

                    newCookie.Expires = DateTime.UtcNow.AddDays(7);

                    Response.Cookies.Add(newCookie);
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     contacts   = jobs.Contact();
     languagess = jobs.Languages();
     PageTitle  = Resources.Index.Contact;
 }
Example #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     galleriess     = jobs.Galleries();
     languagess     = jobs.Languages();
     BtnAddNew.Text = Resources.Index.AddNewGallery;
 }
Example #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     referencess    = jobs.References();
     languagess     = jobs.Languages();
     BtnAddNew.Text = Resources.Index.AddNewReference;
 }
Example #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     newss          = jobs.News();
     languagess     = jobs.Languages();
     BtnAddNew.Text = Resources.Index.AddNews;
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            btnUpdate.ServerClick += BtnUpdate_ServerClick;
            btnClear.ServerClick  += BtnClear_ServerClick;
            btnClear.Value         = Resources.Index.Clean;
            btnUpdate.Value        = Resources.Index.Add;
            staffJobPositions      = jobs.StaffJobPosition();
            languagess             = jobs.Languages();

            if (Request.QueryString["Process"] != null)
            {
                string Processs = Request.QueryString["Process"];

                if (Processs == "EditCategoryName")
                {
                    Prcs = AddStaffPositions.Process.EditCategoryName;
                    id   = Request.QueryString["id"].Clean();
                    Dictionary <string, string> condition = new Dictionary <string, string>();
                    condition.Add("id", id);
                    staffJobPositions = jobs.StaffJobPosition(condition);
                    btnUpdate.Value   = Resources.Index.Update;
                    if (staffJobPositions.Count > 0)
                    {
                        PageTitle = Resources.Index.EditStaffPosition;
                        {
                            if (!Page.IsPostBack)
                            {
                                txtCategoryNameTR.Value = staffJobPositions[0].StaffJobPositionTR.ToString().Clean();
                                txtCategoryNameEN.Value = staffJobPositions[0].StaffJobPositionEN.ToString().Clean();
                            }
                        }
                    }
                    else
                    {
                        PageTitle = Resources.Index.DataNotFound;
                        Prcs      = AddStaffPositions.Process.DataNotFound;
                    }
                }
                else if (Processs == "DeleteCategoryName")
                {
                    PageTitle = Resources.Index.DeleteStaffPosition;
                    Prcs      = AddStaffPositions.Process.DeleteCategoryName;
                    id        = Request.QueryString["id"].Clean();
                    int result = jobs.query("Delete StaffJobPosition where id='" + id + "'");
                    if (result > 0)
                    {
                        Response.Redirect("/AddStaffPositions.aspx");
                    }
                    else
                    {
                        Response.Write("Error1");
                    }
                }
                else
                {
                    PageTitle = Resources.Index.WrongParameter;
                }
            }
            else
            {
                btnUpdate.Value = Resources.Index.Add;
                PageTitle       = Resources.Index.AddStaffPosition;
                Prcs            = Process.AddCategoryName;
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     sliderss       = jobs.Sliders();
     languagess     = jobs.Languages();
     BtnAddNew.Text = Resources.Index.AddNewSlider;
 }
Example #10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     languagess     = jobs.Languages();
     allstaffs      = jobs.Staffs();
     BtnAddNew.Text = Resources.Index.AddNewStaff;
 }