예제 #1
0
        public virtual ActionResult SaveDoc(IEnumerable<HttpPostedFileBase> attachments)
        {
            foreach (var uploadfile in attachments)
            {
                var newdoc = new KBDoc();
                newdoc.CreatedBy = User.Identity.Name.Trim();
                newdoc.CreatedOn = DateTime.Now;
              //  string mimeType = uploadfile.ContentType;
                newdoc.KbDocName = Path.GetFileNameWithoutExtension(uploadfile.FileName);
                newdoc.FilePath = _fileStore.SaveUploadedFile(uploadfile);
             //   newdoc.FileType = mimeType;

                _entities.AddToKBDocs(newdoc);
                _entities.SaveChanges();
            }
            return Content(""); // return an empty string to signify success
        }
예제 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the KBDocs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToKBDocs(KBDoc kBDoc)
 {
     base.AddObject("KBDocs", kBDoc);
 }
예제 #3
0
 /// <summary>
 /// Create a new KBDoc object.
 /// </summary>
 /// <param name="kbId">Initial value of the KbId property.</param>
 public static KBDoc CreateKBDoc(global::System.Int32 kbId)
 {
     KBDoc kBDoc = new KBDoc();
     kBDoc.KbId = kbId;
     return kBDoc;
 }