Beispiel #1
0
 public ActionResult Create(EnquiryViewModel enquiryViewModel)
 {
     if (ModelState.IsValid)
     {
         enquiryViewModel.Enquiry.OrganisationId = UserOrganisationId;
         enquiryViewModel.Enquiry.CentreId       = 1;
         enquiryViewModel.Enquiry = NidanBusinessService.CreateEnquiry(UserOrganisationId, enquiryViewModel.Enquiry);
         return(RedirectToAction("Index"));
     }
     return(View(enquiryViewModel));
 }
        public ActionResult Create(EnquiryViewModel enquiryViewModel)
        {
            var organisationId = UserOrganisationId;
            var centreId       = UserCentreId;
            var personnelId    = UserPersonnelId;

            enquiryViewModel.Enquiry.StudentCode = "ABC";
            if (ModelState.IsValid)
            {
                if (enquiryViewModel.CreateEnquiryFromMobilizationFollowUpId != 0)
                {
                    //Close Mobilization
                    var mobilization = NidanBusinessService.RetrieveMobilization(organisationId, enquiryViewModel.MobilizationId);
                    mobilization.Close         = "Yes";
                    mobilization.ClosingRemark = "Converted To Enquiry";
                    NidanBusinessService.UpdateMobilization(organisationId, mobilization);
                    var followup = NidanBusinessService.RetrieveFollowUp(organisationId, enquiryViewModel.CreateEnquiryFromMobilizationFollowUpId);
                    followup.Close  = "Yes";
                    followup.Remark = "Converted To Enquiry";
                    NidanBusinessService.UpdateFollowUp(organisationId, followup);
                    // NidanBusinessService.DeleteFollowUp(organisationId, enquiryViewModel.CreateEnquiryFromMobilizationFollowUpId);
                }
                enquiryViewModel.Enquiry.OrganisationId = organisationId;
                enquiryViewModel.Enquiry.CentreId       = centreId;
                enquiryViewModel.Enquiry.CreatedBy      = UserPersonnelId;
                enquiryViewModel.Enquiry.Close          = "No";
                enquiryViewModel.Enquiry.EnquiryStatus  = "Enquiry";
                enquiryViewModel.Enquiry.EmailId        = enquiryViewModel.Enquiry.EmailId.ToLower();
                enquiryViewModel.Enquiry = NidanBusinessService.CreateEnquiry(organisationId, UserPersonnelId, enquiryViewModel.Enquiry, enquiryViewModel.SelectedCourseIds);
                //return RedirectToAction("Index");
                return(RedirectToAction("Index"));
            }
            enquiryViewModel.EducationalQualifications = new SelectList(NidanBusinessService.RetrieveQualifications(organisationId, e => true).ToList());
            enquiryViewModel.Occupations     = new SelectList(NidanBusinessService.RetrieveOccupations(organisationId, e => true).ToList());
            enquiryViewModel.Religions       = new SelectList(NidanBusinessService.RetrieveReligions(organisationId, e => true).ToList());
            enquiryViewModel.CasteCategories = new SelectList(NidanBusinessService.RetrieveCasteCategories(organisationId, e => true).ToList());
            //enquiryViewModel.AreaOfInterests = new SelectList(NidanBusinessService.RetrieveAreaOfInterests(organisationId, e => true).ToList());
            enquiryViewModel.HowDidYouKnowAbouts = new SelectList(NidanBusinessService.RetrieveHowDidYouKnowAbouts(organisationId, e => true).ToList());
            enquiryViewModel.Courses             = new SelectList(NidanBusinessService.RetrieveCourses(organisationId, e => true).ToList());
            enquiryViewModel.Schemes             = new SelectList(NidanBusinessService.RetrieveSchemes(organisationId, e => true).ToList());
            enquiryViewModel.Sectors             = new SelectList(NidanBusinessService.RetrieveSectors(organisationId, e => true).ToList());
            enquiryViewModel.BatchTimePrefers    = new SelectList(NidanBusinessService.RetrieveBatchTimePrefers(organisationId, e => true).ToList());
            enquiryViewModel.StudentTypes        = new SelectList(NidanBusinessService.RetrieveStudentTypes(organisationId, e => true).ToList());
            enquiryViewModel.EnquiryTypes        = new SelectList(NidanBusinessService.RetrieveEnquiryTypes(organisationId, e => true).ToList());
            enquiryViewModel.Talukas             = new SelectList(NidanBusinessService.RetrieveTalukas(organisationId, e => true).ToList());
            enquiryViewModel.Districts           = new SelectList(NidanBusinessService.RetrieveDistricts(organisationId, e => true).ToList());
            enquiryViewModel.States      = new SelectList(NidanBusinessService.RetrieveStates(organisationId, e => true).ToList());
            enquiryViewModel.LeadSources = new SelectList(NidanBusinessService.RetrieveLeadSources(organisationId, e => true).ToList());
            enquiryViewModel.Cities      = new SelectList(NidanBusinessService.RetrieveCities(organisationId, e => true).ToList());
            return(View(enquiryViewModel));
        }