Пример #1
0
        //public PartialViewResult CandidateEntries(string SessionIdentifier, string AssessmentIdentifier, int AssessmentVersion, string ComponentIdentifier, int ComponentVersion)
        //{
        //    //AssessmentIdentifier = SubjectCode
        //    //ComponentIdentifier = Subject Name + Paper number
        //    using (var db = new RM_GDEContext())
        //    {
        //        var centers = db.Candidates.Where(c => c.SubjectCode == AssessmentIdentifier);

        //        foreach (var center in centers)
        //        {
        //            int i = 0;
        //            using (SessionCompositionWS.SessionCompositionWS sessionComposition = new SessionCompositionWS.SessionCompositionWS())
        //            {
        //                Packet[] packets = new Packet[centers.Where(c => c.MsNo == center.MsNo).Count()];

        //                Packet packet = new Packet
        //                {
        //                    PacketBarcode = center.MsNo
        //                };

        //                packets[i] = packet;

        //                i++;

        //                PacketArguments packetArguments = new PacketArguments
        //                {
        //                    BusinessStreamIdentifier = WebServiceDetails.BusinessStreamIndentifier,
        //                    SessionIdentifier = SessionIdentifier,
        //                    AssessmentIdentifier = AssessmentIdentifier,
        //                    AssessmentVersion = AssessmentVersion,
        //                    ComponentIdentifier = ComponentIdentifier,
        //                    ComponentVersion = ComponentVersion,
        //                    CentreIdentifier = center.CentreName,
        //                    Packets = packets
        //                };

        //                var sendPackets = sessionComposition.Packets(WebServiceDetails.RMKey, packetArguments);
        //            }

        //        }

        //    }


        //    return PartialView();
        //}


        public ActionResult StartFeeds()
        {
            using (var db = new RM_GDEContext())
            {
                var session = db.Session.ToList();
                var product = db.Product.ToList();

                var questionPaperList = db.Candidates.Select(c => new QuestionPaperList {
                    value = c.SubjectCode, text = c.SubjectCode
                }).Distinct().ToList();

                var convertedList = new QuestionPaperList()
                {
                    value = null,
                    text  = "--- Select Qestion paper ---"
                };
                questionPaperList.Insert(0, convertedList);

                var enumerable     = new[] { convertedList };
                var sessionProduct = new ProductModelView()
                {
                    session        = session,
                    product        = product,
                    QuestionsPaper = questionPaperList
                };

                return(View(sessionProduct));
            }
        }
Пример #2
0
        public PartialViewResult uploadProcess(string step)
        {
            //using (var giodb = new RM_GDEContext())
            //{
            //  var candidates = giodb.Candidates.ToList();

            //    foreach(var can in candidates)
            //    {
            //        can.PaperDesc
            //    }

            //}

            //return candidates;


            using (var db = new RM_GDEContext())
            {
                if (step == "session")
                {
                    var session = db.Session.ToList();

                    return(this.PartialView("PartialView/_" + step, session));
                }
                else if (step == "component")
                {
                    ////var component = db.
                }
            }


            return(this.PartialView("PartialView/_" + step));
        }
Пример #3
0
        public void ImportCandidates(HttpPostedFileBase FileUpload1)
        {
            RM_GDEContext rM_GDEContext = new RM_GDEContext();

            StreamReader csvReader = new StreamReader(FileUpload1.InputStream);

            string[] csvValues = null;
            int      firstLine = 0;

            while (!csvReader.EndOfStream)
            {
                csvValues = csvReader.ReadLine().Split('#').Where(x => !String.IsNullOrEmpty(x)).ToArray();
                //if (csvValues.Length < 2)
                //{
                //    return this.PartialView("Error");
                //}

                string[] insertToDatabase = csvValues;

                if (firstLine != 0)
                {
                    var candidates = new Candidates
                    {
                        Prov          = insertToDatabase[0],
                        ProvName      = insertToDatabase[1],
                        Region        = insertToDatabase[2],
                        RegName       = insertToDatabase[3],
                        District      = insertToDatabase[4],
                        DistrName     = insertToDatabase[5],
                        Circuit       = Convert.ToByte(insertToDatabase[6]),
                        CircName      = insertToDatabase[7],
                        Emis          = insertToDatabase[8],
                        CentreName    = insertToDatabase[9],
                        ExamType      = insertToDatabase[10],
                        ExamTypeName  = insertToDatabase[11],
                        Grade         = insertToDatabase[12],
                        ExamPeriod    = insertToDatabase[13],
                        SubjectCode   = insertToDatabase[14],
                        SubjectName   = insertToDatabase[15],
                        Paper         = insertToDatabase[16],
                        PaperDesc     = insertToDatabase[17],
                        PaperType     = insertToDatabase[18],
                        PaperMax      = insertToDatabase[19],
                        PaperDate     = DateTime.ParseExact(insertToDatabase[20], "yyyyMMdd", null),
                        PaperTime     = insertToDatabase[21],
                        PaperDuration = insertToDatabase[22],
                        MsNo          = insertToDatabase[23],
                        Idno          = insertToDatabase[24],
                        Candidate     = insertToDatabase[25],
                        Dob           = DateTime.ParseExact(insertToDatabase[26], "yyyyMMdd", null)
                    };

                    rM_GDEContext.Candidates.Add(candidates);
                    rM_GDEContext.SaveChanges();
                }

                firstLine++;
            }
        }
