Exemple #1
0
        //
        // GET: /Enquiry/Edit/5
        public ActionResult Edit(int id)
        {
            if (id != 0)
            {
                ClassMasterModel    objModel         = new ClassMasterModel();
                EmployeeMasterModel objEmployeeModel = new EmployeeMasterModel();
                objBDCCommon = new CommonMasterDataBusiness();

                var ClassType = objBDCCommon.GetClassMaster(Convert.ToInt32(Session[CommonStrings.DefaultSession]));
                objModel.ClassList = new SelectList(ClassType, "ClassId", "Title");
                ViewBag.ClassInfo  = objModel.ClassList;

                var EmployeeType = objBDCCommon.GetEmployeeMaster();
                objEmployeeModel.EmployeeList = new SelectList(EmployeeType, "EmployeeId", "EmployeeName");
                ViewBag.EmployeeInfo          = objEmployeeModel.EmployeeList;

                objBDC = new EnquiryDetailBusiness();
                var rs = objBDC.GetById(id);

                return(View(rs));
            }
            else
            {
                return(View());
            }
        }
Exemple #2
0
        public ActionResult Edit(int id, EnquiryDetailCustomModel objModel)
        {
            try
            {
                // TODO: Add update logic here

                if (ModelState.IsValid)
                {
                    Response response = new Response();
                    // TODO: Add update logic here
                    objBDC              = new EnquiryDetailBusiness();
                    objModel.EnquiryId  = id;
                    objModel.CreatedBy  = ((School.Shared.CustomModels.UserLoginCustomModel)(Session[CommonStrings.UserSession])).Id;
                    objModel.ModifiedBy = ((School.Shared.CustomModels.UserLoginCustomModel)(Session[CommonStrings.UserSession])).Id;
                    response            = objBDC.SaveEnquiryDetails(objModel);

                    if (response.success == false)
                    {
                        return(new JavaScriptResult()
                        {
                            Script = "alert('Record already exists');"
                        });
                    }
                    else
                    {
                        return(RedirectToAction("Index"));
                    }
                }
                else
                {
                    ClassMasterModel    objClassModel    = new ClassMasterModel();
                    EmployeeMasterModel objEmployeeModel = new EmployeeMasterModel();
                    objBDCCommon = new CommonMasterDataBusiness();

                    var ClassType = objBDCCommon.GetClassMaster(Convert.ToInt32(Session[CommonStrings.DefaultSession]));
                    objClassModel.ClassList = new SelectList(ClassType, "ClassId", "Title");
                    ViewBag.ClassInfo       = objClassModel.ClassList;

                    var EmployeeType = objBDCCommon.GetEmployeeMaster();
                    objEmployeeModel.EmployeeList = new SelectList(EmployeeType, "EmployeeId", "EmployeeName");
                    ViewBag.EmployeeInfo          = objEmployeeModel.EmployeeList;

                    objBDC = new EnquiryDetailBusiness();
                    var rs = objBDC.GetById(id);

                    return(View(rs));
                }
            }
            catch
            {
                return(View());
            }
        }
Exemple #3
0
        //
        // GET: /Enquiry/Create
        public ActionResult Create(int id = 0)
        {
            EnquiryDetailCustomModel objModel         = new EnquiryDetailCustomModel();
            ClassMasterModel         objClassModel    = new ClassMasterModel();
            SessionMasterModel       objSessionModel  = new SessionMasterModel();
            EmployeeMasterModel      objEmployeeModel = new EmployeeMasterModel();

            objBDCCommon = new CommonMasterDataBusiness();

            var SessionType = objBDCCommon.GetSessionMaster();

            objSessionModel.SessionList = new SelectList(SessionType, "SessionId", "Title");
            ViewBag.SessionInfo         = objSessionModel.SessionList;

            var EmployeeType = objBDCCommon.GetEmployeeMaster();

            objEmployeeModel.EmployeeList = new SelectList(EmployeeType, "EmployeeId", "EmployeeName");
            ViewBag.EmployeeInfo          = objEmployeeModel.EmployeeList;

            if (id != 0)
            {
                objBDC   = new EnquiryDetailBusiness();
                objModel = objBDC.GetById(id);

                ViewBag.ClassValue   = Convert.ToString(objModel.ClassId);
                ViewBag.SessionValue = Convert.ToString(objModel.SessionId);

                var ClassType = objBDCCommon.GetClassMaster(Convert.ToInt32(objModel.SessionId));
                objClassModel.ClassList = new SelectList(ClassType, "ClassId", "Title");
                ViewBag.ClassInfo       = objClassModel.ClassList;
            }
            else
            {
                var ClassType = objBDCCommon.GetClassMaster(Convert.ToInt32(Session[CommonStrings.DefaultSession]));
                objClassModel.ClassList = new SelectList(ClassType, "ClassId", "Title");
                ViewBag.ClassInfo       = objClassModel.ClassList;

                ViewBag.SessionValue = Session[CommonStrings.DefaultSession].ToString();
            }

            return(View(objModel));
        }
