/// <summary> /// GET STUDENTS LIST /// </summary> /// <param name="aStudent"></param> /// <returns></returns> public List <ModelStudent> GetStudentList() { List <ModelStudent> lstModelStudent = new List <ModelStudent>(); DataTable tblStudentList = new DataTable(); tblStudentList = DALCommon.GetDataByQuery("[sp_GetStudentRocordList]"); if (tblStudentList.Rows.Count > 0) { foreach (DataRow aStudent in tblStudentList.Rows) { ModelStudent objModelStudent = new ModelStudent(); objModelStudent.StudentId = Convert.ToInt32(aStudent["StudentId"]); objModelStudent.ComputerCode = Convert.ToInt32(aStudent["ComputerCode"]); objModelStudent.RegNo = Convert.ToInt32(aStudent["RegNo"]); objModelStudent.StudentName = Convert.ToString(aStudent["StudentName"]); objModelStudent.FatherName = Convert.ToString(aStudent["FatherName"]); objModelStudent.MonthlyFee = Convert.ToInt32(aStudent["MonthlyFee"]); //objModelStudent.Sex = Convert.ToInt32(aStudent["Gender"]); objModelStudent.DateOfBirth = Convert.ToDateTime(aStudent["DateOfBirth"]); objModelStudent.StudentClass.ClassName = Convert.ToString(aStudent["ClassName"]); objModelStudent.StudentSection.SectionName = Convert.ToString(aStudent["SectionName"]); objModelStudent.StatusText = Convert.ToString(aStudent["StatusText"]); objModelStudent.Status = Convert.ToInt32(aStudent["Status"]); objModelStudent.DateOfAdmission = Convert.ToDateTime(aStudent["DateOfAdmission"]); lstModelStudent.Add(objModelStudent); } } return(lstModelStudent); }
public List <ModelStudent> GetStudentList(string SearchCriteria, decimal SchoolAccountId) { List <ModelStudent> lstModelStudent = new List <ModelStudent>(); DataTable tblStudentList = new DataTable(); SqlParameter[] param = new SqlParameter[2]; param[0] = new SqlParameter("@SearchCriteria", String.IsNullOrEmpty(SearchCriteria) ? "" : SearchCriteria); param[1] = new SqlParameter("@SchoolAccountId", SchoolAccountId); tblStudentList = DALCommon.GetDataUsingDataTable("[sp_Admin_GetStudentListBySchoolId]", param); if (tblStudentList.Rows.Count > 0) { foreach (DataRow aStudent in tblStudentList.Rows) { ModelStudent objModelStudent = new ModelStudent(); objModelStudent.StudentId = Convert.ToInt32(aStudent["StudentId"]); objModelStudent.ComputerCode = Convert.ToInt32(aStudent["ComputerCode"]); objModelStudent.RegNo = Convert.ToInt32(aStudent["RegNo"]); objModelStudent.StudentName = Convert.ToString(aStudent["StudentName"]); objModelStudent.FatherName = Convert.ToString(aStudent["FatherName"]); objModelStudent.MonthlyFee = Convert.ToInt32(aStudent["MonthlyFee"]); objModelStudent.Sex = Convert.ToInt32(aStudent["Gender"]); objModelStudent.DateOfBirth = Convert.ToDateTime(aStudent["DateOfBirth"]); objModelStudent.Status = Convert.ToInt32(aStudent["Status"]); objModelStudent.StatusText = Convert.ToString(aStudent["StatusText"]); objModelStudent.StudentClass.ClassName = Convert.ToString(aStudent["ClassName"]); objModelStudent.StudentSection.SectionName = Convert.ToString(aStudent["SectionName"]); lstModelStudent.Add(objModelStudent); } } return(lstModelStudent); }
public ActionResult Post([FromBody] ModelStudent StudentObject) { using (var StuContext = new ContextStudent()) { StuContext.TableStudent.Add(StudentObject); StuContext.SaveChanges(); } return(Ok("StudentAdded")); }
// GET: Admin/Training public ActionResult Index() { ProjectDbContext dbContext = new ProjectDbContext(); IEnumerable <Student> list = dbContext.Students.Where(x => x.Model == null).ToList(); ModelStudent model = new ModelStudent(); model.list = list; return(View("Index", model)); }
public ActionResult Delete([FromBody] ModelStudent StudentObject) { using (var StuContext = new ContextStudent()) { StuContext.TableStudent.Remove(StudentObject); StuContext.SaveChanges(); } return(Ok("StudentDeleted")); }
public ActionResult Create(ModelStudent model,string CaptchaText) { if (ModelState.IsValid) { if (Session["CaptchaImageText"]!=null) { if (Session["CaptchaImageText"].ToString() == CaptchaText) { ViewBag.Message = "Catcha Validation Success!"; try { tbl_Student _student = new tbl_Student(); _student.Password = model.Password; _student.StudentId = model.StudentId; _student.Activation = false; _student.ConformPassword = model.ConformPassword; _student.FirstName = model.FirstName; _student.LastName = model.LastName; _student.email_address = model.email_address; _student.ProgramId = model.ProgramId; db.tbl_Student.Add(_student); if (db.SaveChanges() > 0) { ViewBag.Message = "We have created your account. Please contact library to activate."; ModelState.Clear(); } } catch (Exception e) { ViewBag.Message =e.Message; } //tbl_Student.Activation = false; //db.tbl_Student.Add(tbl_Student); //db.SaveChanges(); //tbl_Student=new tbl_Student(); } else { ViewBag.Message = "Catcha Validation Failed!"; } } var ProgramList = new SelectDropDownListManager().GetProgramlist().ToList(); ViewBag.Program = ProgramList; } return View("Create"); }
public ActionResult RegStudent(ModelStudent model, string CaptchaText) { if (ModelState.IsValid) { if (Session["CaptchaImageText"] != null) { if (Session["CaptchaImageText"].ToString() == CaptchaText) { ViewBag.Message = "Catcha Validation Success!"; try { tbl_Student _student = new tbl_Student(); _student.Password = model.Password; _student.StudentId = model.StudentId; _student.Activation = false; _student.ConformPassword = model.ConformPassword; _student.FirstName = model.FirstName; _student.LastName = model.LastName; _student.email_address = model.email_address; _student.ProgramId = model.ProgramId; db.tbl_Student.Add(_student); if (db.SaveChanges() > 0) { ViewBag.Message = "Your registration is successfully completed . after sometimes later you can login when activate your account "; ModelState.Clear(); } } catch (Exception e) { ViewBag.Message = e.Message; } //tbl_Student.Activation = false; //db.tbl_Student.Add(tbl_Student); //db.SaveChanges(); //tbl_Student=new tbl_Student(); } else { ViewBag.Message = "Catcha Validation Failed!"; } } var ProgramList = new SelectDropDownListManager().GetProgramlist().ToList(); ViewBag.Program = ProgramList; } return PartialView("RegStudent"); }
public DataTable GetStudentInfoWithBarCode(decimal StudentID) { ModelStudent objModelStudent = new ModelStudent(); DataTable tblStudentInfo = new DataTable(); SqlParameter[] param = new SqlParameter[1]; param[0] = new SqlParameter("@StudentId", StudentID); tblStudentInfo = DALCommon.GetDataUsingDataTable("[sp_Admin_GetStudentInfoByStudentId]", param); return(tblStudentInfo); }
public IActionResult Put(int id, [FromBody] ModelStudent modelStudent) { try { this.studentLogic.Update(id, modelStudent.ToUpdateEntity()); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public IActionResult Post([FromBody] ModelStudent modelStudent) { try { var student = this.studentLogic.Add(modelStudent.ToEntity()); return(CreatedAtRoute(routeName: "GetStudent", routeValues: new { id = student.Id }, value: new ModelStudentDetailInfo(student))); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public ActionResult EditStudent(string studentID) { ViewModelStudent objModelStudent = new ViewModelStudent(); if (!String.IsNullOrEmpty(studentID.Trim())) { BLLStudent objBLLStudent = new BLLStudent(); objModelStudent = objBLLStudent.GetStudentInfoById(Convert.ToDecimal(studentID)); ViewBag.dpClass = objBLLStudent.GetClassDropdown(Convert.ToInt32(Session[DALVariables.SchoolAccountId])); ViewBag.dpSection = objBLLStudent.GetClassSectionDropdown(Convert.ToInt32(Session[DALVariables.SchoolAccountId])); } return(PartialView(customview("_EditFormStudent", "Student"), objModelStudent)); }
public ActionResult PrikaziIspite(int studentId) { StudentskaEvidencijaEntities entiteti = new StudentskaEvidencijaEntities(); List <ModelIspit> listaIspita = new List <ModelIspit>(); //punjenje student.json var pronadjeniStudenti = entiteti.Students.Where(it => it.StudentID == studentId); if (pronadjeniStudenti.Count() > 0) { Student student = pronadjeniStudenti.FirstOrDefault(); ModelStudent modelStudent = new ModelStudent(student.StudentID, student.ImePrezime, student.BrojIndeksa, student.Finansiranje, student.Smer.NazivSmera, student.Slika); string studentjson = new JavaScriptSerializer().Serialize(modelStudent); StreamWriter _testDataStudent = new StreamWriter(Server.MapPath(@"\Content\student.json"), false); _testDataStudent.WriteLine(studentjson); _testDataStudent.Flush(); _testDataStudent.Close(); _testDataStudent.Dispose(); } //punjenje ispiti.json foreach (var ispit in entiteti.Ispits.Where(it => it.StudentID == studentId)) { listaIspita.Add(new ModelIspit(studentId + "", ispit.PredmetID + "", ispit.Predmet.NazivPredmeta + "", datumUStringMDG(ispit.Datum.Value) + "", ispit.Profesor.ImePrezime + "", ispit.Ocena.Value + "", ispit.ProfesorID + "")); } string json = new JavaScriptSerializer().Serialize(listaIspita); StreamWriter _testData = new StreamWriter(Server.MapPath(@"\Content\ispiti.json"), false); _testData.WriteLine(json); _testData.Flush(); _testData.Close(); _testData.Dispose(); ViewBag.studentId = studentId; return(View()); }
private void lstViewStudent_MouseDoubleClick(object sender, MouseEventArgs e) { string stuName = lstViewStudent.SelectedItems[0].Text; string stuNo = lstViewStudent.SelectedItems[0].SubItems[1].Text; string stuSex = lstViewStudent.SelectedItems[0].SubItems[2].Text; DateTime birthday = Convert.ToDateTime(lstViewStudent.SelectedItems[0].SubItems[3].Text); string stuClsName = lstViewStudent.SelectedItems[0].SubItems[4].Text; int ClassID = bllclass.GetClassIDClassName(stuClsName); string stuDep = lstViewStudent.SelectedItems[0].SubItems[5].Text; modelstudent = new ModelStudent(); modelstudent.StudentName = stuName; modelstudent.StudentNo = stuNo; modelstudent.Gender = stuSex; modelstudent.Birthday = birthday; modelstudent.ClassID = ClassID; modelstudent.StudentDep = stuDep; }
public List <ModelStudent> GetStudentListForReport(string SearchCriteria, int CampusTypeId, decimal SchoolAccountId) { List <ModelStudent> lstModelStudent = new List <ModelStudent>(); DataTable tblStudentList = new DataTable(); SqlParameter[] param = new SqlParameter[3]; param[0] = new SqlParameter("@SearchCriteria", String.IsNullOrEmpty(SearchCriteria) ? "" : SearchCriteria); param[1] = new SqlParameter("@CampusTypeId", CampusTypeId); param[2] = new SqlParameter("@SchoolAccountId", SchoolAccountId); tblStudentList = DALCommon.GetDataUsingDataTable("[sp_Admin_GetStudentsForReportBySchoolId]", param); if (tblStudentList.Rows.Count > 0) { foreach (DataRow aStudent in tblStudentList.Rows) { //StudentId,ComputerCode, RegNo, StudentName, FatherName,DateOfBirth,Status, //ClassId,SectionId,MonthlyFee,Profession,P,Reference,Gender,DateOfAdmission,Address,HomeNumber, //OfficeNumber,ClassName,SectionName ModelStudent objModelStudent = new ModelStudent(); objModelStudent.StudentId = Convert.ToInt32(aStudent["StudentId"]); objModelStudent.ComputerCode = Convert.ToInt32(aStudent["ComputerCode"]); objModelStudent.RegNo = Convert.ToInt32(aStudent["RegNo"]); objModelStudent.StudentName = Convert.ToString(aStudent["StudentName"]); objModelStudent.FatherName = Convert.ToString(aStudent["FatherName"]); objModelStudent.DateOfBirth = Convert.ToDateTime(aStudent["DateOfBirth"]); objModelStudent.Status = Convert.ToInt32(aStudent["Status"]); objModelStudent.MonthlyFee = Convert.ToInt32(aStudent["MonthlyFee"]); objModelStudent.Profession = Convert.ToString(aStudent["Profession"]); objModelStudent.Reference = Convert.ToString(aStudent["Reference"]); objModelStudent.DateOfAdmission = Convert.ToDateTime(aStudent["DateOfAdmission"]); objModelStudent.Address = Convert.ToString(aStudent["Address"]); objModelStudent.HomeNumber = Convert.ToString(aStudent["HomeNumber"]); objModelStudent.OfficeNumber = Convert.ToString(aStudent["OfficeNumber"]); objModelStudent.MoblieNumber = Convert.ToString(aStudent["MoblieNumber"]); objModelStudent.ClassNameText = Convert.ToString(aStudent["ClassName"]); objModelStudent.SectionNameText = Convert.ToString(aStudent["SectionName"]); // objModelStudent.ModelStudentFee = GetUnPaidFeeListByStudentId(objModelStudent.StudentId); lstModelStudent.Add(objModelStudent); } } return(lstModelStudent); }
public ActionResult GetAdvanceStudentFeeRecord(string studentID) { ModelStudent objModelStudent = new ModelStudent(); if (!String.IsNullOrEmpty(studentID.Trim())) { try { BLLStudentFee objBLLStudentFee = new BLLStudentFee(); objModelStudent = objBLLStudentFee.GetStudentFeeInfoById(Convert.ToDecimal(studentID)); } catch (Exception ex) { DALUtility.ErrorLog(ex.Message, "StudentFeeController, GetStudentSingleFeeRecord"); } } return(PartialView(customview("_AdvanceFeeInsertion", "StudentFee"), objModelStudent)); }
public ActionResult UpdateStudentMonthlyFeeRecord(ModelStudentFee objModelStudentFee) { if (ModelState.IsValid) { if (objModelStudentFee != null) { try { BLLStudentFee objBLLStudentFee = new BLLStudentFee(); int _updateResult = 0; _updateResult = objBLLStudentFee.UpdateStudentSinngleFeeInfoByFeeId(objModelStudentFee); if (_updateResult > 0) { ModelStudent objModelStudent = new ModelStudent(); objBLLStudentFee = new BLLStudentFee(); objModelStudent = objBLLStudentFee.GetStudentFeeInfoById(Convert.ToDecimal(objModelStudentFee.StudentId)); Success("Fee Record Successfully Updated"); return(PartialView(customview("_GetFormStudentFeeInfo", "StudentFee"), objModelStudent)); } else { Error("Error occured while updating your fee record"); return(PartialView(customview("_EditStudentMonthlyFeeInfo", "StudentFee"), objModelStudentFee)); } } catch (Exception ex) { DALUtility.ErrorLog(ex.Message, "StudentFeeController, UpdateStudentMonthlyFeeRecord"); } } } Error("Record not Updated"); return(PartialView(customview("_EditStudentMonthlyFeeInfo", "StudentFee"), objModelStudentFee)); }
public ActionResult Register(ModelStudent _model) { return(View()); }
public ModelStudent GetStudentFeeInfoById(decimal StudentID) { ModelStudent objModelStudent = new ModelStudent(); DataTable tblStudentInfo = new DataTable(); SqlParameter[] param = new SqlParameter[1]; param[0] = new SqlParameter("@StudentId", StudentID); tblStudentInfo = DALCommon.GetDataUsingDataTable("[sp_Admin_GetStudentInfoByStudentId]", param); if (tblStudentInfo.Rows.Count > 0) { objModelStudent.StudentId = Convert.ToInt32(tblStudentInfo.Rows[0]["StudentId"].ToString()); objModelStudent.ComputerCode = Convert.ToInt32(tblStudentInfo.Rows[0]["ComputerCode"].ToString()); objModelStudent.RegNo = Convert.ToInt32(tblStudentInfo.Rows[0]["RegNo"].ToString()); objModelStudent.StudentName = Convert.ToString(tblStudentInfo.Rows[0]["StudentName"].ToString()); objModelStudent.FatherName = Convert.ToString(tblStudentInfo.Rows[0]["FatherName"].ToString()); objModelStudent.MonthlyFee = Convert.ToInt32(tblStudentInfo.Rows[0]["MonthlyFee"].ToString()); objModelStudent.StudentClass.ClassName = Convert.ToString(tblStudentInfo.Rows[0]["ClassName"].ToString()); objModelStudent.StudentSection.SectionName = Convert.ToString(tblStudentInfo.Rows[0]["SectionName"].ToString()); objModelStudent.Status = Convert.ToInt32(tblStudentInfo.Rows[0]["Status"].ToString()); objModelStudent.ClassId = Convert.ToInt32(tblStudentInfo.Rows[0]["ClassId"].ToString()); objModelStudent.SectionId = Convert.ToInt32(tblStudentInfo.Rows[0]["SectionId"].ToString()); DataTable tblStudentFeeInfo = new DataTable(); SqlParameter[] paramStudentFee = new SqlParameter[1]; paramStudentFee[0] = new SqlParameter("@StudentId", StudentID); tblStudentFeeInfo = DALCommon.GetDataUsingDataTable("[sp_Admin_GetStudentMonthlyFeeByStudentId]", paramStudentFee); if (tblStudentFeeInfo.Rows.Count > 0) { foreach (DataRow studentFeeRow in tblStudentFeeInfo.Rows) { ModelStudentFee objModelStudentFee = new ModelStudentFee(); objModelStudentFee.FeeId = Convert.ToDouble(studentFeeRow["FeeId"]); objModelStudentFee.StudentId = Convert.ToDouble(studentFeeRow["StudentId"]); objModelStudentFee.ComputerCode = Convert.ToInt32(studentFeeRow["ComputerCode"]); objModelStudentFee.SerialNo = Convert.ToInt32(studentFeeRow["SerialNo"]); if (!DBNull.Value.Equals(studentFeeRow["FeeDate"])) { objModelStudentFee.FeeDate = Convert.ToDateTime(studentFeeRow["FeeDate"].ToString()); } else { objModelStudentFee.FeeDate = DateTime.Now; } objModelStudentFee.AdmissionFee = DALUtility.isNumericDBNULL(studentFeeRow["AdmissionFee"].ToString()); objModelStudentFee.Admission = DALUtility.isNumericDBNULL(studentFeeRow["Admission"].ToString()); objModelStudentFee.ReAdmissionFee = DALUtility.isNumericDBNULL(studentFeeRow["ReAdmissionFee"].ToString()); objModelStudentFee.RegistrationFee = DALUtility.isNumericDBNULL(studentFeeRow["RegistrationFee"].ToString()); objModelStudentFee.MonthlyFee = DALUtility.isNumericDBNULL(studentFeeRow["MonthlyFee"].ToString()); objModelStudentFee.ComputerFee = DALUtility.isNumericDBNULL(studentFeeRow["ComputerFee"].ToString()); objModelStudentFee.Fine = DALUtility.isNumericDBNULL(studentFeeRow["Fine"].ToString()); objModelStudentFee.ExamFee = DALUtility.isNumericDBNULL(studentFeeRow["ExamFee"].ToString()); objModelStudentFee.GeneratorFee = DALUtility.isNumericDBNULL(studentFeeRow["GeneratorFee"].ToString()); objModelStudentFee.FeeMonth = Convert.ToString(studentFeeRow["FeeMonth"]); objModelStudentFee.Total = DALUtility.isNumericDBNULL(studentFeeRow["Total"].ToString()); objModelStudentFee.FeePaidStatus = Convert.ToInt32(studentFeeRow["FeePaidStatus"]); objModelStudent.ModelStudentFee.Add(objModelStudentFee); } } } return(objModelStudent); }