protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["Process"] != null) { string Processs = Request.QueryString["Process"]; if (Processs == "ViewContact") { Prcs = ViewContactMessage.Process.ViewContact; id = Request.QueryString["id"].Clean(); Dictionary <string, string> condition = new Dictionary <string, string>(); condition.Add("id", id); contacts = jobs.Contact(condition); if (contacts.Count > 0) { PageTitle = Resources.Index.ViewContact; txtSenderName.Value = contacts[0].SenderName.ToString().Clean(); txtContactMessage.Value = contacts[0].ContactMessage.ToString().Clean(); int result = jobs.query("Update notifications set IsRead='" + true + "' where id='" + id + "'"); } else { PageTitle = Resources.Index.DataNotFound; Prcs = ViewContactMessage.Process.DataNotFound; } } } }
private void SettingsUpdate(int id) { string UserName = txtUserName.Value.ToString().Clean(); string Password = txtPassword.Value.ToString().Clean(); string ConfirmPassword = txtConfirmPassword.Value.ToString().Clean(); string NameSurname = txtNameSurname.Value.ToString().Clean(); string Email = txtEmail.Value.ToString().Clean(); string UserRole = ddlYetki.SelectedValue.Clean(); if (FileUpload1.HasFile) { if (Path.GetExtension(FileUpload1.PostedFile.FileName) == ".jpg" || Path.GetExtension(FileUpload1.PostedFile.FileName) == ".png") { Random rndm = new Random(); string PhotoExtensions = Path.GetExtension(FileUpload1.PostedFile.FileName); string PhotoName = FileUpload1.PostedFile.FileName /*+ rndm.Next(99999999, 999999999) + PhotoExtensions*/; //Firstly we will save chosen images to \\images\\ folder as temporary FileUpload1.SaveAs(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); //After we are converting as bitmap Bitmap Photo = new Bitmap(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); int Width = 160; int Height = 160; //Resizing the photo Size Size = new Size(Width, Height); //Resizing Proho. Bitmap ResizedPhoto = new Bitmap(Photo, Size); string Resizedandsavedphoto = "~\\Content\\img\\uploads\\" + PhotoName; //We are saving resized photo to \\images\\userphotos\\ folder ResizedPhoto.Save(Server.MapPath(Resizedandsavedphoto), ImageFormat.Jpeg); Photo.Dispose(); ResizedPhoto.Dispose(); //we delete the photo we saved as temporary FileInfo Firstuploadedphoto = new FileInfo(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); Firstuploadedphoto.Delete(); image1.ImageUrl = Resizedandsavedphoto.Clean(); } } var img1 = image1.ImageUrl.ToString().Clean(); int result = jobs.query("Update users set UserName='******',Password='******',ConfirmPassword='******',NameSurname='" + NameSurname + "',Email='" + Email + "',RoleID='" + UserRole + "',ProfilePhoto='" + img1 + "' where id='" + id + "'"); if (result > 0) { Response.Redirect("/index.aspx"); } else { Error1 = Resources.Index.Pleasefillallrequiredfields; } }
protected void Page_Load(object sender, EventArgs e) { btnUpdate.ServerClick += BtnUpdate_ServerClick; btnClear.ServerClick += BtnClear_ServerClick; BtnUpload.Text = Resources.Index.Upload; btnClear.Value = Resources.Index.Clean; if (Request.QueryString["Process"] != null) { string Processs = Request.QueryString["Process"]; if (Processs == "EditPartner") { Prcs = AddNewPartner.Process.EditPartner; id = Request.QueryString["id"].Clean(); Dictionary <string, string> condition = new Dictionary <string, string>(); condition.Add("id", id); partnerss = jobs.Partners(condition); btnUpdate.Value = Resources.Index.Update; if (partnerss.Count > 0) { PageTitle = Resources.Index.EditServices; { if (!Page.IsPostBack) { txtPartnerName.Value = partnerss[0].PartnerName.ToString().Clean(); image1.ImageUrl = partnerss[0].PartnerLogo.ToString().Clean(); imageuploading.Visible = false; } } } else { PageTitle = Resources.Index.DataNotFound; Prcs = AddNewPartner.Process.DataNotFound; } } else if (Processs == "DeletePartner") { PageTitle = Resources.Index.DeletePartner; Prcs = AddNewPartner.Process.DeletePartner; id = Request.QueryString["id"].Clean(); int result = jobs.query("Delete partners where id='" + id + "'"); if (result > 0) { Response.Redirect("/PartnerList.aspx"); } else { Response.Write("Error"); } } else { Title = Resources.Index.WrongParameter; } } else { btnUpdate.Value = Resources.Index.AddNewPartner; PageTitle = Resources.Index.AddNewPartner; Prcs = Process.AddPartner; Viewingimages.Visible = false; uploadbuttondiv.Visible = false; } if (FileUpload1.HasFile) { if (Path.GetExtension(FileUpload1.PostedFile.FileName) == ".jpg" || Path.GetExtension(FileUpload1.PostedFile.FileName) == ".png") { Random rndm = new Random(); string PhotoExtensions = Path.GetExtension(FileUpload1.PostedFile.FileName); string PhotoName = FileUpload1.PostedFile.FileName /*+ rndm.Next(99999999, 999999999) + PhotoExtensions*/; //Firstly we will save chosen images to \\images\\ folder as temporary FileUpload1.SaveAs(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); //After we are converting as bitmap Bitmap Photo = new Bitmap(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); int Width = 215; int Height = 215; //Resizing the photo Size Size = new Size(Width, Height); //Resmi boyutlandırıyoruz. Bitmap ResizedPhoto = new Bitmap(Photo, Size); string Resizedandsavedphoto = "~\\Content\\img\\uploads\\" + PhotoName; //We are saving resized photo to \\images\\userphotos\\ folder ResizedPhoto.Save(Server.MapPath(Resizedandsavedphoto), ImageFormat.Jpeg); Photo.Dispose(); ResizedPhoto.Dispose(); //we delete the photo we saved as temporary FileInfo Firstuploadedphoto = new FileInfo(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); Firstuploadedphoto.Delete(); image1.ImageUrl = Resizedandsavedphoto.Clean(); } } }
private void SettingsUpdate(int id) { string Companyname = txtCompanyName.Value.ToString().Clean(); string keywords = txtKeywords.Value.ToString().Clean(); string Siteurl = txtSiteURL.Value.ToString().Clean(); string CompanyEmail = txtCompanyEmail.Value.ToString().Clean(); string CompanyPhone = txtCompanyPhone.Value.ToString().Clean(); string CompanyAddress = txtCompanyAddress.Value.ToString().Clean(); string WeekdaysWorkingHours = txtWeekdaysWorkingHours.Value.ToString().Clean(); string WeekendWorkingHours = txtWeekendWorkingHours.Value.ToString().Clean(); string Copyright = txtCopyright.Value.ToString().Clean(); string CompanyFacebook = txtCompanyFacebook.Value.ToString().Clean(); string CompanyTwitter = txtCompanyTwitter.Value.ToString().Clean(); string CompanyLinkedin = txtCompanyLinkedin.Value.ToString().Clean(); string CompanySkype = txtCompanySkype.Value.ToString().Clean(); string SiteStation = ""; if (chkopen.Checked) { SiteStation = chkopen.Value.ToString().Clean(); } if (chkclose.Checked) { SiteStation = chkclose.Value.ToString().Clean(); } if (FileUpload1.HasFile) { if (Path.GetExtension(FileUpload1.PostedFile.FileName) == ".jpg" || Path.GetExtension(FileUpload1.PostedFile.FileName) == ".png") { Random rndm = new Random(); string PhotoExtensions = Path.GetExtension(FileUpload1.PostedFile.FileName); string PhotoName = FileUpload1.PostedFile.FileName + rndm.Next(99999999, 999999999) + PhotoExtensions; //Firstly we will save chosen images to \\images\\ folder as temporary FileUpload1.SaveAs(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); //After we are converting as bitmap Bitmap Photo = new Bitmap(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); int Width = 215; int Height = 215; //Resizing the photo Size Size = new Size(Width, Height); //Resmi boyutlandırıyoruz. Bitmap ResizedPhoto = new Bitmap(Photo, Size); string Resizedandsavedphoto = "~\\Content\\img\\uploads\\" + PhotoName; //We are saving resized photo to \\images\\userphotos\\ folder ResizedPhoto.Save(Server.MapPath(Resizedandsavedphoto), ImageFormat.Jpeg); Photo.Dispose(); ResizedPhoto.Dispose(); //we delete the photo we saved as temporary FileInfo Firstuploadedphoto = new FileInfo(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); Firstuploadedphoto.Delete(); image1.ImageUrl = Resizedandsavedphoto.Clean(); } } var img1 = image1.ImageUrl.ToString().Clean(); int result = jobs.query("Update generalsettings set CompanyName='" + Companyname + "',Keywords='" + keywords + "',SiteUrl='" + Siteurl + "',CompanyEmail='" + CompanyEmail + "',CompanyPhone='" + CompanyPhone + "',CompanyAddress='" + CompanyAddress + "',WeekdaysWorkingHours='" + WeekdaysWorkingHours + "',WeekendWorkingHours='" + WeekendWorkingHours + "',Copyright='" + Copyright + "' ,CompanyFacebook='" + CompanyFacebook + "',CompanyTwitter='" + CompanyTwitter + "',CompanyLinkedin='" + CompanyLinkedin + "',CompanySkype='" + CompanySkype + "',SiteStution='" + SiteStation + "',SiteLogo='" + img1 + "' where id='" + id + "'");; if (result > 0) { Response.Redirect("/index.aspx"); } else { Error1 = Resources.Index.Pleasefillallrequiredfields; } }
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) { if (ddlCategory.Items.Count != 0) { gallerycategoriess = jobs.Gallerycategories(); foreach (var item in gallerycategoriess) { ddlCategory.Items.Add(item.GaleryCategoryNameEN.ToString()); ddlCategory.Items[ddlCategory.Items.Count - 1].Value = item.id.ToString().Clean(); } } btnUpdate.ServerClick += BtnUpdate_ServerClick; btnClear.ServerClick += BtnClear_ServerClick; BtnUpload.Text = Resources.Index.Upload; btnClear.Value = Resources.Index.Clean; if (Request.QueryString["Process"] != null) { string Processs = Request.QueryString["Process"]; if (Processs == "EditGallery") { Prcs = AddNewGallery.Process.EditGallery; id = Request.QueryString["id"].Clean(); Dictionary <string, string> condition = new Dictionary <string, string>(); condition.Add("id", id); galleriess = jobs.Galleries(condition); btnUpdate.Value = Resources.Index.Update; if (galleriess.Count > 0) { PageTitle = Resources.Index.EditGallery; { if (!Page.IsPostBack) { string CategoryName = galleriess[0].id.ToString().Clean(); ddlCategory.SelectedValue = CategoryName; lblturkish.Text = Resources.Index.Turkish; lblenglish.Text = Resources.Index.English; txtTurkishTitle.Value = galleriess[0].GaleryNameTR.ToString().Clean(); txtEnglishTitle.Value = galleriess[0].GaleryNameEN.ToString().Clean(); image1.ImageUrl = galleriess[0].GaleryPhoto1.ToString().Clean(); image2.ImageUrl = galleriess[0].GaleryPhoto2.ToString().Clean(); image3.ImageUrl = galleriess[0].GaleryPhoto3.ToString().Clean(); image4.ImageUrl = galleriess[0].GaleryPhoto4.ToString().Clean(); imageuploading.Visible = false; } } } else { PageTitle = Resources.Index.DataNotFound; Prcs = AddNewGallery.Process.DataNotFound; } } else if (Processs == "DeleteGallery") { PageTitle = Resources.Index.DeleteServices; Prcs = AddNewGallery.Process.DeleteGallery; id = Request.QueryString["id"].Clean(); int result = jobs.query("Delete galleries where id='" + id + "'"); if (result > 0) { Response.Redirect("/GalleryList.aspx"); } else { Response.Write("Error"); } } else { Title = Resources.Index.WrongParameter; } } else { btnUpdate.Value = Resources.Index.AddGallery; PageTitle = Resources.Index.AddGallery; Prcs = Process.AddGallery; Viewingimages.Visible = false; uploadbuttondiv.Visible = false; } if (FileUpload1.HasFile) { if (Path.GetExtension(FileUpload1.PostedFile.FileName) == ".jpg" || Path.GetExtension(FileUpload1.PostedFile.FileName) == ".png") { Random rndm = new Random(); string PhotoExtensions = Path.GetExtension(FileUpload1.PostedFile.FileName); string PhotoName = FileUpload1.PostedFile.FileName /*+ rndm.Next(99999999, 999999999) + PhotoExtensions*/; //Firstly we will save chosen images to \\images\\ folder as temporary FileUpload1.SaveAs(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); //After we are converting as bitmap Bitmap Photo = new Bitmap(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); int Width = 300; int Height = 285; //Resizing the photo Size Size = new Size(Width, Height); //Resmi boyutlandırıyoruz. Bitmap ResizedPhoto = new Bitmap(Photo, Size); string Resizedandsavedphoto = "~\\Content\\img\\uploads\\" + PhotoName; //We are saving resized photo to \\images\\userphotos\\ folder ResizedPhoto.Save(Server.MapPath(Resizedandsavedphoto), ImageFormat.Jpeg); Photo.Dispose(); ResizedPhoto.Dispose(); //we delete the photo we saved as temporary FileInfo Firstuploadedphoto = new FileInfo(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); Firstuploadedphoto.Delete(); image1.ImageUrl = Resizedandsavedphoto.Clean(); } } if (FileUpload2.HasFile) { if (Path.GetExtension(FileUpload2.PostedFile.FileName) == ".jpg" || Path.GetExtension(FileUpload2.PostedFile.FileName) == ".png") { Random rndm = new Random(); string PhotoExtensions = Path.GetExtension(FileUpload2.PostedFile.FileName); string PhotoName = FileUpload2.PostedFile.FileName /*+ rndm.Next(99999999, 999999999) + PhotoExtensions*/; //Firstly we will save chosen images to \\images\\ folder as temporary FileUpload2.SaveAs(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); //After we are converting as bitmap Bitmap Photo = new Bitmap(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); int Width = 300; int Height = 285; //Resizing the photo Size Size = new Size(Width, Height); //Resmi boyutlandırıyoruz. Bitmap ResizedPhoto = new Bitmap(Photo, Size); string Resizedandsavedphoto = "~\\Content\\img\\uploads\\" + PhotoName; //We are saving resized photo to \\images\\userphotos\\ folder ResizedPhoto.Save(Server.MapPath(Resizedandsavedphoto), ImageFormat.Jpeg); Photo.Dispose(); ResizedPhoto.Dispose(); //we delete the photo we saved as temporary FileInfo Firstuploadedphoto = new FileInfo(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); Firstuploadedphoto.Delete(); image2.ImageUrl = Resizedandsavedphoto.Clean(); } } if (FileUpload3.HasFile) { if (Path.GetExtension(FileUpload3.PostedFile.FileName) == ".jpg" || Path.GetExtension(FileUpload3.PostedFile.FileName) == ".png") { Random rndm = new Random(); string PhotoExtensions = Path.GetExtension(FileUpload3.PostedFile.FileName); string PhotoName = FileUpload3.PostedFile.FileName /*+ rndm.Next(99999999, 999999999) + PhotoExtensions*/; //Firstly we will save chosen images to \\images\\ folder as temporary FileUpload3.SaveAs(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); //After we are converting as bitmap Bitmap Photo = new Bitmap(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); int Width = 300; int Height = 285; //Resizing the photo Size Size = new Size(Width, Height); //Resmi boyutlandırıyoruz. Bitmap ResizedPhoto = new Bitmap(Photo, Size); string Resizedandsavedphoto = "~\\Content\\img\\uploads\\" + PhotoName; //We are saving resized photo to \\images\\userphotos\\ folder ResizedPhoto.Save(Server.MapPath(Resizedandsavedphoto), ImageFormat.Jpeg); Photo.Dispose(); ResizedPhoto.Dispose(); //we delete the photo we saved as temporary FileInfo Firstuploadedphoto = new FileInfo(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); Firstuploadedphoto.Delete(); image3.ImageUrl = Resizedandsavedphoto.Clean(); } } if (FileUpload4.HasFile) { if (Path.GetExtension(FileUpload4.PostedFile.FileName) == ".jpg" || Path.GetExtension(FileUpload4.PostedFile.FileName) == ".png") { Random rndm = new Random(); string PhotoExtensions = Path.GetExtension(FileUpload4.PostedFile.FileName); string PhotoName = FileUpload4.PostedFile.FileName /*+ rndm.Next(99999999, 999999999) + PhotoExtensions*/; //Firstly we will save chosen images to \\images\\ folder as temporary FileUpload4.SaveAs(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); //After we are converting as bitmap Bitmap Photo = new Bitmap(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); int Width = 300; int Height = 285; //Resizing the photo Size Size = new Size(Width, Height); //Resmi boyutlandırıyoruz. Bitmap ResizedPhoto = new Bitmap(Photo, Size); string Resizedandsavedphoto = "~\\Content\\img\\uploads\\" + PhotoName; //We are saving resized photo to \\images\\userphotos\\ folder ResizedPhoto.Save(Server.MapPath(Resizedandsavedphoto), ImageFormat.Jpeg); Photo.Dispose(); ResizedPhoto.Dispose(); //we delete the photo we saved as temporary FileInfo Firstuploadedphoto = new FileInfo(Server.MapPath("~\\Content\\img\\uploads\\temp\\") + PhotoName); Firstuploadedphoto.Delete(); image4.ImageUrl = Resizedandsavedphoto.Clean(); } } }