Exemple #4
0
        // GET: FeeCollection/Create
        public ActionResult Create(int id = 0, int Aid = 0)
        {
            FeeCollectionCustomModel objFeeModel      = new FeeCollectionCustomModel();
            EnquiryDetailCustomModel objModel         = new EnquiryDetailCustomModel();
            EmployeeMasterModel      objEmployeeModel = new EmployeeMasterModel();

            objBDCCommon = new CommonMasterDataBusiness();
            objBDCENQ    = new EnquiryDetailBusiness();

            var EmployeeType = objBDCCommon.GetEmployeeMaster();

            objEmployeeModel.EmployeeList = new SelectList(EmployeeType, "EmployeeId", "EmployeeName");
            ViewBag.EmployeeInfo          = objEmployeeModel.EmployeeList;

            StudentCommonDetail objRes = new StudentCommonDetail();

            var rs        = objBDCENQ.GetEnquiryId(Aid);
            int Eid       = ((School.Shared.CustomModels.StudentCommonDetail)rs).EnquiryId;
            int?ClassId   = ((School.Shared.CustomModels.StudentCommonDetail)rs).ClassId;
            int?SectionId = ((School.Shared.CustomModels.StudentCommonDetail)rs).SectionId;

            if (Eid != 0)
            {
                ViewBag.StudentAdmissionDate = objBDCENQ.GetById(Eid);

                objBDC = new FeeCollectionBusiness();
                ViewBag.FeeCollection = objBDC.GetStudentFeeDetail(Aid, ClassId, SectionId);
            }

            if (id != 0)
            {
                objBDC      = new FeeCollectionBusiness();
                objFeeModel = objBDC.GetById(id);
            }

            return(View(objFeeModel));
        }
