public ActionResult AddEditEnquiry(EnquiryListViewModel model)
        {
            FillAllDropdowns();

            string strSuccessMsg = string.Empty;
            string strErrorMsg = string.Empty;

            if (model != null && model.Enquiry != null)
            {
                if (string.IsNullOrEmpty(model.Enquiry.EnquiryID))
                {
                    strSuccessMsg = EnquiryRes.MsgAddSuccess;
                    strErrorMsg = EnquiryRes.MsgAddError;
                }
                else
                {
                    strSuccessMsg = EnquiryRes.MsgEditSuccess;
                    strErrorMsg = EnquiryRes.MsgEditError;
                }

                int i = _EnquiryService.AddEdit(model.Enquiry);

                if (i <= 0)
                {
                    TempData["err"] = strErrorMsg;
                }
                else
                {
                    TempData["msg"] = strSuccessMsg;
                }
            }

            return RedirectToAction("ManageEnquiry", "Enquiry");
        }
        public ActionResult AddEditEnquiry(string pEnquiryID)
        {
            FillAllDropdowns();

            User objUser = null;
            if (eSchoolSession.IsInSession(SessionKeys.CurrentUser))
                objUser = (User)eSchoolSession.GetDirectValue(SessionKeys.CurrentUser);

            EnquiryListViewModel model = new EnquiryListViewModel();
            model.Enquiry = new Enquiry();

            if (ModelState.IsValid)
            {
                if (!string.IsNullOrEmpty(pEnquiryID))
                {
                    model.Enquiry.EnquiryID = pEnquiryID;
                    model.Enquiry = _EnquiryService.Get(model.Enquiry);
                }
            }

            return View(model);
        }
        public ActionResult ManageEnquiry(EnquiryListViewModel model)
        {
            User objUser = null;
            if (eSchoolSession.IsInSession(SessionKeys.CurrentUser))
                objUser = (User)eSchoolSession.GetDirectValue(SessionKeys.CurrentUser);

            if (model.Enquiry == null)
            {
                model.Enquiry = new Enquiry();
            }

            if (!string.IsNullOrEmpty(model.Enquiry.sort))
            {
                model.Enquiry.SortExp = model.Enquiry.sort + " " + model.Enquiry.sortdir;
            }

            if (model.Enquiry.PageSize == 0)
            {
                int PageSize = Convert.ToInt32(ConfigurationManager.AppSettings["PageSize"]);
                model.Enquiry.PageSize = PageSize;
            }

            if (model.Enquiry.PageIndex == 0)
            {
                model.Enquiry.PageIndex = 1;
            }
            model.EnquiryList = new List<Enquiry>();
            model.Enquiry.TotalCount = 0;

            model.EnquiryList = _EnquiryService.GetAll(model.Enquiry).ToList();
            Lookup entity = new Lookup();

            if (model.EnquiryList != null && model.EnquiryList.Count > 0)
            {
                int TotalCount = model.EnquiryList[0].TotalCount;
                model.Enquiry.TotalCount = TotalCount;
            }

            return View(model);
        }
        public ActionResult DeleteEnquiry(string pEnquiryID)
        {
            if (!string.IsNullOrEmpty(pEnquiryID))
            {
                EnquiryListViewModel model = new EnquiryListViewModel();
                model.Enquiry = new Enquiry();
                model.Enquiry.EnquiryID = pEnquiryID;
                int i = _EnquiryService.Delete(model.Enquiry);

                if (i <= 0)
                    TempData["err"] = EnquiryRes.MsgDeleteError;
                else
                    TempData["msg"] = EnquiryRes.MsgDeleteSuccess;
            }

            return RedirectToAction("ManageEnquiry", "Enquiry");
        }