Exemple #1
0
        /// <summary>
        /// Render partial view for Initial Identification Page
        /// </summary>
        /// <param name="bookType">The type of booking School / Adult / University</param>
        /// <returns>Partial view with Model</returns>
        public PartialViewResult InitialIdentification(string bookType)
        {
            ViewBag.rootUrl = string.Format("{0}://{1}{2}", Request.Url.Scheme, Request.Url.Authority, Url.Content("~"));
            if (bookType.Equals(TOURCATEGORY.SCHOOL))
            {
                Session["idList"] = new List <int>();
                SchoolModel school = new SchoolModel();
                school.SubjectList = jsonDataController.GetJsonData_SubjectAreaList();
                school.YearList    = jsonDataController.GetJsonData_YearGroupList();
                school.type        = bookType;

                return(PartialView(CONSTVALUE.PARTIAL_VIEW_SCHOOL_FOLDER + "_SchoolVisit.cshtml", school));
            }
            else if (bookType.Equals(TOURCATEGORY.ADULT))
            {
                AdultModel adult = new AdultModel();
                adult.type        = bookType;
                adult.ProgramList = jsonDataController.GetJsonData_EventNameList(TOURCATEGORY.ADULT);
                return(PartialView(CONSTVALUE.PARTIAL_VIEW_ADULT_FOLDER + "_AdultVisit.cshtml", adult));
            }
            else if (bookType.Equals(TOURCATEGORY.UNIVERSITY))
            {
                UniversityModel uni = new UniversityModel();
                uni.type        = bookType;
                uni.ProgramList = jsonDataController.GetJsonData_EventNameList(TOURCATEGORY.UNIVERSITY);
                return(PartialView(CONSTVALUE.PARTIAL_VIEW_UNIVERSITY_FOLDER + "_UniVisit.cshtml", uni));
            }
            // Return page not found
            return(null);
        }
Exemple #2
0
        // update
        public bool UpdateUniversity(int id, UniversityModel university)
        {
            using (AttenderEntities ef = new AttenderEntities())
            {
                University updateUniversity = ef.Universities.FirstOrDefault(a => a.Id == id);
                if (updateUniversity == null)
                {
                    return(false);
                }

                //updateUniversity.Id = university.Id;
                updateUniversity.Name        = university.Name;
                updateUniversity.Country     = university.Country;
                updateUniversity.City        = university.City;
                updateUniversity.Address     = university.Address;
                updateUniversity.Zip         = university.Zip;
                updateUniversity.Site        = university.Site;
                updateUniversity.PhoneNumber = university.PhoneNumber;

                try{
                    //   ef.Database.ExecuteSqlCommand($"UPDATE [dbo].[University] SET [Name] = {updateUniversity.Name}, [Country] = {updateUniversity.Country},[City] = { updateUniversity.City}, [Address] = { updateUniversity.Address}, [Zip] = { updateUniversity.Zip}, [Site] = { updateUniversity.Site}, [PhoneNumber] = { updateUniversity.PhoneNumber}  WHERE [Id] = {id}");
                    ef.SaveChanges();
                }
                catch {
                    return(false);
                }
            }
            return(true);
        }
