Example #1
0
        public ActionResult CreateAttribute(FormCollection coll)
        {
            dbDataContext db = new dbDataContext();

            Attributes attr = new Attributes();
            attr.attr_key = Request["attr_key"];

            HttpPostedFileBase file = Request.Files[0];
            MemoryStream ms = new MemoryStream();
            Image img = Image.FromStream(file.InputStream);
            img.Save(ms, img.RawFormat);
            Binary bin = new Binary(ms.ToArray());
            attr.picture = bin;

            db.Attributes.InsertOnSubmit(attr);
            db.SubmitChanges();

            return RedirectToAction("AttributesList");
        }
Example #2
0
 partial void DeleteAttributes(Attributes instance);
Example #3
0
 partial void UpdateAttributes(Attributes instance);
Example #4
0
 partial void InsertAttributes(Attributes instance);