Exemplo n.º 1
0
        public ActionResult SearchPromoteList(int?SessionId, int?ClassId, int?SectionId, string StudentName)
        {
            objBDC = new PromoteToClassBusiness();
            ViewBag.AllocationDetail = objBDC.BindSessionClassEnquiry(SessionId, ClassId, SectionId, StudentName);

            return(PartialView("SearchPromoteList"));
        }
Exemplo n.º 2
0
        public ActionResult UpdateAllocationList(string[] Parameters, int SessionId, int ClassId, int SectionId, int LastClassId)
        {
            string ResultMessage = "";

            try
            {
                int TotalStudent = 0;
                objBDC = new PromoteToClassBusiness();
                PromoteToClassCustomModel objModel = new PromoteToClassCustomModel();
                //TotalStudent = objBDC.GetTotalStudentInSection(SessionId, ClassId, SectionId);

                //if (TotalStudent > 30)
                //{
                //    ResultMessage = "Only 70 students are allowed in one batch.";
                //}

                if (Parameters != null)
                {
                    int AfterStudentCount = TotalStudent + Parameters.Length;
                    if (AfterStudentCount > 30)
                    {
                        ResultMessage = "Only 30 students are allowed in one section. You have selected " + Parameters.Length + " students. There are already " + TotalStudent + " students in this section.";
                    }
                    else
                    {
                        foreach (string Id in Parameters)
                        {
                            objModel.SessionId   = SessionId;
                            objModel.ClassId     = ClassId;
                            objModel.SectionId   = SectionId;
                            objModel.LastClassId = LastClassId;
                            objModel.AdmissionId = Convert.ToInt32(Id);
                            objModel.IsActive    = true;
                            objModel.Status      = "Attending";

                            objBDC.SavePromoteToClassDetails(objModel);
                        }
                        ResultMessage = "Student Promoted to new class Successfully.";
                    }
                }
            }
            catch (Exception ex)
            {
            }

            return(View(ResultMessage));
        }