Exemple #3
0
        public ActionResult PostInvoice_University(UniversityModel uni)
        {
            if (ModelState.IsValid)
            {
                contentController.SetPostInvoice_University(uni);
                uni = contentController.GetModelById_University(uni.Id);

                //Create new contact with primary category as schools and contacttype as organisation
                uni.SerialNumber = jsonDataController.CreateNewOrganisationContactOnThankQ <UniversityModel>(uni);
                //Save Group Coordinator and Invoicee on ThankQ BD
                jsonDataController.CreateNewContactOnThankQ <UniversityModel>(uni);
                //Create new Tour Booking Record on ThankQ DB
                uni.TourBookingID = jsonDataController.CreateNewTourBookingOnThankQ <UniversityModel>(uni);
                //Create new Attendee Summary on ThankQ DB
                jsonDataController.CreateNewTourBookingAttendeeSummaryOnThankQ <UniversityModel>(uni);
                //Save booking record on Umbraco CMS
                contentController.SetPostAdditionalBooking_University(uni);
                NameValueCollection routeValues = new NameValueCollection();
                routeValues.Add("mainBookingId", uni.Id.ToString());
                routeValues.Add("type", TOURCATEGORY.UNIVERSITY);

                return(RedirectToUmbracoPage(CONSTVALUE.BOOK_COMPLETION_CONTENT_ID, routeValues));
            }
            return(CurrentUmbracoPage());
        }
 public void CreateNewContactOnThankQ <T>(BaseModel model)
 {
     if (typeof(T).Equals(new SchoolModel().GetType()))
     {
         SchoolModel school = (SchoolModel)model;
         if (school.Event.IsSameContact)
         {
             school.Event.GroupCoordinator.SerialNumber = PostJsonData_NewContact <SchoolModel>(school, CONTACTTYPE.INDIVIDUAL, INDIVISUALTYPE.GROUPCOORDINATOR).Trim('"');
             school.Event.Invoice.SerialNumber          = school.Event.GroupCoordinator.SerialNumber;
         }
         else
         {
             school.Event.GroupCoordinator.SerialNumber = PostJsonData_NewContact <SchoolModel>(school, CONTACTTYPE.INDIVIDUAL, INDIVISUALTYPE.GROUPCOORDINATOR).Trim('"');
             school.Event.Invoice.SerialNumber          = PostJsonData_NewContact <SchoolModel>(school, CONTACTTYPE.INDIVIDUAL, INDIVISUALTYPE.INVOICEE).Trim('"');
         }
     }
     else if (typeof(T).Equals(new AdultModel().GetType()))
     {
         AdultModel adult = (AdultModel)model;
         adult.Event.GroupCoordinator.SerialNumber = PostJsonData_NewContact <AdultModel>(adult, CONTACTTYPE.INDIVIDUAL, INDIVISUALTYPE.GROUPCOORDINATOR).Trim('"');
         if (adult.Event.IsInvoiceOnly)
         {
             adult.Event.Invoice.SerialNumber = PostJsonData_NewContact <AdultModel>(adult, CONTACTTYPE.INDIVIDUAL, INDIVISUALTYPE.INVOICEE).Trim('"');
         }
     }
     else if (typeof(T).Equals(new UniversityModel().GetType()))
     {
         UniversityModel uni = (UniversityModel)model;
         uni.Event.GroupCoordinator.SerialNumber = PostJsonData_NewContact <UniversityModel>(uni, CONTACTTYPE.INDIVIDUAL, INDIVISUALTYPE.GROUPCOORDINATOR).Trim('"');
         uni.Event.Invoice.SerialNumber          = PostJsonData_NewContact <UniversityModel>(uni, CONTACTTYPE.INDIVIDUAL, INDIVISUALTYPE.INVOICEE).Trim('"');
     }
 }
Exemple #5
0
 // Create;
 public bool AddUniversity(UniversityModel newUniversity)
 {
     using (AttenderEntities ef = new AttenderEntities())
     {
         University university = new University()
         {
             // Id = newUniversity.Id,
             Name        = newUniversity.Name,
             Country     = newUniversity.Country,
             City        = newUniversity.City,
             Address     = newUniversity.Address,
             Zip         = newUniversity.Zip,
             Site        = newUniversity.Site,
             PhoneNumber = newUniversity.PhoneNumber
         };
         ef.Universities.Add(university);
         try{
             //ef.Database.ExecuteSqlCommand($"INSERT INTO [dbo].[University] ([Name],[Country],[City],[Address],[Zip],[Site],[PhoneNumber]) VALUES ({university.Name} , {university.Country} , {university.City}, {university.Address} , {university.Zip}, {university.Site} , {university.PhoneNumber})");
             ef.SaveChanges();
         }
         catch {
             return(false);
         }
     }
     return(true);
 }
Exemple #6
0
        // GET: University
        public ActionResult Index()
        {
            if (Session["PERSONAL_NO"] != null)
            {
                UniversityModel        model    = new UniversityModel();
                UniversityDS           source   = new UniversityDS();
                DataSet                ds       = new DataSet();
                List <UniversityModel> dataList = new List <UniversityModel>();

                ds = source.GetListOfUniversities();

                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    UniversityModel u = new UniversityModel
                    {
                        UniversityCode = dr["UNIVERSITY_ID"].ToString(),
                        UniversityName = dr["UNIVERSITY_NAME"].ToString(),
                        UniversityArea = dr["CITY"].ToString()
                    };
                    dataList.Add(u);
                }



                model.ListUniversity = dataList;
                return(View(model));
            }
            else
            {
                return(RedirectToAction("Index", "Login", new { area = "" }));
            }
        }
 private void MapInvoiceeContact_University(API_CONTACT contact, UniversityModel model)
 {
     contact.PRIMARYCATEGORY = CONTACTTYPE.INDIVIDUAL;
     contact.FIRSTNAME       = model.Event.Invoice.FirstName;
     contact.KEYNAME         = model.Event.Invoice.SureName;
     contact.TITLE           = model.Event.Invoice.Title;
     contact.EMAILADDRESS    = model.Event.Invoice.Email;
 }
