Exemplo n.º 1
0
        // GET: OtherFee/Edit/{id}
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var  organisationId   = UserOrganisationId;
            var  centreId         = UserCentreId;
            bool isSuperAdmin     = User.IsInAnyRoles("SuperAdmin");
            var  expenseHeader    = NidanBusinessService.RetrieveExpenseHeaders(organisationId, e => isSuperAdmin || e.ExpenseHeaderId != 8).Items.ToList();
            var  project          = NidanBusinessService.RetrieveProjects(organisationId, e => e.CentreId == centreId).Items.ToList();
            var  expense          = NidanBusinessService.RetrieveExpense(organisationId, centreId, id.Value, e => e.CentreId == centreId);
            var  totalPettyCash   = NidanBusinessService.RetrieveCentrePettyCashs(organisationId, centreId, e => e.CentreId == centreId).Items.Sum(e => e.Amount);
            var  totalDebitAmount = NidanBusinessService.RetrieveExpenses(organisationId, centreId, e => e.CentreId == centreId).Items.Sum(e => e.DebitAmount);

            if (expense == null)
            {
                return(HttpNotFound());
            }
            var viewModel = new ExpenseViewModel
            {
                CentreId           = centreId,
                Expense            = expense,
                AvailablePettyCash = totalPettyCash - totalDebitAmount,
                CashMemo           = expense.CashMemoNumbers,
                ExpenseHeaders     = new SelectList(expenseHeader, "ExpenseHeaderId", "Name"),
                Projects           = new SelectList(project, "ProjectId", "Name"),
                SelectedProjectIds = expense?.ExpenseProjects.Select(e => e.ProjectId).ToList()
            };

            return(View(viewModel));
        }
Exemplo n.º 2
0
        public ActionResult SearchByDateCentreId(DateTime fromDate, DateTime toDate, int centreId, Paging paging, List <OrderBy> orderBy)
        {
            bool isSuperAdmin = User.IsInAnyRoles("SuperAdmin");
            var  data         = NidanBusinessService.RetrieveExpenses(UserOrganisationId, centreId, e => (isSuperAdmin || e.CentreId == centreId) && e.ExpenseGeneratedDate >= fromDate && e.ExpenseGeneratedDate <= toDate && e.CentreId == centreId, orderBy, paging);

            return(this.JsonNet(data));
        }
Exemplo n.º 3
0
        public ActionResult List(Paging paging, List <OrderBy> orderBy)
        {
            bool isSuperAdmin   = User.IsInAnyRoles("SuperAdmin");
            bool isUser         = User.IsInAnyRoles("User");
            bool isTraier       = User.IsInAnyRoles("Trainer");
            var  organisationId = UserOrganisationId;

            if (isSuperAdmin)
            {
                var data = NidanBusinessService.RetrieveAssessmentGrid(organisationId, e => true, orderBy, paging);
                return(this.JsonNet(data));
            }
            if (isUser)
            {
                var personnelId = UserPersonnelId;
                var data        = NidanBusinessService.RetrieveCandidateAssessmentGrid(organisationId, e => e.PersonnelId == personnelId, orderBy, paging);
                return(this.JsonNet(data));
            }
            if (isTraier)
            {
                var personnelId  = UserPersonnelId;
                var trainer      = NidanBusinessService.RetrieveTrainers(organisationId, e => e.PersonnelId == personnelId).FirstOrDefault();
                var batchTrainer = NidanBusinessService.RetrieveBatchTrainers(organisationId, e => e.TrainerId == trainer.TrainerId);
                var batchIds     = batchTrainer.Items.Select(e => e.BatchId);
                var data         = NidanBusinessService.RetrieveAssessmentGrid(organisationId, e => batchIds.Contains(e.BatchId), orderBy, paging);
                return(this.JsonNet(data));
            }
            return(this.JsonNet(""));
        }
        //  [HttpPost]
        public ActionResult Download(int?id)
        {
            bool isSuperAdmin = User.IsInAnyRoles("SuperAdmin");
            var  data         = NidanBusinessService.CreateRegistrationRecieptBytes(UserOrganisationId, UserCentreId, id.Value);

            return(File(data, ".pdf", "Registration Reciept.pdf"));
        }
        public ActionResult Search(string searchKeyword, Paging paging, List <OrderBy> orderBy)
        {
            bool isSuperAdmin = User.IsInAnyRoles("SuperAdmin");
            var  data         = NidanBusinessService.RetrieveStockDataGrid(UserOrganisationId, searchKeyword, p => (isSuperAdmin || p.CentreId == UserCentreId && p.StockPurchaseDate.Month == DateTime.UtcNow.Month || p.TotalBalanceQuantity != 0), orderBy, paging);

            return(this.JsonNet(data));
        }