Пример #4
0
        // GET: RMWebService
        public ActionResult Marker()
        {
            RM_GDEContext context = new RM_GDEContext();

            var markerList = context.Markers.ToList();

            return(View(markerList));
        }
Пример #5
0
        public ActionResult Index()
        {
            using (var db = new RM_GDEContext())
            {
                var listOfSessions = db.QuestionPaper.ToList();

                return(View(listOfSessions));
            }
        }
Пример #6
0
        public ActionResult addMarker(string persalNumber, string surname, string email)
        {
            string RMKey      = WebServiceDetails.RMKey;
            var    markerType = "Marker";

            string[] surnameInitials = surname.Split(',');

            MarkerProvisioningWS.MarkerProvisioningWS marker = new MarkerProvisioningWS.MarkerProvisioningWS();

            MarkerArguments markerArguments = new MarkerArguments();

            markerArguments.MarkerIdentifier = persalNumber;
            markerArguments.MarkerType       = markerType;
            markerArguments.Surname          = surnameInitials[0];
            markerArguments.Initials         = surnameInitials[1];
            markerArguments.Email            = email;

            var markerSent = marker.Marker(RMKey, markerArguments);

            if (markerSent.Success)
            {
                //string SessionIdentifier = "June223";
                //string AssessmentIdentifier = "ENGFZ";
                //int AssessmentVersion = 1;
                //string ComponentIdentifier = "ENGFZ1";
                //int ComponentVersion = 1; 29285305

                MarkerAttribute[] attributes      = new MarkerAttribute[1];
                MarkerAttribute   markerAttribute = new MarkerAttribute {
                    Descriptor = "Browse Rights", Value = "BM"
                };

                attributes[0] = markerAttribute;

                Target[] target = new Target[1];

                target[0] = new Target {
                    TargetType = "Live", MaximumMarkingCount = 100, MarkingCompletionDate = DateTime.Now
                };
                //target[1] = new Target { TargetType = "Practice", MaximumMarkingCount = 15, MarkingCompletionDate = DateTime.Now };
                //target[2] = new Target { TargetType = "Standardisation", MaximumMarkingCount = 10, MarkingCompletionDate = DateTime.Now };


                Marker marker1 = new Marker
                {
                    MarkerIdentifier = persalNumber,
                    MarkerType       = "Marker",
                    RoleName         = "Assistant Principal Examiner",
                    Priority         = 1,
                    Attributes       = attributes
                };

                MarkerResponsibilitiesArguments markerResponsibilitiesArguments = new MarkerResponsibilitiesArguments
                {
                    BusinessStreamIdentifier = WebServiceDetails.BusinessStreamIndentifier,
                    SessionIdentifier        = "Comp1",
                    AssessmentIdentifier     = "Comp1",
                    AssessmentVersion        = 1,
                    ComponentIdentifier      = "Comp1",
                    ComponentVersion         = 1,
                    Marker       = marker1,
                    ParentMarker = new ParentMarker {
                        MarkerIdentifier = "29285305", MarkerType = "Chief Marker"
                    },
                    Targets = target
                };

                SessionCompositionWS.SessionCompositionWS sessionCompositionWS = new SessionCompositionWS.SessionCompositionWS();
                var MarkerResponsibilitie = sessionCompositionWS.MarkerResponsibilities(WebServiceDetails.RMKey, markerResponsibilitiesArguments);
            }
            RM_GDEContext context    = new RM_GDEContext();
            var           markerList = context.Markers.ToList();

            return(View("Marker", markerList));
        }