Exemple #8
0
 /// <summary>
 /// Get the selected university program name id based on selected name name
 /// </summary>
 /// <param name="uni"></param>
 /// <returns>program id</returns>
 public int GetUniProgramDropdownList_SelectedID(UniversityModel uni)
 {
     return(ApplicationContext.Services.DataTypeService
            .GetPreValuesCollectionByDataTypeId(UNI_PROGRAM_DROPDOWNLIST_KEY)
            .PreValuesAsDictionary
            .Where(m => m.Value.Value.Equals(uni.Program))
            .Select(m => m.Value.Id)
            .First());
 }
Exemple #9
0
        public ActionResult PostConfirm_University(UniversityModel uni)
        {
            uni = contentController.GetModelById_University(uni.Id);

            NameValueCollection routeValues = new NameValueCollection();

            routeValues.Add("id", uni.Id.ToString());

            return(RedirectToUmbracoPage(contentController.GetContentIDByName("UniversityDetail"), routeValues));
        }
        public IHttpActionResult Get([FromUri] int id)
        {
            UniversityModel university = universityBll.GetUniversityById(id);

            if (university != null)
            {
                return(Ok(university));
            }
            return(NotFound());
        }
        public IActionResult GuardarUniverity(UniversityModel model)
        {
            if (string.IsNullOrWhiteSpace(model.Address.Address1) || string.IsNullOrWhiteSpace(model.Communication.CommunicationEmail))
            {
                EnviarMensaje.Enviar(TempData, "red", "Dirección 1  y el Email son requeridos");

                ViewBag.Status      = new SelectList(_status.Status, "StatusId", "StatusName");
                ViewBag.AddressType = new SelectList(_addressType.addressTypes, "AddressTypeId", "AddressTypeName");
                ViewBag.Country     = new SelectList(_country.GetAll, "CountryId", "CountryName");
                ViewBag.Province    = new SelectList(_province.Provinces, "ProvinceId", "ProvinceName");
                ViewBag.City        = new SelectList(_city.Cities, "CityId", "CityName");

                return(View("Crear"));
            }


            if (ModelState.IsValid)
            {
                var university = CopyPropierties.Convert <UniversityModel, University>(model);

                try
                {
                    _university.Save(university);
                }
                catch (Exception e)
                {
                    return(View("Index", _university.Universities));
                }
            }
            else
            {
                var errors = ModelState.Select(x => x.Value.Errors).FirstOrDefault(x => x.Count > 0).First();

                EnviarMensaje.Enviar(TempData, "red", errors.ErrorMessage);


                if (model.UniversityId != null)
                {
                    return(RedirectToAction("Editar", new { id = model.UniversityId }));
                }

                ViewBag.Status      = new SelectList(_status.Status, "StatusId", "StatusName");
                ViewBag.AddressType = new SelectList(_addressType.addressTypes, "AddressTypeId", "AddressTypeName");
                ViewBag.Country     = new SelectList(_country.GetAll, "CountryId", "CountryName");
                ViewBag.Province    = new SelectList(_province.Provinces, "ProvinceId", "ProvinceName");
                ViewBag.City        = new SelectList(_city.Cities, "CityId", "CityName");

                return(View("Crear"));
            }



            return(View("Index", _university.Universities));
        }
Exemple #12
0
        internal void SetPostAdditionalBooking_University(UniversityModel uni)
        {
            var uniRecord = Services.ContentService.GetById(uni.Id);

            uniRecord.SetValue("tourBookingID", uni.TourBookingID);
            uniRecord.SetValue("groupCoordinatorSerialNumber", uni.Event.GroupCoordinator.SerialNumber);
            uniRecord.SetValue("invoiceeSerialNumber", uni.Event.Invoice.SerialNumber);
            uniRecord.SetValue("paymentFingerprint", uni.Payment.EPS_FINGERPRINT);
            uniRecord.SetValue("uniSerialNumber", uni.SerialNumber);
            Services.ContentService.Save(uniRecord);
        }