Exemplo n.º 6
0
        // GET: trainer/Edit/{id}
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TempData["TrainerId"] = id;
            var trainer = NidanBusinessService.RetrieveTrainer(UserOrganisationId, id.Value);

            if (trainer == null)
            {
                return(HttpNotFound());
            }
            var viewModel = new TrainerViewModel
            {
                Trainer = trainer,
                //Courses = new SelectList(NidanBusinessService.RetrieveCourses(UserOrganisationId, e => true).ToList(), "CourseId", "Name"),
                Sectors   = new SelectList(NidanBusinessService.RetrieveSectors(UserOrganisationId, e => true).ToList(), "SectorId", "Name"),
                Talukas   = new SelectList(NidanBusinessService.RetrieveTalukas(UserOrganisationId, e => true).ToList(), "TalukaId", "Name"),
                Districts = new SelectList(NidanBusinessService.RetrieveDistricts(UserOrganisationId, e => true).ToList(), "DistrictId", "Name"),
                States    = new SelectList(NidanBusinessService.RetrieveStates(UserOrganisationId, e => true).ToList(), "StateId", "Name")
            };

            viewModel.TitleList = new SelectList(viewModel.TitleType, "Value", "Name");
            return(View(viewModel));
        }
Exemplo n.º 7
0
        // GET: Admission/View/{id}
        public ActionResult View(int?id)
        {
            bool isSuperAdmin = User.IsInAnyRoles("SuperAdmin");

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var organisationId = UserOrganisationId;
            var centreId       = UserCentreId;
            var admission      = !isSuperAdmin?NidanBusinessService.RetrieveAdmission(organisationId, centreId, id.Value) :
                                     NidanBusinessService.RetrieveAdmission(organisationId, id.Value, e => true);

            var admissionGrid           = _nidanBusinessService.RetrieveAdmissionGrid(organisationId, id.Value, e => true);
            var candidateFee            = _nidanBusinessService.RetrieveCandidateFees(organisationId, e => e.StudentCode == admissionGrid.StudentCode && (e.FeeTypeId == 1 || e.FeeTypeId == 6));
            var totalRegistrationAmount = candidateFee.Items.Sum(e => e.PaidAmount);

            if (admission == null)
            {
                return(HttpNotFound());
            }
            var viewModel = new AdmissionViewModel
            {
                Admission  = admission,
                PaidAmount = admissionGrid.PaidAmount.Value,
                TotalRegistrationAmount = totalRegistrationAmount.Value
            };

            return(View(viewModel));
        }
Exemplo n.º 8
0
        public ActionResult GetHoliday(int numberOfCourseHours, int dailyBatchHours, int numberOfWeekDays, DateTime startDate, int courseFee, int downPayment)
        {
            bool isSuperAdmin = User.IsInAnyRoles("SuperAdmin");
            var  data         = NidanBusinessService.GetBatchDetail(UserOrganisationId, UserCentreId, numberOfCourseHours, startDate, dailyBatchHours, numberOfWeekDays, courseFee, downPayment);

            return(this.JsonNet(data));
        }