Пример #7
0
        public PartialViewResult _notification(string SessionIdentifier, string AssessmentIdentifier, int AssessmentVersion, string ComponentIdentifier, int ComponentVersion)
        {
            //AssessmentIdentifier = SubjectCode
            //ComponentIdentifier = Subject Code + Paper number
            var paperNumber = ComponentIdentifier.Last().ToString();

            using (var db = new RM_GDEContext())
            {
                var candidates = db.Candidates.ToList();
                var centers    = candidates.Where(c => c.SubjectCode == "LFSCZ" && c.Paper == "1").Select(c => new { c.CentreName, c.MsNo }).Distinct();
                //var centers = candidates.Select(c => new { c.CentreName, c.MsNo }).Distinct();

                foreach (var center in centers)
                {
                    using (SessionCompositionWS.SessionCompositionWS sessionComposition = new SessionCompositionWS.SessionCompositionWS())
                    {
                        var      numberOfMarkSheets = centers.Where(c => c.MsNo == center.MsNo).Distinct().Count();
                        Packet[] packets            = new Packet[numberOfMarkSheets];
                        for (var i = 0; i < numberOfMarkSheets; i++)
                        {
                            Packet packet = new Packet
                            {
                                PacketBarcode = center.MsNo
                            };
                            packets[i] = packet;
                        }


                        PacketArguments packetArguments = new PacketArguments
                        {
                            BusinessStreamIdentifier = WebServiceDetails.BusinessStreamIndentifier,
                            SessionIdentifier        = SessionIdentifier,
                            AssessmentIdentifier     = AssessmentIdentifier,
                            AssessmentVersion        = AssessmentVersion,
                            ComponentIdentifier      = ComponentIdentifier,
                            ComponentVersion         = ComponentVersion,
                            CentreIdentifier         = center.CentreName,
                            Packets = packets
                        };

                        var sendPackets = sessionComposition.Packets(WebServiceDetails.RMKey, packetArguments);


                        if (sendPackets.Success)
                        {
                            var candidateList = candidates.Where(c => c.CentreName == center.CentreName);

                            //CentreCandidateIdentifier = ExamNumber + Subject code + paper number

                            var numberOfCandidates            = candidateList.Count();
                            CandidateEntry[] CandidateEntries = new CandidateEntry[numberOfCandidates];
                            var j = 0;
                            foreach (var candidate in candidateList)
                            {
                                CandidateEntry candidateModel = new CandidateEntry
                                {
                                    UniqueCandidateIdentifier = candidate.Idno,
                                    CentreCandidateIdentifier = candidate.Idno,
                                    CandidateName             = candidate.Idno + candidate.SubjectCode + candidate.Paper,
                                    Gender = "N",
                                    DOB    = (DateTime)candidate.Dob
                                };
                                CandidateEntries[j] = candidateModel;
                                j++;
                            }
                            //for (var i = 0; i < numberOfCandidates; i++)
                            //{

                            //    CandidateEntry candidateModel = new CandidateEntry
                            //    {
                            //        UniqueCandidateIdentifier = candidateList.
                            //    };
                            //    CandidateEntries[i] = candidateModel;
                            //}

                            CandidateEntriesArguments candidateEntriesArguments = new CandidateEntriesArguments
                            {
                                BusinessStreamIdentifier = WebServiceDetails.BusinessStreamIndentifier,
                                SessionIdentifier        = SessionIdentifier,
                                AssessmentIdentifier     = AssessmentIdentifier,
                                AssessmentVersion        = AssessmentVersion,
                                ComponentIdentifier      = ComponentIdentifier,
                                ComponentVersion         = ComponentVersion,
                                CentreIdentifier         = center.CentreName,
                                CandidateEntries         = CandidateEntries
                            };

                            var sendCandidates = sessionComposition.CandidateEntries(WebServiceDetails.RMKey, candidateEntriesArguments);
                        }
                    }
                }
            }


            return(PartialView());
        }
