Exemplo n.º 1
0
        public ActionResult Select()
        {
            string mode = Request.QueryString["Grid-mode"];

            if (!string.IsNullOrEmpty(mode))
            {
                return(this.RedirectToAction("Create"));
            }
            else
            {
                List <StateVM> viewModels           = new List <StateVM>();
                StateBAL       balObject            = new StateBAL();
                IQueryable <Entities.State> entites = balObject.GetAll();

                CountryBAL countryBAL = new CountryBAL();
                IQueryable <Entities.Country> countries = countryBAL.GetAll();

                foreach (Entities.State entity in entites)
                {
                    StateVM viewModel = new StateVM();
                    viewModel.StateId     = entity.StateId;
                    viewModel.StateName   = entity.StateName;
                    viewModel.CountryName = countries.Where(c => c.CountryId == entity.CountryId).FirstOrDefault().CountryName;
                    viewModel.Status      = entity.Status;
                    viewModel.Remark      = entity.Remark;
                    viewModels.Add(viewModel);
                }
                return(View(new GridModel <StateVM> {
                    Data = viewModels
                }));
            }
        }
Exemplo n.º 2
0
        public ActionResult Index()
        {
            List <StudentAddressVM> viewModels           = new List <StudentAddressVM>();
            StudentAddressBAL       balObject            = new StudentAddressBAL();
            IQueryable <Entities.StudentAddress> entites = balObject.GetAll();

            CountryBAL countryBAL = new CountryBAL();
            IQueryable <Entities.Country> countries = countryBAL.GetAll();

            StateBAL stateBAL = new StateBAL();
            IQueryable <Entities.State> states = stateBAL.GetAll();

            DistrictBAL DistrictObject = new DistrictBAL();
            IQueryable <Entities.District> districts = DistrictObject.GetAll();

            CityBAL CityObject = new CityBAL();
            IQueryable <Entities.City> cities = CityObject.GetAll();

            StudentBAL studentObject = new StudentBAL();
            IQueryable <Entities.Student> students = studentObject.GetAll();


            foreach (Entities.StudentAddress entity in entites)
            {
                StudentAddressVM viewModel = new StudentAddressVM();
                viewModel.StudentId           = entity.StudentId;
                viewModel.CurrentAddress      = entity.CurrentAddress;
                viewModel.CurrentCountryId    = entity.CurrentCountryId;
                viewModel.CurrentStateId      = entity.CurrentStateId;
                viewModel.CurrentDistrictId   = entity.CurrentDistrictId;
                viewModel.CurrentCityId       = entity.CurrentCityId;
                viewModel.CurrentCountryName  = countries.Where(c => c.CountryId == entity.CurrentCountryId).FirstOrDefault().CountryName;
                viewModel.CurrentStateName    = states.Where(s => s.StateId == entity.CurrentStateId).FirstOrDefault().StateName;
                viewModel.CurrentDistrictName = districts.Where(c => c.DistrictId == entity.CurrentDistrictId).FirstOrDefault().DistrictName;

                viewModel.CurrentCityName = cities.Where(c => c.CityId == entity.CurrentDistrictId).FirstOrDefault().CityName;

                viewModel.PermentAddress    = entity.PermentAddress;
                viewModel.PermentCountryId  = entity.PermentCountryId;
                viewModel.PermentStateId    = entity.PermentStateId;
                viewModel.PermentDistrictId = entity.PermentDistrictId;
                viewModel.PermentCityId     = entity.PermentCityId;

                viewModel.PermentCountryName  = countries.Where(c => c.CountryId == entity.PermentCountryId).FirstOrDefault().CountryName;
                viewModel.PermentStateName    = states.Where(s => s.StateId == entity.PermentStateId).FirstOrDefault().StateName;
                viewModel.PermentDistrictName = districts.Where(c => c.DistrictId == entity.PermentDistrictId).FirstOrDefault().DistrictName;

                viewModel.PermentCityName = cities.Where(c => c.CityId == entity.PermentCityId).FirstOrDefault().CityName;

                viewModel.Status = entity.Status;
                viewModel.Remark = entity.Remark;
                Entities.Student student = students.Where(s => s.StudentId == entity.StudentId).FirstOrDefault();
                viewModel.StudentFullNameWithTitle = string.Concat(student.Title, " ", student.FirstName, " ", student.MiddleName, " ", student.LastName);
                viewModels.Add(viewModel);
            }
            return(View(new GridModel <StudentAddressVM> {
                Data = viewModels
            }));
        }
