Ejemplo n.º 1
0
 public void InsertProductImage(product_imageinfo pinfo)
 {
     try
     {
         using (RMSDataContext db = new RMSDataContext())
         {
             product_image1 pim = new product_image1();
             Guid           pid = Guid.NewGuid();
             pim.Product_imageID = pid.ToString();
             pim.ProductID       = pinfo.ProductID;
             System.Data.Linq.Binary file_binary = new System.Data.Linq.Binary(pinfo.Images);
             pim.Images  = file_binary;
             pim.MainPic = pinfo.MainPic;
             db.product_image1s.InsertOnSubmit(pim);
             db.SubmitChanges();
         }
     }
     catch (Exception ex) { }
 }
Ejemplo n.º 2
0
        public void InsertProductImages(product_imageinfo piInf)
        {
            try
            {
                using (RMSDataContext db = new RMSDataContext())
                {
                    product_image1 pr   = new product_image1();
                    Guid           prid = new Guid();

                    pr.Product_imageID = prid.ToString();
                    System.Data.Linq.Binary file_binary = new System.Data.Linq.Binary(piInf.Images);
                    pr.Images = file_binary;
                    //System.Data.Linq.Binary file_binary_Main = new System.Data.Linq.Binary(piInf.MainPic);
                    //pr.MainPic = file_binary_Main;
                    pr.ProductID = piInf.ProductID;
                    db.product_image1s.InsertOnSubmit(pr);
                    db.SubmitChanges();
                }
            }
            catch (Exception ex) { }
        }