Exemple #13
0
 public ActionResult PostInitialPage_University(UniversityModel uni)
 {
     if (ModelState.IsValid)
     {
         contentController.SetPostInitialPage_University(uni, CurrentPage);
         NameValueCollection routeValues = new NameValueCollection();
         routeValues.Add("id", uni.Id.ToString());
         return(RedirectToUmbracoPage(contentController.GetContentIDByName("University Calendar Form"), routeValues));
     }
     return(CurrentUmbracoPage());
 }
        public ActionResult PostCalendarForm_University(UniversityModel uni)
        {
            SetAttendeeDetail_School_Uni(uni);
            uni.Event.AdditionalInfo.StaffTotalCost = GetTotalPrice(uni.StaffNumber, uni.GetStaffAttendeeCost()).ToString("c2");
            uni.Event.AdditionalInfo.TotalCost      = GetTotalPrice(uni.StudentNumber, uni.GetStudentAttendeeCost()).ToString("c2");
            contentController.SetPostCalendarForm_University(uni);
            NameValueCollection routeValues = new NameValueCollection();

            routeValues.Add("id", uni.Id.ToString());
            return(RedirectToUmbracoPage(contentController.GetContentIDByName("UniversityConfirm"), routeValues));
        }
Exemple #15
0
        public IHttpActionResult GetByCode(string universityId)
        {
            UniversityModel university = uData.GetByCode(universityId);

            if (university == null)
            {
                return(NotFound());
            }

            return(Ok(university));
        }
Exemple #16
0
 public ActionResult Delete(int id, UniversityModel _delUniversityModel)
 {
     if (ModelState.IsValid)
     {
         _delUniversityModel = _dbContext.tbl_university.Find(id);
         _dbContext.tbl_university.Remove(_delUniversityModel);
         _dbContext.SaveChanges();
         return(RedirectToAction("/University"));
     }
     ModelState.AddModelError("", "Cannot delete university info, please try again");
     return(View(_delUniversityModel));
 }
Exemple #17
0
        public IHttpActionResult GetUniversity(int id)
        {
            University university = db.University.Find(id);

            if (university == null)
            {
                return(NotFound());
            }
            UniversityModel universityModel = _modelFactory.Create(university);

            return(Ok(universityModel));
        }
 public IHttpActionResult Put([FromUri] int id, [FromBody] UniversityModel value)
 {
     if (ModelState.IsValid)
     {
         bool succsess = universityBll.UpdateUniversity(id, value);
         if (succsess)
         {
             return(Ok());
         }
     }
     return(BadRequest());
 }
Exemple #19
0
 private ModelLocator()
 {
     SessionModel    = new SessionModel();
     CourseModel     = new CourseModel();
     ExamModel       = new ExamModel();
     FacultyModel    = new FacultyModel();
     PostModel       = new PostModel();
     ProgrammeModel  = new ProgrammeModel();
     UniversityModel = new UniversityModel();
     UserModel       = new UserModel();
     SemesterModel   = new SemesterModel();
     LogModel        = new LogModel();
 }
Exemple #20
0
        internal void SetPostInvoice_University(UniversityModel uni)
        {
            var adultRecord = Services.ContentService.GetById(uni.Id);

            adultRecord.SetValue("invoiceTitle", uni.Event.Invoice.Title);
            adultRecord.SetValue("invoiceFirstName", uni.Event.Invoice.FirstName);
            adultRecord.SetValue("invoiceSurename", uni.Event.Invoice.SureName);
            adultRecord.SetValue("invoiceEmail", uni.Event.Invoice.Email);
            adultRecord.SetValue("invoiceJobTitle", uni.Event.Invoice.JobTitle);
            adultRecord.SetValue("invoiceInstitution", uni.Event.Invoice.Institution);
            adultRecord.SetValue("invoicePhone", uni.Event.Invoice.Phone);
            Services.ContentService.Save(adultRecord);
        }