Exemplo n.º 3
0
        /// <summary>
        /// method for get state list
        /// </summary>
        /// <returns>state list</returns>
        public JsonResult GetStatesList(int CountryId)
        {
            StateBAL balObject  = new StateBAL();
            var      statesList = from obj in balObject.GetAll().Where(c => c.CountryId == CountryId && c.Status == true) select new SelectListItem()
            {
                Text = obj.StateName, Value = obj.StateId.ToString()
            };

            return(this.Json(statesList, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 4
0
        //
        // GET: /SysAdmin/District/Create
        public ActionResult Create()
        {
            DistrictVM viewModel = new DistrictVM();
            StateBAL   stateBAL  = new StateBAL();

            viewModel.States = from obj in stateBAL.GetAll() select new SelectListItem()
            {
                Text = obj.StateName, Value = obj.StateId.ToString()
            };
            viewModel.Status = true;
            return(View(viewModel));
        }
Exemplo n.º 5
0
        //
        // GET: /SysAdmin/District/Details/5
        public ActionResult Details(int id)
        {
            DistrictVM  viewModel = new DistrictVM();
            DistrictBAL balObject = new DistrictBAL();
            IQueryable <Entities.District> entites = balObject.FindBy(a => a.DistrictId == id);

            if (entites != null && entites.Count() > 0)
            {
                Entities.District entity = entites.FirstOrDefault();
                viewModel.DistrictId   = entity.DistrictId;
                viewModel.DistrictName = entity.DistrictName;
                StateBAL stateBAL = new StateBAL();
                IQueryable <Entities.State> states = stateBAL.GetAll();
                viewModel.StateName = stateBAL.FindBy(c => c.StateId == entity.StateId).FirstOrDefault().StateName;
                viewModel.Status    = entity.Status;
                viewModel.Remark    = entity.Remark;
            }
            return(View(viewModel));
        }
Exemplo n.º 6
0
        public ActionResult Index()
        {
            List <StateVM> viewModels           = new List <StateVM>();
            StateBAL       balObject            = new StateBAL();
            IQueryable <Entities.State> entites = balObject.GetAll();


            foreach (Entities.State entity in entites)
            {
                StateVM viewModel = new StateVM();
                viewModel.StateId     = entity.StateId;
                viewModel.StateName   = entity.StateName;
                viewModel.CountryName = entity.CountryName;
                viewModel.Status      = entity.Status;
                viewModel.Remark      = entity.Remark;
                viewModels.Add(viewModel);
            }
            return(View(new GridModel <StateVM> {
                Data = viewModels
            }));
        }
Exemplo n.º 7
0
        private DataSet LeavingCertificate(int StudentId)
        {
            DataSet ds = new DataSet();

            ds.DataSetName = "DataSourceForReport";

            DataTable dt = new DataTable("LeavingCertificate");

            dt.TableName = "LeavingCertificate";
            dt.Columns.Add(new DataColumn("StudentId", typeof(string)));
            dt.Columns.Add(new DataColumn("FirstName", typeof(string)));
            dt.Columns.Add(new DataColumn("MiddleName", typeof(string)));
            dt.Columns.Add(new DataColumn("LastName", typeof(string)));
            dt.Columns.Add(new DataColumn("MotherName", typeof(string)));
            dt.Columns.Add(new DataColumn("MotherTounge", typeof(string)));
            dt.Columns.Add(new DataColumn("ReligionName", typeof(string)));
            dt.Columns.Add(new DataColumn("CastName", typeof(string)));
            dt.Columns.Add(new DataColumn("SubCast", typeof(string)));
            dt.Columns.Add(new DataColumn("Nationality", typeof(string)));
            dt.Columns.Add(new DataColumn("PlaceOfBirth", typeof(string)));
            dt.Columns.Add(new DataColumn("DateOfBirth", typeof(DateTime)));
            dt.Columns.Add(new DataColumn("DateOfBirthInWord", typeof(string)));
            dt.Columns.Add(new DataColumn("LastSchool", typeof(string)));
            dt.Columns.Add(new DataColumn("DateOfAdmission", typeof(DateTime)));
            dt.Columns.Add(new DataColumn("Progress", typeof(string)));
            dt.Columns.Add(new DataColumn("Conduct", typeof(string)));
            dt.Columns.Add(new DataColumn("DateOfLeaveingSchool", typeof(DateTime)));
            dt.Columns.Add(new DataColumn("ClassInWhichStudingAndSinceWhen", typeof(string)));
            dt.Columns.Add(new DataColumn("Reason", typeof(string)));
            dt.Columns.Add(new DataColumn("Remark", typeof(string)));
            dt.Columns.Add(new DataColumn("RegisterNo", typeof(int)));
            dt.Columns.Add(new DataColumn("TCNo", typeof(string)));
            dt.Columns.Add(new DataColumn("TCPrinted", typeof(bool)));
            dt.Columns.Add(new DataColumn("AdharcardNo", typeof(string)));
            dt.Columns.Add(new DataColumn("DateOfLeaveingSchoolInWords", typeof(string)));
            dt.Columns.Add(new DataColumn("Taluka", typeof(string)));
            dt.Columns.Add(new DataColumn("District", typeof(string)));
            dt.Columns.Add(new DataColumn("state", typeof(string)));
            dt.Columns.Add(new DataColumn("Country", typeof(string)));

            int studentId = (int)PresentationLayer.Helpers.SessionHelper.StudentId;

            // Fetch the District, State, Country from database ***********

            string strDistrict, strState, strCountry, strCity;

            strDistrict = strState = strCountry = strCity = "";

            //balObject.FindBy(s => s.StudentId == studentId );

            StudentParentBAL balObjectAddr = new StudentParentBAL();
            IQueryable <Entities.StudentParent> entites1 = balObjectAddr.FindBy(s => s.StudentId == studentId);

            if (entites1 != null && entites1.Count() > 0)
            {
                Entities.StudentParent entity1 = entites1.FirstOrDefault();

                CountryBAL countryBAL = new CountryBAL();
                IQueryable <Entities.Country> countries = countryBAL.GetAll();

                StateBAL stateBAL = new StateBAL();
                IQueryable <Entities.State> states = stateBAL.GetAll();

                DistrictBAL DistrictObject = new DistrictBAL();
                IQueryable <Entities.District> District = DistrictObject.GetAll();

                CityBAL CityObject = new CityBAL();
                IQueryable <Entities.City> Cities = CityObject.GetAll();


                strCountry  = countries.Where(c => c.CountryId == entity1.CountryId).FirstOrDefault().CountryName;
                strState    = states.Where(s => s.StateId == entity1.StateId).FirstOrDefault().StateName;
                strDistrict = District.Where(c => c.DistrictId == entity1.DistrictId).FirstOrDefault().DistrictName;
                strCity     = Cities.Where(c => c.CityId == entity1.CityId).FirstOrDefault().CityName;
            }


            // *********

            StudentBAL balObject = new StudentBAL();
            //IQueryable<Entities.Student> entites = balObject.FindBy(s => s.StudentId == studentId );
            IQueryable <Entities.Student> entites = balObject.GetAll(SessionHelper.SchoolId).Where(c => c.StudentId == studentId);

            if (entites != null && entites.Count() > 0)
            {
                Entities.Student entity = entites.FirstOrDefault();
                DataRow          dr     = dt.NewRow();

                dr["StudentId"]    = entity.UStudentId;
                dr["FirstName"]    = entity.FirstName.Trim();
                dr["MiddleName"]   = entity.MiddleName.Trim();;
                dr["LastName"]     = entity.LastName.Trim();;
                dr["MotherName"]   = entity.MotherName.Trim();;
                dr["ReligionName"] = entity.ReligionName.Trim();;
                dr["CastName"]     = entity.CastName.Trim();
                dr["SubCast"]      = "";                 //TODO
                dr["Nationality"]  = entity.Nationality.Trim();
                dr["DateOfBirth"]  = entity.DateOfBirth; //Date
                dr["PlaceOfBirth"] = entity.PlaceOfBirth;

                if (entity.DateOfBirth != null)
                {
                    dr["DateOfBirthInWord"] = DateToText(entity.DateOfBirth);
                }
                else
                {
                    dr["DateOfBirthInWord"] = "";
                }

                dr["LastSchool"]      = entity.LastSchoolAttended;
                dr["DateOfAdmission"] = entity.DateOfAdmission; //Date
                if (entity.DateOfAdmission != null)
                {
                    dr["DateOfAdmission"] = entity.DateOfAdmission;//Date
                }
                dr["Progress"] = entity.Progress;
                dr["Conduct"]  = entity.Conduct;
                if (entity.DateOfLeavingSchool != null)
                {
                    dr["DateOfLeaveingSchool"]        = entity.DateOfLeavingSchool;//Date
                    dr["DateOfLeaveingSchoolInWords"] = DateToText((System.DateTime)entity.DateOfLeavingSchool);
                }
                else
                {
                    dr["DateOfLeaveingSchoolInWords"] = "";
                }


                dr["ClassInWhichStudingAndSinceWhen"] = entity.ClassInWhichStudingAndSinceWhen;
                dr["Reason"]     = entity.ReasonForLeavingSchool;
                dr["Remark"]     = entity.RemarkOnTC;
                dr["RegisterNo"] = entity.RegisterId;

                dr["TCPrinted"] = entity.TCPrinted;
                if (!entity.TCPrinted)
                {
                    long maxTCNo = balObject.GetMaxTCNo();
                    dr["TCNo"] = FormatedTCNo(Convert.ToString(maxTCNo + 1));

                    //if (isPrintExport)
                    //  UpdateTCDetails(studentId);
                }
                else
                {
                    dr["TCNo"] = FormatedTCNo(Convert.ToString(entity.TCNo));
                }

                if (isPrintExport)
                {
                    UpdateTCDetails(studentId);
                }

                dr["AdharcardNo"]  = entity.AdharcardNo;
                dr["MotherTounge"] = entity.MotherTounge;

                // ****
                dr["Taluka"]   = strCity;
                dr["District"] = strDistrict;
                dr["state"]    = strState;
                dr["Country"]  = strCountry;

                dt.Rows.Add(dr);
                reportName = entity.RegisterId + "_" + entity.LastName.Trim() + "_" + entity.FirstName.Trim();
            }

            ds.Tables.Add(getSchoolDetails());
            ds.Tables.Add(dt);
            return(ds);
        }