Exemplo n.º 9
0
        // GET: Mobilization/Edit/{id}
        public ActionResult Edit(int?id)
        {
            var organisationId = UserOrganisationId;
            var centreId       = UserCentreId;

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var courses      = NidanBusinessService.RetrieveCentreCourses(organisationId, centreId, e => e.CentreId == centreId);
            var mobilization = NidanBusinessService.RetrieveMobilization(UserOrganisationId, id.Value);

            if (mobilization == null)
            {
                return(HttpNotFound());
            }
            var viewModel = new MobilizationViewModel
            {
                Mobilization      = mobilization,
                Courses           = new SelectList(courses, "CourseId", "Name"),
                MobilizationTypes = new SelectList(NidanBusinessService.RetrieveMobilizationTypes(UserOrganisationId, e => true).ToList(), "MobilizationTypeId", "Name"),
                Events            = new SelectList(NidanBusinessService.RetrieveEvents(UserOrganisationId, e => true).Items.ToList(), "EventId", "Name"),
                EventId           = mobilization.EventId,
                Qualifications    = new SelectList(NidanBusinessService.RetrieveQualifications(UserOrganisationId, e => true).ToList(), "QualificationId", "Name")
            };

            viewModel.TitleList = new SelectList(viewModel.TitleType, "Value", "Name");
            return(View(viewModel));
        }
Exemplo n.º 10
0
        public ActionResult Create(AdmissionViewModel admissionViewModel)
        {
            var organisationId   = UserOrganisationId;
            var centreId         = UserCentreId;
            var personnelId      = UserPersonnelId;
            var registrationData = NidanBusinessService.RetrieveRegistration(organisationId, admissionViewModel.Admission.RegistrationId);
            var enquiryId        = registrationData.EnquiryId;
            var enquiryData      = NidanBusinessService.RetrieveEnquiry(organisationId, enquiryId);

            if (ModelState.IsValid)
            {
                admissionViewModel.Admission = NidanBusinessService.CreateAdmission(organisationId, centreId, personnelId, admissionViewModel.Admission, admissionViewModel.CandidateFee);
                // Create Personnel
                var personnel = Personnel(organisationId, enquiryData);
                admissionViewModel.Admission.PersonnelId  = personnel.PersonnelId;
                admissionViewModel.Admission.Batch        = null;
                admissionViewModel.Admission.Registration = null;
                admissionViewModel.Admission.CreatedBy    = personnelId;
                NidanBusinessService.UpdateAdmission(organisationId, centreId, personnelId, admissionViewModel.Admission);
                CreateCandidateUserAndRole(personnel);
                return(RedirectToAction("Index"));
            }
            admissionViewModel.Courses            = new SelectList(NidanBusinessService.RetrieveCourses(organisationId, e => true).ToList(), "CourseId", "Name");
            admissionViewModel.PaymentModes       = new SelectList(NidanBusinessService.RetrievePaymentModes(organisationId, e => true).ToList(), "PaymentModeId", "Name");
            admissionViewModel.Schemes            = new SelectList(NidanBusinessService.RetrieveSchemes(organisationId, e => true).ToList(), "SchemeId", "Name");
            admissionViewModel.Sectors            = new SelectList(NidanBusinessService.RetrieveSectors(organisationId, e => true).ToList(), "SectorId", "Name");
            admissionViewModel.BatchTimePrefers   = new SelectList(NidanBusinessService.RetrieveBatchTimePrefers(organisationId, e => true).ToList(), "BatchTimePreferId", "Name");
            admissionViewModel.Batches            = new SelectList(NidanBusinessService.RetrieveBatches(organisationId, e => e.CourseId == registrationData.CourseId).ToList(), "BatchId", "Name");
            admissionViewModel.Rooms              = new SelectList(NidanBusinessService.RetrieveRooms(organisationId, e => e.CentreId == UserCentreId).ToList(), "RoomId", "Description");
            admissionViewModel.CourseInstallments = new SelectList(NidanBusinessService.RetrieveCourseInstallments(organisationId, e => true).ToList());
            return(View(admissionViewModel));
        }
Exemplo n.º 11
0
        public ActionResult SearchByDate(DateTime fromDate, DateTime toDate, Paging paging, List <OrderBy> orderBy)
        {
            bool isSuperAdmin = User.IsInAnyRoles("SuperAdmin");
            var  data         = NidanBusinessService.RetrieveMobilizationDataGrid(UserOrganisationId, e => (isSuperAdmin || e.CentreId == UserCentreId) && e.CreatedDate >= fromDate && e.CreatedDate <= toDate && e.Close == "No", orderBy, paging);

            return(this.JsonNet(data));
        }
