Ejemplo n.º 1
0
        public void UploadRoadMap(AdminDocument admndocs)
        {
            var    file     = admndocs.Document;
            string filename = "";
            string filepath = "";

            try
            {
                filename = System.IO.Path.GetFileName(System.IO.Path.GetRandomFileName() + file.FileName);
                file.SaveAs(Server.MapPath("/ProjectRoadMap/" + filename));

                filepath = "/ProjectRoadMap/" + filename;
                //file.SaveAs(Server.MapPath(filepath));
                string fullPath = Request.MapPath(admndocs.DocumentPath);
                if (System.IO.File.Exists(fullPath))
                {
                    System.IO.File.Delete(fullPath);
                }

                admndocs.DocumentPath = filepath;
            }
            catch (Exception ex)
            {
            }
        }
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (SupplierDocument?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (InvestorDocument?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (AdminDocument?.GetHashCode() ?? 0);
            return(hashCode);
        }
Ejemplo n.º 3
0
        public JsonResult UploadDocument(AdminDocument docs)
        {
            var file = docs.Document;

            if (file != null)
            {
                UploadProfilePicture(docs);
            }
            Document_By_Admin docsbyadmin = new Document_By_Admin();

            docsbyadmin.Document_Name = docs.Document_Name;
            docsbyadmin.DocumentPath  = docs.DocumentPath;
            docsbyadmin.Is_Active     = true;
            docsbyadmin.DateCreated   = DateTime.Now;

            db.Document_By_Admin.Add(docsbyadmin);
            db.SaveChanges();
            return(Json(new { success = true, msg = "Saved" }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 4
0
        public JsonResult UploadProjectRoadmap(AdminDocument docs)
        {
            var file = docs.Document;

            if (file != null)
            {
                UploadRoadMap(docs);
            }
            Project_roadMap docsbyadmin = new Project_roadMap();

            //docsbyadmin.Document_Path = docs.Document_Name;
            docsbyadmin.Title         = docs.Document_Name;
            docsbyadmin.Document_Path = docs.DocumentPath;
            docsbyadmin.is_Active     = true;
            docsbyadmin.DateCreated   = DateTime.Now;

            db.Project_roadMap.Add(docsbyadmin);
            db.SaveChanges();
            return(Json(new { success = true, msg = "Saved" }, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 5
0
        public JsonResult UploadDocument(AdminDocument docs)
        {
            var file       = docs.Document;
            int mystudntid = Convert.ToInt32(Session["StudentID"]);
            var grpid      = db.Student_Group.Where(p => p.Student_1_ID == mystudntid || p.Student_2_ID == mystudntid).FirstOrDefault();

            if (file != null)
            {
                UploadstdntDeliverables(docs);
            }
            tblFile docsbystdnt = new tblFile();

            docsbystdnt.Document_Name = docs.Document_Name;
            docsbystdnt.Document_Path = docs.DocumentPath;
            docsbystdnt.Is_Active     = true;
            docsbystdnt.Date_Created  = DateTime.Now;
            docsbystdnt.Group_ID      = grpid.Group_Id;
            db.tblFiles.Add(docsbystdnt);
            db.SaveChanges();
            return(Json(new { success = true, msg = "Saved" }, JsonRequestBehavior.AllowGet));
        }