private void BindData() { SqlCommand cmd = new SqlCommand(); cmd.Connection = con; if (Request.QueryString["cName"] != null && Request.QueryString["cName"] != "" && Request.QueryString["rName"] != null && Request.QueryString["rName"] != "") { cmd.CommandText = "SELECT * from restaurantProfile INNER JOIN menuItems ON restaurantProfile.restaurantID = menuItems.restaurantID WHERE restaurantProfile.restaurantName= '" + Request.QueryString["rName"] + "' AND menuItems.itemName='" + Request.QueryString["cName"] + "'"; } else if (Request.QueryString["rName"] != null && Request.QueryString["rName"] != "") { cmd.CommandText = "SELECT * from restaurantProfile WHERE restaurantProfile.restaurantName= '" + Request.QueryString["rName"] + "'"; } else if (Request.QueryString["cName"] != null && Request.QueryString["cName"] != "") { cmd.CommandText = "SELECT * from restaurantProfile INNER JOIN menuItems ON restaurantProfile.restaurantID = menuItems.restaurantID WHERE menuItems.itemName='" + Request.QueryString["cName"] + "'"; } //cmd.CommandText = "SELECT * from restaurantProfile INNER JOIN menuItems ON restaurantProfile.restaurantID = menuItems.restaurantID WHERE restaurantProfile.restaurantName= '"+Request.QueryString["rName"]+"' OR menuItems.itemName='"+Request.QueryString["cName"]+"'" ; cmd.CommandType = CommandType.Text; DataSet objDS = new DataSet(); SqlDataAdapter objDA = new SqlDataAdapter(); objDA.SelectCommand = cmd; con.Open(); objDA.Fill(objDS); con.Close(); RepeaterImages.DataSource = objDS; RepeaterImages.DataBind(); }
protected void Page_PreRender(object sender, EventArgs e) { lblPhotoManagerDirectory.Text = ImageDirectory; RepeaterImages.DataSource = new List <string>(); RepeaterImages.DataBind(); string scriptText = "javascript:" + StatusLabel.ClientID + ".innerHTML='';if (this.value != '') {" + btnSave.ClientID + ".click();}"; FileUploadControl.Attributes["onchange"] = scriptText; string scriptText2 = FileUploadControl.ClientID + ".click();"; // btnChooseAFile.Attributes["onclick"] = scriptText2; fileUri = ImageDirectory; localDirectory = Server.MapPath(fileUri); if (Directory.Exists(localDirectory)) { var files = Directory.GetFiles(localDirectory, "*.*"); List <String> images = new List <string>(files.Count()); foreach (string item in files) { if (item.EndsWith(".png") || item.EndsWith(".jpg") || item.EndsWith(".gif")) { images.Add(String.Format(fileUri + "/{0}", System.IO.Path.GetFileName(item))); } } RepeaterImages.DataSource = images; RepeaterImages.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { string[] fileindirectory = Directory.GetFiles(Server.MapPath("~/image4")); List <string> images = new List <string>(fileindirectory.Count()); foreach (string item in fileindirectory) { images.Add(String.Format("../image4/{0}", System.IO.Path.GetFileName(item))); } RepeaterImages.DataSource = images; RepeaterImages.DataBind(); //string[] fileindirectory = Directory.GetFiles(Server.MapPath("~/image3")); // List<string> images = new List<string>(fileindirectory.Count()); // foreach (string item in fileindirectory) // { // images.Add(String.Format("../image3/{0}", System.IO.Path.GetFileName(item))); // } // RepeaterImages.DataSource = images; // RepeaterImages.DataBind(); }
public void loadimage(Guid AccessCode) { Photo photo = new Photo(); try { List <String> images = photo.LoadImageList(AccessCode, Enums.PhotoCategory.House_Life_Picture); if (images != null) { int imagescount = images.Count; if (imagescount <= 1) { RepeaterImages.DataSource = images; RepeaterImages.DataBind(); } else { int check = 0; int length = 5; if (imagescount < 5) { length = imagescount; } int[] NumberList = new int[length]; Random rand = new Random(); List <String> imageList = new List <string>(length); for (int i = 0; i < length;) { check = rand.Next(1, imagescount); if (!NumberList.Contains(check)) { imageList.Add(images[check].ToString()); NumberList[i] = check; i++; } } RepeaterImages.DataSource = imageList; RepeaterImages.DataBind(); } } //if (images != null) //{ // RepeaterImages.DataSource = images; // RepeaterImages.DataBind(); //} } catch (Exception ec) { } }
protected void GetImagesOfthePlace(object sender, EventArgs e) { ImageServices.Service1Client imageservicesobject = new ImageServices.Service1Client(); string[] imageslist = imageservicesobject.GetImages(placenametextbox.Text); RepeaterImages.DataSource = imageslist; RepeaterImages.DataBind(); return; }
public void FillImageSelectionPanel() { List <Img> imgList = new List <Img>(); foreach (string filePath in Directory.GetFiles(Server.MapPath("~" + FilePath))) { imgList.Add(new Img() { Name = FilePath + Path.GetFileName(filePath) }); RepeaterImages.DataSource = imgList; RepeaterImages.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { lblName.Text = Session["Username"].ToString(); string[] filesindirectory = Directory.GetFiles(Server.MapPath("~/Images/" + Session["Username"].ToString())); List <String> images = new List <string>(filesindirectory.Count()); foreach (string item in filesindirectory) { images.Add(String.Format("~/Images/" + Session["Username"].ToString() + "/{0}", System.IO.Path.GetFileName(item))); } RepeaterImages.DataSource = images; RepeaterImages.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { if (Request.QueryString["Id"] != null) { int id = int.Parse(Request.QueryString["Id"]); using (SelectedHotelsEntities db = new SelectedHotelsEntities()) { cloth = db.Products.Find(id) as Cloth; if (cloth != null) { if (cloth.Sizes.Any()) { RepeaterSizes.Visible = true; RepeaterSizes.DataSource = cloth.Sizes; RepeaterSizes.DataBind(); } if (cloth.Styles.Any()) { RepeaterStyles.Visible = true; RepeaterStyles.DataSource = cloth.Styles; RepeaterStyles.DataBind(); } if (cloth.ProductImages.Any()) { RepeaterImages.Visible = true; RepeaterImages.DataSource = cloth.ProductImages; RepeaterImages.DataBind(); } if (cloth.Departments.Any()) { RepeaterDepartments.Visible = true; RepeaterDepartments.DataSource = cloth.Departments; RepeaterDepartments.DataBind(); } } DataBind(); } } } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } } }
public void loadimage() { Photo photo = new Photo(); try { List <String> images = photo.LoadImageList(Guid.Parse(Membership.GetUser().ProviderUserKey.ToString()), Enums.PhotoCategory.House_Life_Picture); if (images != null) { RepeaterImages.DataSource = images; RepeaterImages.DataBind(); } } catch (Exception ec) { } }
public void loadimage(Guid AccessCode) { Photo photo = new Photo(); try { List <String> images = photo.LoadImageList(AccessCode, Enums.PhotoCategory.House_Life_Picture); if (images != null) { RepeaterImages.DataSource = images; RepeaterImages.DataBind(); } } catch (Exception ec) { } }
private void BindData() { SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = " SELECT * from menuItems INNER JOIN restaurantProfile ON restaurantProfile.restaurantID = menuItems.restaurantID WHERE menuItems.itemName='" + Request.QueryString["Name"] + "'"; cmd.CommandType = CommandType.Text; DataSet objDS = new DataSet(); SqlDataAdapter objDA = new SqlDataAdapter(); objDA.SelectCommand = cmd; con.Open(); objDA.Fill(objDS); con.Close(); RepeaterImages.DataSource = objDS; RepeaterImages.DataBind(); }
private void BindData() { SqlCommand cmd = new SqlCommand(); cmd.Connection = con; cmd.CommandText = " SELECT rp.* from restaurantProfile AS rp JOIN (SELECT restaurantID from menuItems GROUP BY restaurantID) AS mi" + " ON rp.restaurantID = mi.restaurantID WHERE restaurantName= '" + Request.QueryString["rName"] + "'"; // OR '" + Request.QueryString["cName"] + "' cmd.CommandType = CommandType.Text; DataSet objDS = new DataSet(); SqlDataAdapter objDA = new SqlDataAdapter(); objDA.SelectCommand = cmd; con.Open(); objDA.Fill(objDS); con.Close(); RepeaterImages.DataSource = objDS; RepeaterImages.DataBind(); }
private void ShowUploadedImages() { string filters = "*.jpg;*.png;*.gif;*.jpeg"; string Path = ConfigurationManager.AppSettings["FilePath"].ToString(); List <String> images = new List <string>(); foreach (string filter in filters.Split(';')) { FileInfo[] fit = new DirectoryInfo(this.Server.MapPath(Path)).GetFiles(filter); foreach (FileInfo fi in fit) { images.Add(String.Format(Path + "/{0}", fi)); } } RepeaterImages.DataSource = images; RepeaterImages.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { string id_usuario = Convert.ToString(Session["id_usuario"]); if (id_usuario == null || id_usuario == "") { Response.Redirect("default.aspx"); } else { switch (Convert.ToString(Session["rol"])) { case "SuperAdministrador": usuarios.Visible = true; break; case "Administrador": usuarios.Visible = true; break; case "Instructor": usuarios.Visible = false; break; default: Response.Redirect("default.aspx"); break; } List <string> images = new List <string>(); FileInfo[] fit = new DirectoryInfo(Server.MapPath("~/QR")).GetFiles("*.png"); foreach (FileInfo fi in fit) { images.Add(string.Format("{0}", fi)); } RepeaterImages.DataSource = images; RepeaterImages.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { string[] klasordekiler = Directory.GetFiles(Server.MapPath("~/Images")); List <String> resimler = new List <string>(klasordekiler.Count()); string[] resimuzantisi = { ".jpg", ".gif", ".png", ".jpeg" }; foreach (string resimdosyasi in klasordekiler) { for (int i = 0; i < resimuzantisi.Length; i++) { string[] parcalar; parcalar = resimdosyasi.Split('.'); if (resimuzantisi[i] == "." + parcalar[1]) { resimler.Add(String.Format("~/Images/{0}", Path.GetFileName(resimdosyasi))); } } } RepeaterImages.DataSource = resimler; RepeaterImages.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { AntiForgery.Validate(); } string filters = "*.jpg;*.png;*.gif;*.jpeg"; string Path = ConfigurationManager.AppSettings["FilePath"].ToString(); List <String> images = new List <string>(); foreach (string filter in filters.Split(';')) { FileInfo[] fit = new DirectoryInfo(this.Server.MapPath(Path)).GetFiles(filter); foreach (FileInfo fi in fit) { images.Add(String.Format(Path + "/{0}", fi)); } } RepeaterImages.DataSource = images; RepeaterImages.DataBind(); }