Exemple #21
0
        public IHttpActionResult PostUniversity([FromBody] University university)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.University.Add(university);
            db.SaveChanges();
            UniversityModel universityModel = _modelFactory.Create(university);

            return(CreatedAtRoute("GetUniversity", new { id = university.ID }, universityModel));
        }
        public string CreateNewTourBookingOnThankQ <T>(BaseModel model)
        {
            API_TOURBOOKING tourBooking = new API_TOURBOOKING();

            tourBooking.REFERENCE            = "";
            tourBooking.TOURID               = model.Event.id;
            tourBooking.STARTDATE            = Convert.ToDateTime(model.Event.start).ToShortDateString();
            tourBooking.STARTTIME            = Convert.ToDateTime(model.Event.start).ToString("HH:mm:ffff");
            tourBooking.ENDDATE              = Convert.ToDateTime(model.Event.end).ToShortDateString();
            tourBooking.ENDTIME              = Convert.ToDateTime(model.Event.end).ToString("HH:mm:ffff");
            tourBooking.STATUS               = TOURBOOKINGSTATUS.BOOKED;
            tourBooking.BOOKERSERIALNUMBER   = model.Event.GroupCoordinator.SerialNumber;
            tourBooking.INVOICEESERIALNUMBER = model.Event.Invoice.SerialNumber;
            tourBooking.BOOKINGCOMMENT       = model.Comments;

            if (typeof(T).Equals(new SchoolModel().GetType()))
            {
                SchoolModel school    = (SchoolModel)model;
                float       totalCost = GetTotalPrice(school.StudentsNumber, school.GetStudentAttendeeCost())
                                        + GetTotalPrice(school.StaffNumber, school.GetStaffAttendeeCost());

                tourBooking.FORSERIALNUMBER = school.SerialNumber;
                tourBooking.TOTALCOST       = totalCost;
                tourBooking.YEARGROUP       = school.Year;
                tourBooking.SUBJECT         = school.SubjectArea;
                return(PostJsonData_NewTourBooking(school.Event.id, tourBooking).Trim('"'));
            }
            else if (typeof(T).Equals(new AdultModel().GetType()))
            {
                AdultModel adult     = (AdultModel)model;
                float      totalCost = GetTotalPrice(adult.AdultNumber, adult.GetAdultAttendeeCost());

                tourBooking.FORSERIALNUMBER = adult.Event.GroupCoordinator.SerialNumber; //Need Clarifiction
                tourBooking.TOTALCOST       = totalCost;
                tourBooking.YEARGROUP       = TOURCATEGORY.ADULT;
                return(PostJsonData_NewTourBooking(adult.Event.id, tourBooking).Trim('"'));
            }
            else if (typeof(T).Equals(new UniversityModel().GetType()))
            {
                UniversityModel uni       = (UniversityModel)model;
                float           totalCost = GetTotalPrice(uni.StudentNumber, uni.GetStudentAttendeeCost())
                                            + GetTotalPrice(uni.StaffNumber, uni.GetStaffAttendeeCost());

                tourBooking.FORSERIALNUMBER = uni.SerialNumber;
                tourBooking.TOTALCOST       = totalCost;
                tourBooking.YEARGROUP       = TOURCATEGORY.UNIVERSITY;
                return(PostJsonData_NewTourBooking(uni.Event.id, tourBooking).Trim('"'));
            }
            return(null);
        }
 private void MapCoordinatorContact_University(API_CONTACT contact, UniversityModel model)
 {
     contact.PRIMARYCATEGORY = CONTACTTYPE.INDIVIDUAL;
     contact.FIRSTNAME       = model.Event.GroupCoordinator.FirstName;
     contact.KEYNAME         = model.Event.GroupCoordinator.SureName;
     contact.TITLE           = model.Event.GroupCoordinator.Title;
     contact.EMAILADDRESS    = model.Event.GroupCoordinator.Email;
     contact.MOBILENUMBER    = model.Event.GroupCoordinator.Mobile;
     contact.DAYTELEPHONE    = model.Event.GroupCoordinator.DaytimeNumber;
     contact.ADDRESSLINE1    = model.Event.GroupCoordinator.Address;
     contact.SUBURB          = model.Event.GroupCoordinator.Suburb;
     contact.STATE           = model.Event.GroupCoordinator.State;
     contact.POSTCODE        = model.Event.GroupCoordinator.Postcode;
 }
        public PartialViewResult BookCompletion(string type, string mainBookingId)
        {
            ViewBag.rootUrl = string.Format("{0}://{1}{2}", Request.Url.Scheme, Request.Url.Authority, Url.Content("~"));
            int result;

            if (!Int32.TryParse(mainBookingId, out result))
            {
                return(contentController.GetPartialView_PageNotFound());
            }
            if (type.Equals(TOURCATEGORY.SCHOOL))
            {
                SchoolModel school = contentController.GetModelById_School(Convert.ToInt32(mainBookingId));
                if (school == null)
                {
                    return(contentController.GetPartialView_PageNotFound());
                }
                List <SchoolModel> schoolList = new List <SchoolModel>();
                schoolList.Add(school);
                var childIdList = Services.ContentService.GetChildren(Convert.ToInt32(mainBookingId)).Select(x => x.Id).ToList();
                if (childIdList == null)
                {
                    return(contentController.GetPartialView_PageNotFound());
                }
                foreach (int id in childIdList)
                {
                    schoolList.Add(contentController.GetModelById_School(id));
                }
                return(PartialView(CONSTVALUE.PARTIAL_VIEW_SCHOOL_FOLDER + "_SchoolBookCompletion.cshtml", schoolList));
            }
            else if (type.Equals(TOURCATEGORY.ADULT))
            {
                AdultModel adult = contentController.GetModelById_Adult(Convert.ToInt32(mainBookingId));
                if (adult == null)
                {
                    return(contentController.GetPartialView_PageNotFound());
                }
                return(PartialView(CONSTVALUE.PARTIAL_VIEW_ADULT_FOLDER + "_AdultBookCompletion.cshtml", adult));
            }
            else if (type.Equals(TOURCATEGORY.UNIVERSITY))
            {
                UniversityModel uni = contentController.GetModelById_University(Convert.ToInt32(mainBookingId));
                if (uni == null)
                {
                    return(contentController.GetPartialView_PageNotFound());
                }
                return(PartialView(CONSTVALUE.PARTIAL_VIEW_UNIVERSITY_FOLDER + "_UniBookCompletion.cshtml", uni));
            }
            return(null);
        }
        public IActionResult GuardarUniverity(UniversityModel model)
        {
            var university = CopyPropierties.Convert <UniversityModel, University>(model);

            try
            {
                _university.Save(university);
            }
            catch (Exception e)
            {
                return(View("Index", _university.Universities));
            }

            return(View("Index", _university.Universities));
        }