Exemplo n.º 12
0
        public ActionResult Search(string searchKeyword, Paging paging, List <OrderBy> orderBy)
        {
            bool isSuperAdmin = User.IsInAnyRoles("SuperAdmin");
            var  data         = NidanBusinessService.RetrieveMobilizationDataGrid(UserOrganisationId, searchKeyword, p => (isSuperAdmin || p.CentreId == UserCentreId) && p.Close == "No", orderBy, paging);

            return(this.JsonNet(data));
        }
        public ActionResult MarkAttendance(List <StudentAttendance> attendances, int batchId, int subjectId, int sessionId)
        {
            //Please make sure we are getting all data if not set in js file.
            var result = NidanBusinessService.MarkAttendance(UserOrganisationId, UserCentreId, UserPersonnelId, attendances, batchId, subjectId, sessionId);

            return(this.JsonNet(result));
        }
        public ActionResult SearchByDate(DateTime fromDate, DateTime toDate, int batchId, Paging paging, List <OrderBy> orderBy)
        {
            bool isSuperAdmin = User.IsInAnyRoles("SuperAdmin");
            var  data         = NidanBusinessService.RetrieveBatchAttendanceDataGrid(UserOrganisationId, e => (isSuperAdmin || e.CentreId == UserCentreId) && e.AttendanceDate >= fromDate && e.AttendanceDate <= toDate && e.BatchId == batchId, orderBy, paging);

            return(this.JsonNet(data));
        }
Exemplo n.º 15
0
        public ActionResult SearchByDate(DateTime fromDate, DateTime toDate, Paging paging, List <OrderBy> orderBy)
        {
            bool isSuperAdmin = User.IsInAnyRoles("SuperAdmin");
            var  personnelId  = UserPersonnelId;

            return(this.JsonNet(NidanBusinessService.RetrieveActivityTaskDataGrids(UserOrganisationId, e => (isSuperAdmin || e.AssignTo == personnelId || e.CreatedBy == personnelId) && e.StartDate >= fromDate && e.StartDate <= toDate, orderBy, paging)));
        }
Exemplo n.º 16
0
        public ActionResult List(Paging paging, List <OrderBy> orderBy)
        {
            bool isSuperAdmin = User.IsSuperAdmin();
            var  centreId     = UserCentreId;

            return(this.JsonNet(NidanBusinessService.RetrieveBatches(UserOrganisationId, p => (isSuperAdmin || p.CentreId == centreId), orderBy, paging)));
        }
Exemplo n.º 17
0
        public ActionResult ActivityTaskByActivityId(int activityId, Paging paging, List <OrderBy> orderBy)
        {
            bool isSuperAdmin = User.IsInAnyRoles("SuperAdmin");
            var  personnelId  = UserPersonnelId;

            return(this.JsonNet(NidanBusinessService.RetrieveActivityTaskDataGrids(UserOrganisationId, e => (isSuperAdmin || e.AssignTo == personnelId || e.CreatedBy == personnelId) && e.ActivityId == activityId, orderBy, paging)));
        }
Exemplo n.º 18
0
        public ActionResult Create()
        {
            var organisationId     = UserOrganisationId;
            var centreId           = UserCentreId;
            var trainers           = NidanBusinessService.RetrieveTrainers(organisationId, e => true);
            var courseInstallments = NidanBusinessService.RetrieveCentreCourseInstallments(organisationId, centreId).Items.Select(e => e.CourseInstallment);
            var courses            = NidanBusinessService.RetrieveCourses(organisationId, e => true);
            var rooms     = NidanBusinessService.RetrieveRooms(organisationId, e => e.CentreId == centreId);
            var viewModel = new BatchViewModel()
            {
                Batch    = new Batch(),
                BatchDay = new BatchDay(),
                Course   = new Course()
                {
                    Name = "Test"
                },
                CourseInstallment = new CourseInstallment()
                {
                    Name = "Test"
                },
                Courses            = new SelectList(courses, "CourseId", "Name"),
                Trainers           = new SelectList(trainers, "TrainerId", "Name"),
                Rooms              = new SelectList(rooms, "RoomId", "Description"),
                CourseInstallments = new SelectList(courseInstallments, "CourseInstallmentId", "Name"),
                SelectedTrainerIds = new List <int> {
                }
            };

            viewModel.HoursList              = new SelectList(viewModel.HoursType, "Id", "Name");
            viewModel.MinutesList            = new SelectList(viewModel.MinutesType, "Id", "Name");
            viewModel.NumberOfHoursDailyList = new SelectList(viewModel.NumberOfHoursDailyType, "Id", "Name");
            return(View(viewModel));
        }