Пример #8
0
        public async Task <ActionResult> addProduct(string QualificationShortName, string AssessmentIndentifier,
                                                    string AssessmentName, int AssessmentVersion, string ComponentIdentifier, string ComponentName, int ComponentVersion,
                                                    string SessionIdentifier, string Name, string Timeframe,
                                                    string StartDate, string StartDatePart, string EndDate,
                                                    string QuestionPaperIdentifier, string Barcode, string QuestionPaperPartName, string MarkingType, string NameQP, int PageCount, string SyllabusCode)
        {
            string markingTypeCreated = "MFI";
            string RMKey1             = WebServiceDetails.RMKey;

            AssessmentStructureWS.AssessmentStructureWS test = new AssessmentStructureWS.AssessmentStructureWS();

            ProductArguments productArguments = new ProductArguments();
            ProductReceipt   productReceipt   = new ProductReceipt();

            ProductArgumentsProduct       productArgumentsProduct       = new ProductArgumentsProduct();
            ProductArgumentsSession       productArgumentsSession       = new ProductArgumentsSession();
            ProductArgumentsExam          productArgumentsExam          = new ProductArgumentsExam();
            ProductArgumentsQuestionPaper productArgumentsQuestionPaper = new ProductArgumentsQuestionPaper();


            productArgumentsProduct.BusinessStreamIndentifier = WebServiceDetails.BusinessStreamIndentifier;
            productArgumentsProduct.QualificationShortName    = QualificationShortName;
            productArgumentsProduct.AssessmentIndentifier     = AssessmentIndentifier;
            productArgumentsProduct.AssessmentName            = AssessmentName;
            productArgumentsProduct.AssessmentVersion         = AssessmentVersion;
            productArgumentsProduct.ComponentIdentifier       = ComponentIdentifier;
            productArgumentsProduct.ComponentName             = ComponentName;
            productArgumentsProduct.ComponentVersion          = ComponentVersion;

            productArgumentsSession.SessionIdentifier = SessionIdentifier;
            productArgumentsSession.Name      = Name;
            productArgumentsSession.Timeframe = Timeframe;

            productArgumentsExam.StartDate     = Convert.ToDateTime(StartDate);
            productArgumentsExam.StartDatePart = StartDatePart;
            productArgumentsExam.EndDate       = Convert.ToDateTime(EndDate);


            productArgumentsQuestionPaper.QuestionPaperIdentifier = QuestionPaperIdentifier;
            productArgumentsQuestionPaper.Barcode = Barcode;
            productArgumentsQuestionPaper.QuestionPaperPartName = QuestionPaperPartName;
            productArgumentsQuestionPaper.MarkingType           = markingTypeCreated;
            productArgumentsQuestionPaper.Name         = NameQP;
            productArgumentsQuestionPaper.PageCount    = PageCount;
            productArgumentsQuestionPaper.SyllabusCode = SyllabusCode;

            productArguments.Product       = productArgumentsProduct;
            productArguments.Session       = productArgumentsSession;
            productArguments.Exam          = productArgumentsExam;
            productArguments.QuestionPaper = productArgumentsQuestionPaper;

            productReceipt = test.Product(RMKey1, productArguments);

            if (productReceipt.Success)
            {
                AddCenterCandidate(SessionIdentifier, AssessmentIndentifier, AssessmentVersion, ComponentIdentifier, ComponentVersion, QuestionPaperIdentifier, QuestionPaperPartName);

                using (var db = new RM_GDEContext())
                {
                    db.Product.Add(new Product
                    {
                        QualificationShortName = QualificationShortName,
                        AssessmentIndentifier  = AssessmentIndentifier,
                        AssessmentName         = AssessmentName,
                        AssessmentVersion      = AssessmentVersion,
                        ComponentIdentifier    = ComponentIdentifier,
                        ComponentName          = ComponentName,
                        ComponentVersion       = ComponentVersion
                    });

                    db.QuestionPaper.Add(new QuestionPaper
                    {
                        QuestionPaperIdentifier = QuestionPaperIdentifier,
                        Barcode = Barcode,
                        QuestionPaperPartName = QuestionPaperPartName,
                        MarkingType           = markingTypeCreated,
                        SyllabusCode          = SyllabusCode,
                        CreatedDate           = DateTime.Now

                                                //Add to Table later
                                                //Name = NameQP,
                                                //PageCount = PageCount,
                    });

                    db.Session.Add(new Session
                    {
                        SessionIdentifier = SessionIdentifier,
                        Name      = Name,
                        Timeframe = Timeframe
                    });

                    db.Exam.Add(new Exam
                    {
                        StartDate     = Convert.ToDateTime(StartDate),
                        StartDatePart = StartDatePart,
                        EndDate       = Convert.ToDateTime(EndDate)
                    });

                    await db.SaveChangesAsync();

                    var listOfSessions = db.QuestionPaper.ToList();
                    return(View("Index", listOfSessions));
                }
            }
            return(View("Index"));
        }