Exemple #26
0
        public IHttpActionResult Delete(string universityId)
        {
            UniversityModel university = new UniversityModel()
            {
                Code = universityId
            };

            bool deleted = uData.Delete(university);

            if (!deleted)
            {
                return(BadRequest(Constants.MsgError));
            }

            return(Ok(Constants.MsgSuccess));
        }
Exemple #27
0
        public IHttpActionResult Create([FromBody] UniversityModel university)
        {
            if (university == null)
            {
                return(BadRequest(Constants.MsgErrorArguments));
            }

            bool inserted = uData.Insert(university);

            if (!inserted)
            {
                return(BadRequest(Constants.MsgError));
            }

            return(Ok(Constants.MsgSuccess));
        }
 public string CreateNewOrganisationContactOnThankQ <T>(BaseModel model)
 {
     if (typeof(T).Equals(new SchoolModel().GetType()))
     {
         SchoolModel school = (SchoolModel)model;
         school.SerialNumber = PostJsonData_NewContact <SchoolModel>(school, CONTACTTYPE.ORGANISATION).Trim('"');
         return(school.SerialNumber);
     }
     else if (typeof(T).Equals(new UniversityModel().GetType()))
     {
         UniversityModel uni = (UniversityModel)model;
         uni.SerialNumber = PostJsonData_NewContact <UniversityModel>(uni, CONTACTTYPE.ORGANISATION).Trim('"');
         return(uni.SerialNumber);
     }
     return("Please Define your Model");
 }
Exemple #29
0
        public ActionResult Create(UniversityModel _universityModel)
        {
            if (ModelState.IsValid)
            {
                _universityModel.AddedDate    = DateTime.Now;
                _universityModel.ModifiedDate = null;
                _universityModel.DeleteFlag   = false;
                _universityModel.DeletedDate  = DateTime.Now;

                _dbContext.tbl_university.Add(_universityModel);
                _dbContext.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(_universityModel));
        }
Exemple #30
0
        // GET: Admin/University/Delete/5
        public ActionResult Delete(int id)
        {
            if (id == 0)
            {
                return(RedirectToAction("University"));
            }

            UniversityModel _universityModel = _dbContext.tbl_university.Find(id);

            if (_universityModel == null)
            {
                return(RedirectToAction("University"));
            }

            return(View(_universityModel));
        }