Exemplo n.º 19
0
        //AddTaskStatus
        //GET: ActivityTask
        public ActionResult AddTaskStatus(int?activityTaskId)
        {
            var organisationId = UserOrganisationId;
            var taskStates     = NidanBusinessService.RetrieveTaskStates(organisationId, e => true).Items.ToList();

            return(this.JsonNet(taskStates));
        }
Exemplo n.º 20
0
        // GET: Course/Edit/{id}
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var organisationId = UserOrganisationId;
            var schemes        = NidanBusinessService.RetrieveSchemes(organisationId, e => true);
            var sectors        = NidanBusinessService.RetrieveSectors(organisationId, e => true);
            var courseTypes    = NidanBusinessService.RetrieveCourseTypes(organisationId, e => true);
            var course         = NidanBusinessService.RetrieveCourse(organisationId, id.Value);

            if (course == null)
            {
                return(HttpNotFound());
            }

            TempData["CourseId"] = id;

            var viewModel = new CourseViewModel
            {
                Course      = course,
                Schemes     = new SelectList(schemes, "SchemeId", "Name"),
                Sectors     = new SelectList(sectors, "SectorId", "Name"),
                CourseTypes = new SelectList(courseTypes, "CourseTypeId", "Name")
            };

            return(View(viewModel));
        }
Exemplo n.º 21
0
        public ActionResult Search(string searchKeyword, Paging paging, List <OrderBy> orderBy)
        {
            bool isSuperAdmin = User.IsInAnyRoles("SuperAdmin");
            var  data         = NidanBusinessService.RetrieveCandidateRegistrationFee(UserOrganisationId, p => (isSuperAdmin || p.CentreId == UserCentreId) && p.IsAdmissionDone == false && p.SearchField.Trim().ToLower().Contains(searchKeyword.Trim().ToLower()), orderBy, paging);

            return(this.JsonNet(data));
        }
Exemplo n.º 22
0
        // GET: Centre/Edit/{id}
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var organisationId = UserOrganisationId;
            var talukas        = NidanBusinessService.RetrieveTalukas(organisationId, e => true);
            var districts      = NidanBusinessService.RetrieveDistricts(organisationId, e => true);
            var states         = NidanBusinessService.RetrieveStates(organisationId, e => true);
            var partners       = NidanBusinessService.RetrievePartners(organisationId, e => true).Items.ToList();
            var centre         = NidanBusinessService.RetrieveCentre(organisationId, id.Value);

            if (centre == null)
            {
                return(HttpNotFound());
            }
            var viewModel = new CentreViewModel
            {
                Talukas   = new SelectList(talukas, "TalukaId", "Name"),
                Districts = new SelectList(districts, "DistrictId", "Name"),
                States    = new SelectList(states, "StateId", "Name"),
                Partners  = new SelectList(partners, "PartnerId", "Name"),
                Centre    = centre
            };

            return(View(viewModel));
        }
Exemplo n.º 23
0
        public ActionResult GetCentres()
        {
            var organisationId = UserOrganisationId;
            var data           = NidanBusinessService.RetrieveCentres(organisationId);

            return(this.JsonNet(data));
        }
