public static int InsertDocuments(FormCollection collection, int SourceID, int SourceType)
{
IDocumentsRepository documents = new DocumentsRepository();
Document d = new Document();
d.DateAdded = DateTime.Now;
d.DocName = collection["DocName"];
d.DocPath = collection["DocPath"];
d.RoleAccess = collection["DocAccess"];
d.DocLegend = collection["txtDocLegend"];
string docType = collection["docfiletype"];
if (docType.Equals("upload"))
d.DocumentType = UpdateUtils.DOC_UPLOADED;
else if (docType.Equals("hyperlink"))
{
d.DocumentType = UpdateUtils.DOC_HYPERLINK;
}
d.SourceID = SourceID;
d.SourceType = SourceType;
//d.UserID = collection["UserID"];
d.UserID = Membership.GetUser().ToString();
return documents.Save(d);
}