Ejemplo n.º 1
0
        public ActionResult QualityAnchorReject(string qpDocId)
        {
            QPMapper <Models.QPMasterPool, QPMasterPool> mapObj = new QPMapper <Models.QPMasterPool, QPMasterPool>();
            var dal = new QP_Repository();

            Models.QPMasterPool doc = new Models.QPMasterPool();
            doc.QPDocId     = qpDocId;
            doc.Status      = "A";
            doc.UpdationLog = DateTime.Now;
            bool status = dal.QPReject(mapObj.Translate(doc));

            if (status)
            {
                return(RedirectToAction("QualityAnchor"));
            }
            else
            {
                return(View("UnableToReviewerReject"));
            }
        }
Ejemplo n.º 2
0
        public ActionResult ReUploadDoc(Models.QPMasterPool qpObj, HttpPostedFileBase reUpload)
        {
            var allowedExtensions = new[] { ".docx" };
            var extension         = Path.GetExtension(reUpload.FileName);

            qpObj.UpdationLog  = DateTime.Now;
            qpObj.Status       = "R";
            qpObj.DocumentName = reUpload.FileName;
            var dal = new QP_Repository();
            QPMapper <Models.QPMasterPool, QPMasterPool> mapObj = new QPMapper <Models.QPMasterPool, QPMasterPool>();

            try
            {
                if (reUpload != null && allowedExtensions.Contains(extension))
                {
                    qpObj.Document = new byte[reUpload.ContentLength];
                    reUpload.InputStream.Read(qpObj.Document, 0, reUpload.ContentLength);
                    bool status = dal.UpdateDocumentMaster(mapObj.Translate(qpObj));
                    if (status)
                    {
                        log.Info("Document uploaded successfully");
                        return(RedirectToAction("Author"));
                    }
                    else
                    {
                        log.Error("Document failed to upload");
                        return(View("UnableToUpload"));
                    }
                }
                else
                {
                    log.Error("Document failed to upload because of invalid file");
                    return(View("InvalidFile"));
                }
            }
            catch (Exception)
            {
                log.Error("Document failed to upload");
                return(View("UnableToUpload"));
            }
        }
Ejemplo n.º 3
0
 public ActionResult CreateQP(FormCollection frm)
 {
     try
     {
         QPMapper <Models.QPMasterPool, QPMasterPool> mapObj = new QPMapper <Models.QPMasterPool, QPMasterPool>();
         int    trackId          = Convert.ToInt32(frm["Track"]);
         int    focusAreaId      = Convert.ToInt32(frm["FocusArea"]);
         int    moduleId         = Convert.ToInt32(frm["Module"]);
         byte[] newdoc           = null;
         var    dal              = new QP_Repository();
         Models.QPMasterPool obj = new Models.QPMasterPool();
         obj.Author        = frm["Author"];
         obj.Comments      = frm["Comments"];
         obj.CreationLog   = DateTime.Now;
         obj.Document      = newdoc;
         obj.DocumentName  = dal.GetDocName(trackId, focusAreaId, moduleId);
         obj.ModuleId      = moduleId;
         obj.QPDocId       = dal.GetDocId();
         obj.QualityAnchor = frm["QualityAnchor"];
         obj.Reviewer      = frm["Reviewer"];
         obj.Status        = "A";
         obj.UpdationLog   = null;
         bool status = dal.AddDocument(mapObj.Translate(obj));
         if (status)
         {
             return(RedirectToAction("QPAnchor"));
         }
         else
         {
             return(View("UnableToCreateQP"));
         }
     }
     catch (Exception)
     {
         return(View("UnableToCreateQP"));
     }
 }
Ejemplo n.º 4
0
 //Upload-Method
 public ActionResult ReUpload(Models.QPMasterPool qpDoc)
 {
     return(View(qpDoc));
 }