Exemplo n.º 24
0
        // GET: BatchPlanner/Edit/{id}
        public ActionResult Edit(int?id)
        {
            var organisationId = UserOrganisationId;

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var batchPlanner    = NidanBusinessService.RetrieveBatchPlanner(organisationId, id.Value, e => true);
            var batchPlannerDay = NidanBusinessService.RetrieveBatchPlannerDays(organisationId, e => e.BatchPlannerId == batchPlanner.BatchPlannerId).Items.FirstOrDefault();
            var trainers        = NidanBusinessService.RetrieveTrainers(organisationId, e => true);
            var courses         = NidanBusinessService.RetrieveCourses(organisationId, e => true);
            var rooms           = NidanBusinessService.RetrieveRooms(organisationId, e => true);
            var centres         = NidanBusinessService.RetrieveCentres(organisationId, e => true).ToList();

            if (batchPlanner == null)
            {
                return(HttpNotFound());
            }
            var viewModel = new BatchPlannerViewModel
            {
                BatchPlanner    = batchPlanner,
                BatchPlannerDay = batchPlannerDay,
                Courses         = new SelectList(courses, "CourseId", "Name"),
                Trainers        = new SelectList(trainers, "TrainerId", "Fullname"),
                Centres         = new SelectList(centres, "CentreId", "Name"),
                Rooms           = new SelectList(rooms, "RoomId", "Description")
            };

            viewModel.HoursList   = new SelectList(viewModel.HoursType, "Id", "Name");
            viewModel.MinutesList = new SelectList(viewModel.MinutesType, "Id", "Name");
            return(View(viewModel));
        }
Exemplo n.º 25
0
        public ActionResult CandidateAssessmentDetailByBatchIdAssessmentId(int batchId, Paging paging, List <OrderBy> orderBy)
        {
            var organisationId            = UserOrganisationId;
            var personnelId               = UserPersonnelId;
            var candidateAssessmentDetail = NidanBusinessService.RetrieveCandidateAssessmentGrid(organisationId, e => e.BatchId == batchId);

            return(this.JsonNet(candidateAssessmentDetail));
        }
Exemplo n.º 26
0
        public ActionResult SearchByDate(DateTime fromDate, DateTime toDate, Paging paging, List <OrderBy> orderBy)
        {
            bool isSuperAdmin = User.IsInAnyRoles("SuperAdmin");
            var  centreId     = UserCentreId;
            var  data         = NidanBusinessService.RetrieveCentrePettyCashs(UserOrganisationId, centreId, e => isSuperAdmin && e.CreatedDate >= fromDate && e.CreatedDate <= toDate, orderBy, paging);

            return(this.JsonNet(data));
        }
Exemplo n.º 27
0
        public ActionResult Room()
        {
            var centreId       = UserCentreId;
            var organisationId = UserOrganisationId;
            var data           = NidanBusinessService.RetrieveRooms(organisationId, e => e.CentreId == centreId);

            return(this.JsonNet(data));
        }
Exemplo n.º 28
0
        public ActionResult FixAssetMappingListByAssetClassId(int assetClassId, Paging paging, List <OrderBy> orderBy)
        {
            bool isAdmin  = User.IsInAnyRoles("Admin");
            var  centreId = UserCentreId;
            var  data     = NidanBusinessService.RetrieveFixAssetDataGrid(UserOrganisationId, p => (isAdmin && p.CentreId == centreId && p.AssetClassId == assetClassId), orderBy, paging);

            return(this.JsonNet(data));
        }
Exemplo n.º 29
0
        public ActionResult SearchByDate(DateTime fromDate, DateTime toDate, Paging paging, List <OrderBy> orderBy)
        {
            var  organisationId = UserOrganisationId;
            bool isSuperAdmin   = User.IsInAnyRoles("SuperAdmin");
            var  data           = NidanBusinessService.RetrieveFollowUpsData(organisationId, e => (isSuperAdmin || e.CentreId == UserCentreId) && e.FollowUpDateTime >= fromDate && e.FollowUpDateTime <= toDate, orderBy, paging);

            return(this.JsonNet(data));
        }
Exemplo n.º 30
0
        public ActionResult Count()
        {
            var organisationId = UserOrganisationId;
            var count          = NidanBusinessService.RetrieveFollowUps(organisationId,
                                                                        e => e.FollowUpDateTime.Date == DateTime.UtcNow.Date && e.ReadDateTime.Date != DateTime.UtcNow.Date);

            return(this.JsonNet(count));
        }