Ejemplo n.º 1
0
        public string RecupProduitDix(List <string> aData)
        {
            DataSet DsJson = new DataSet();
            MyCo    NewCo  = new MyCo();

            try
            {
                NewCo.SelectProduitDix(ref DsJson, Convert.ToInt32(aData[0]));
            }
            catch
            {
                try
                {
                    NewCo.SelectIdProduit(ref DsJson, aData[0].ToString());
                    NewCo.SelectProduitDix(ref DsJson, Convert.ToInt32(DsJson.Tables[0].Rows[0].ItemArray[0]));
                }
                catch { DsJson = null; }
            }
            if (DsJson != null)
            {
                return(RenvoitHTMLProduit(DsJson.Tables[0]));
            }
            else
            {
                return("");
            }
        }
 public string RecupHoraires(List<string> aData)
 {
     DataSet DsJson = new DataSet();
     MyCo NewCo = new MyCo();
     NewCo.SelectHorairesAll(ref DsJson);
     return RenvoitHTMLHoraires(DsJson.Tables[0]);
 }
 public int ModifLikeProduit(List<string> aData)
 {
     DataSet DsJson = new DataSet();
     MyCo NewCo = new MyCo();
     NewCo.UpdateLikeProduit(aData.IndexOf(aData.Last()).ToString(),aData.Last(),ref DsJson);
     return aData.IndexOf(aData.Last());
 }
Ejemplo n.º 4
0
        public int ModifLikeProduit(List <string> aData)
        {
            DataSet DsJson = new DataSet();
            MyCo    NewCo  = new MyCo();

            NewCo.UpdateLikeProduit(aData.IndexOf(aData.Last()).ToString(), aData.Last(), ref DsJson);
            return(aData.IndexOf(aData.Last()));
        }
Ejemplo n.º 5
0
        public string RecupHoraires(List <string> aData)
        {
            DataSet DsJson = new DataSet();
            MyCo    NewCo  = new MyCo();

            NewCo.SelectHorairesAll(ref DsJson);
            return(RenvoitHTMLHoraires(DsJson.Tables[0]));
        }
Ejemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     NewCo = new MyCo();
     if (IsPostBack == false)
     {
         NewCo.Select("t_produit p", ref dsGalerie);
         TraitementBDD(dsGalerie, 0);
         dsGalerie.Reset();
         NewCo.Select("DISTINCT id_categorie,libelle_site_categorie", "t_produit", "t_categorie on id_categorie = fk_id_categorie", 0, ref dsGalerie);
         TraitementBDD(dsGalerie, 1);
         dsGalerie.Reset();
     }
 }
Ejemplo n.º 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     NewCo = new MyCo();
     if (IsPostBack == false)
     {
         NewCo.Select("t_produit p", ref dsGalerie);
         TraitementBDD(dsGalerie,0);
         dsGalerie.Reset();
         NewCo.Select("DISTINCT id_categorie,libelle_site_categorie","t_produit", "t_categorie on id_categorie = fk_id_categorie",0, ref dsGalerie);
         TraitementBDD(dsGalerie,1);
         dsGalerie.Reset();
     }
 }
 public string RecupProduitCatDix(List<string> aData)
 {
     DataSet DsJson = new DataSet();
     MyCo NewCo = new MyCo();
     try {
              NewCo.SelectProduitCategorieDix(ref DsJson,Convert.ToInt32(aData[0]), Convert.ToInt32(aData[1]));
         }
     catch {
         try
         {
             NewCo.SelectIdCategorie(ref DsJson, aData[1].ToString());
             NewCo.SelectProduitCategorieDix(ref DsJson, Convert.ToInt32(aData[0]), Convert.ToInt32(DsJson.Tables[0].Rows[0].ItemArray[0]));
         }
         catch { DsJson = null; }
     }
     if (DsJson != null)
     {
         return RenvoitHTMLProduit(DsJson.Tables[0]);
     }
     else
     {
         return "";
     }
 }
Ejemplo n.º 9
0
        public void ProcessRequest(HttpContext context)
        {
            NewCo = new MyCo();

            HttpRequest httpRequest = context.Request;
            //Dim IMG_sortie As Bitmap
            MemoryStream ms;

            //si dans la requête http il y a "LOGO_SITE"
            if (httpRequest["IMG"] != null)
            {
                bool   verif = true;
                string id    = "";
                string num   = "";
                foreach (char c in httpRequest["IMG"].ToString())
                {
                    if (c == '-')
                    {
                        verif = false;
                    }
                    if (verif)
                    {
                        id += c;
                    }
                    if (c != '-' && verif == false)
                    {
                        num += c;
                    }
                }
                if (verif)
                {
                    NewCo.Select("t_produit", "id_produit = " + Convert.ToInt32(httpRequest["IMG"]), ref dsGalerie);
                    try
                    {
                        byte[] data = (byte[])dsGalerie.Tables[0].Rows[0].ItemArray[3];
                        ms = new MemoryStream(data);
                        //on instencie un flux de mémoire que l'on paramètre avec le logo du site
                        //IMG = Bitmap.FromStream(ms)
                        //format image en .png
                        context.Response.ContentType = "image/JPG";
                        //IMG.Save(ms, System.Drawing.Imaging.ImageFormat.Png)
                        //on ajoute dans le flux de mémoire, le flux sortant
                        ms.WriteTo(context.Response.OutputStream);
                        //on ferme le flux de mémoire
                        ms.Dispose();
                    }
                    catch
                    {
                        IMG = Properties.Resources.SansImageProduit;
                        ms  = new MemoryStream(ImageToByteArray(IMG));
                        context.Response.ContentType = "image/JPG";
                        ms.WriteTo(context.Response.OutputStream);
                        ms.Dispose();
                    }
                }
                else
                {
                    try
                    {
                        NewCo.Select("t_images_produit", "fk_id_produit = " + Convert.ToInt32(id), ref dsGalerie);
                        if (dsGalerie != null)
                        {
                            foreach (DataRow dr in dsGalerie.Tables[0].Rows)
                            {
                                if (Convert.ToInt32(num) == Convert.ToInt32(dr.ItemArray[2]))
                                {
                                    byte[] data = (byte[])dr.ItemArray[1];
                                    ms = new MemoryStream(data);
                                    //on instencie un flux de mémoire que l'on paramètre avec le logo du site
                                    //IMG = Bitmap.FromStream(ms)
                                    //format image en .png
                                    context.Response.ContentType = "image/JPG";
                                    //IMG.Save(ms, System.Drawing.Imaging.ImageFormat.Png)
                                    //on ajoute dans le flux de mémoire, le flux sortant
                                    ms.WriteTo(context.Response.OutputStream);
                                    //on ferme le flux de mémoire
                                    ms.Dispose();
                                }
                            }
                        }
                        else
                        {
                            IMG = Properties.Resources.SansImageProduit;
                            ms  = new MemoryStream(ImageToByteArray(IMG));
                            context.Response.ContentType = "image/JPG";
                            ms.WriteTo(context.Response.OutputStream);
                            ms.Dispose();
                        }
                    }
                    catch
                    {
                        IMG = Properties.Resources.SansImageProduit;
                        ms  = new MemoryStream(ImageToByteArray(IMG));
                        context.Response.ContentType = "image/JPG";
                        ms.WriteTo(context.Response.OutputStream);
                        ms.Dispose();
                    }
                }
            }
        }