Exemple #5
0
        public ActionResult Create(FeeCollectionCustomModel objModel, int Aid = 0)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    // TODO: Add insert logic here
                    objBDC    = new FeeCollectionBusiness();
                    objBDCENQ = new EnquiryDetailBusiness();
                    StudentCommonDetail objResult = new StudentCommonDetail();

                    var rs        = objBDCENQ.GetEnquiryId(Aid);
                    int Eid       = ((School.Shared.CustomModels.StudentCommonDetail)rs).EnquiryId;
                    int?ClassId   = ((School.Shared.CustomModels.StudentCommonDetail)rs).ClassId;
                    int?SectionId = ((School.Shared.CustomModels.StudentCommonDetail)rs).SectionId;

                    if (Eid > 0 && Aid > 0)
                    {
                        objModel.EnquiryId   = Eid;
                        objModel.AdmissionId = Aid;
                        objModel.ClassId     = ClassId;
                        objModel.SectionId   = SectionId;
                        objModel.CreatedBy   = ((School.Shared.CustomModels.UserLoginCustomModel)(Session[CommonStrings.UserSession])).Id;
                        objModel.ModifiedBy  = ((School.Shared.CustomModels.UserLoginCustomModel)(Session[CommonStrings.UserSession])).Id;
                        objBDC.SaveFeeCollectionMasterDetails(objModel);

                        return(RedirectToAction("Create", new { id = 0, AId = Aid }));
                    }
                    else
                    {
                        return(RedirectToAction("Index"));
                    }
                }
                else
                {
                    objBDCENQ = new EnquiryDetailBusiness();
                    EmployeeMasterModel objEmployeeModel = new EmployeeMasterModel();
                    objBDCCommon = new CommonMasterDataBusiness();

                    var EmployeeType = objBDCCommon.GetEmployeeMaster();
                    objEmployeeModel.EmployeeList = new SelectList(EmployeeType, "EmployeeId", "EmployeeName");
                    ViewBag.EmployeeInfo          = objEmployeeModel.EmployeeList;

                    var rs        = objBDCENQ.GetEnquiryId(Aid);
                    int Eid       = ((School.Shared.CustomModels.StudentCommonDetail)rs).EnquiryId;
                    int?ClassId   = ((School.Shared.CustomModels.StudentCommonDetail)rs).ClassId;
                    int?SectionId = ((School.Shared.CustomModels.StudentCommonDetail)rs).SectionId;

                    if (Eid != 0)
                    {
                        ViewBag.StudentAdmissionDate = objBDCENQ.GetById(Eid);

                        objBDC = new FeeCollectionBusiness();
                        ViewBag.FeeCollection = objBDC.GetStudentFeeDetail(Aid, ClassId, SectionId);
                    }

                    return(View());
                }
            }
            catch
            {
                return(View());
            }
        }
Exemple #6
0
        public ActionResult Create(EnquiryDetailCustomModel objModel)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    Response _Result = new Response();

                    if (Request.Files[MessageDisplay.int0].ContentLength > MessageDisplay.int0)
                    {
                        var path = Path.Combine(System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + MessageDisplay.EnquiryFilePath);
                        objModel.Image = Thumbnails.UploadImage(Request.Files[MessageDisplay.int0].InputStream, path, Path.GetExtension(Request.Files[0].FileName), "e_", MessageDisplay.imageheightSize, MessageDisplay.imageweidthSize, false);
                    }

                    // TODO: Add insert logic here
                    objBDC              = new EnquiryDetailBusiness();
                    objModel.CreatedBy  = ((School.Shared.CustomModels.UserLoginCustomModel)(Session[CommonStrings.UserSession])).Id;
                    objModel.ModifiedBy = ((School.Shared.CustomModels.UserLoginCustomModel)(Session[CommonStrings.UserSession])).Id;
                    _Result             = objBDC.SaveEnquiryDetails(objModel);

                    if (_Result.success == true)
                    {
                        TempData["Message"] = "Success^" + _Result.message;
                    }
                    else if (_Result.success == false)
                    {
                        TempData["Message"] = "Error^" + _Result.message;
                    }

                    return(RedirectToAction("Index"));
                }
                else
                {
                    ClassMasterModel    objModelClass    = new ClassMasterModel();
                    SessionMasterModel  objSessionModel  = new SessionMasterModel();
                    EmployeeMasterModel objEmployeeModel = new EmployeeMasterModel();
                    objBDCCommon = new CommonMasterDataBusiness();

                    var ClassType = objBDCCommon.GetClassMaster(Convert.ToInt32(Session[CommonStrings.DefaultSession]));
                    objModelClass.ClassList = new SelectList(ClassType, "ClassId", "Title");
                    ViewBag.ClassInfo       = objModelClass.ClassList;

                    var SessionType = objBDCCommon.GetSessionMaster();
                    objSessionModel.SessionList = new SelectList(SessionType, "SessionId", "Title");
                    ViewBag.SessionInfo         = objSessionModel.SessionList;


                    var EmployeeType = objBDCCommon.GetEmployeeMaster();
                    objEmployeeModel.EmployeeList = new SelectList(EmployeeType, "EmployeeId", "EmployeeName");
                    ViewBag.EmployeeInfo          = objEmployeeModel.EmployeeList;

                    ViewBag.SessionValue = Session[CommonStrings.DefaultSession].ToString();

                    return(View());
                }
            }
            catch
            {
                return(View());
            }
        }