private long AddStudentFee(DTO.LABURNUM.COM.StudentFeeModel model) { API.LABURNUM.COM.StudentFee apiStudentFee = new StudentFee() { StudentId = model.StudentId, AdmissionTypeId = model.AdmissionTypeId, ClassId = model.ClassId, SectionId = model.SectionId, AdmissionFee = model.AdmissionFee, AnnualCharges = model.AnnualCharges, DevelopementFee = model.DevelopementFee, ExamFee = model.ExamFee, SecurityFee = model.SecurityFee, SportsFee = model.SportsFee, AnnualFunctionFee = model.AnnualFunctionFee, DiscountAmount = model.DiscountAmount, DiscountRemarks = model.DiscountRemarks, CollectedById = model.CollectedById, CreatedOn = new Component.Utility().GetISTDateTime(), AcademicYearId = model.AcademicYearId, IsActive = true, }; this._laburnum.StudentFees.Add(apiStudentFee); this._laburnum.SaveChanges(); return(apiStudentFee.StudentFeeId); }
public ActionResult DeleteConfirmed(int id) { StudentFee studentFee = db.StudentFees.Find(id); db.StudentFees.Remove(studentFee); db.SaveChanges(); return(RedirectToAction("Index")); }
public async Task <ServiceResponse <object> > AddFee(StudentFeeDtoForAdd model) { if (model.Id > 0) { var objToUpdate = await _context.StudentFees.Where(m => m.Id == model.Id).FirstOrDefaultAsync(); if (objToUpdate != null) { _context.StudentFees.Remove(objToUpdate); await _context.SaveChangesAsync(); _serviceResponse.Success = true; _serviceResponse.Message = CustomMessage.Deleted; } } else { var currentMonth = DateTime.UtcNow.ToString("MMMM") + " " + DateTime.UtcNow.Year; var ToAdd = new StudentFee { StudentId = model.StudentId, ClassSectionId = model.ClassSectionId, Remarks = model.Remarks, Paid = model.Paid, Month = currentMonth, CreatedDateTime = DateTime.UtcNow, CreatedById = _LoggedIn_UserID, SchoolBranchId = _LoggedIn_BranchID, }; await _context.StudentFees.AddAsync(ToAdd); await _context.SaveChangesAsync(); if (_LoggedIn_SchoolExamType == Enumm.ExamTypes.Semester.ToString()) { var ToUpdateInstallmentPaidStatus = (from sfm in _context.SemesterFeeMappings join fi in _context.FeeInstallments on sfm.Id equals fi.SemesterFeeMappingId where sfm.StudentId == ToAdd.StudentId && fi.Paid == false orderby fi.Id select fi).FirstOrDefault(); if (ToUpdateInstallmentPaidStatus != null) { ToUpdateInstallmentPaidStatus.PaidMonth = currentMonth; ToUpdateInstallmentPaidStatus.Paid = true; _context.FeeInstallments.Update(ToUpdateInstallmentPaidStatus); await _context.SaveChangesAsync(); } } _serviceResponse.Success = true; _serviceResponse.Message = CustomMessage.Added; } return(_serviceResponse); }
public void add(StudentFee obj) { try { _service.Add(obj); } catch (Exception e) { Console.WriteLine(e); throw; } }
public ActionResult Edit([Bind(Include = "StudentFeeID,StudentID,TestID,MembershipID,InventoryID,StudentFee_datetime")] StudentFee studentFee) { if (ModelState.IsValid) { db.Entry(studentFee).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.InventoryID = new SelectList(db.Inventories, "InventoryID", "Product_Name", studentFee.InventoryID); ViewBag.MembershipID = new SelectList(db.MembershipTypes, "MembershipID", "Membership_Name", studentFee.MembershipID); ViewBag.StudentID = new SelectList(db.Students, "StudentID", "StudentName", studentFee.StudentID); ViewBag.TestID = new SelectList(db.TestFees, "TestID", "TestID", studentFee.TestID); return(View(studentFee)); }
private long AddStudentFee(DTO.LABURNUM.COM.StudentFeeModel model) { API.LABURNUM.COM.StudentFee apiStudentFee = new StudentFee() { StudentId = model.StudentId, AdmissionTypeId = model.AdmissionTypeId, ClassId = model.ClassId, CreatedOn = System.DateTime.Now, IsActive = true }; this._laburnum.StudentFees.Add(apiStudentFee); this._laburnum.SaveChanges(); return(apiStudentFee.ClassId); }
// GET: StudentFees/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StudentFee studentFee = db.StudentFees.Find(id); if (studentFee == null) { return(HttpNotFound()); } return(View(studentFee)); }
public ActionResult Fee_edit_student(int id, StudentFee studentFee) { try { using (DBmodel payrollentities = new DBmodel()) { payrollentities.Entry(studentFee).State = EntityState.Modified; payrollentities.SaveChanges(); } return(RedirectToAction("Fee_details_students")); } catch { return(View()); } }
public ActionResult Add_student_fee(int id, StudentFee studentFee) { try { using (DBmodel payrollentities = new DBmodel()) { payrollentities.StudentFees.Add(studentFee); payrollentities.SaveChanges(); } return(RedirectToAction("Fee_details_students")); } catch { return(View()); } }
/// <summary> /// Method to get student fee detail - SS /// </summary> /// <param name="studentId">student id</param> /// <param name="loggedInUser">logged in user</param> /// <returns>response</returns> public async Task <StudentFeeResponse> GetStudentFeeAsync(int studentId, ApplicationUser loggedInUser) { var instituteId = await _instituteUserMappingHelperService.GetUserCurrentSelectedInstituteIdAsync(loggedInUser.Id, true); var student = await _iMSDbContext.StudentBasicInformation.FirstOrDefaultAsync(x => x.Id == studentId && x.InstituteId == instituteId); if (student == null) { return new StudentFeeResponse() { HasError = true, Message = "Student not found" } } ; else { var studentFee = await _iMSDbContext.StudentFees.FirstOrDefaultAsync(x => x.StudentId == studentId && x.ClassId == student.CurrentClassId); if (studentFee == null) { studentFee = new StudentFee() { CreatedOn = DateTime.UtcNow, ClassId = student.CurrentClassId, StudentId = studentId, UpdatedById = loggedInUser.Id, UpdatedOn = DateTime.UtcNow }; _iMSDbContext.StudentFees.Add(studentFee); await _iMSDbContext.SaveChangesAsync(); } await SeedDataForStudentFeeAsync(studentFee.Id); studentFee = await _iMSDbContext.StudentFees.Include(s => s.Student).Include(s => s.StudentFeeComponents).FirstAsync(x => x.Id == studentFee.Id); var components = await _iMSDbContext.FeeComponents.Where(x => x.FeeComponentType == FeeComponentTypeEnum.Individual || x.FeeComponentType == FeeComponentTypeEnum.Deduction).ToListAsync(); return(new StudentFeeResponse() { HasError = false, Data = new { StudentFee = studentFee, Discount = components.Where(x => x.FeeComponentType == FeeComponentTypeEnum.Deduction).ToList(), Individual = components.Where(x => x.FeeComponentType == FeeComponentTypeEnum.Individual).ToList(), } }); } }
public void InsertStudentFee(StudentFee studentfee) { var query = "INSERT INTO Student_Fee( Student_Id , Total_Fee , Remaining_Dues , Fine , Transport_Dues , Due_Date , Last_Date )" + "VALUES ( @student_id , @total_fee , @remaining_dues , @fine , @transport_dues , @due_date , @last_date );"; List <SqlParameter> parameters = new List <SqlParameter> { new SqlParameter() { ParameterName = "@student_id", Value = studentfee.StudentId }, new SqlParameter() { ParameterName = "@total_fee", Value = studentfee.TotalFee }, new SqlParameter() { ParameterName = "@remaining_dues", Value = studentfee.RemainingDues }, new SqlParameter() { ParameterName = "@fine", Value = studentfee.Fine }, new SqlParameter() { ParameterName = "@transport_dues", Value = studentfee.TransportDues }, new SqlParameter() { ParameterName = "@due_date", Value = studentfee.DueDate.ToShortDateString() }, new SqlParameter() { ParameterName = "@last_date", Value = studentfee.LastDate.ToShortDateString() }, }; _dbClient.InvokeParameters(query, parameters); }
public ActionResult Fee_delete_student(int id, FormCollection collection) { try { // TODO: Add delete logic here using (DBmodel payrollentities = new DBmodel()) { StudentFee studentFee = payrollentities.StudentFees.Where(x => x.SalaryId == id).FirstOrDefault(); payrollentities.StudentFees.Remove(studentFee); payrollentities.SaveChanges(); } return(RedirectToAction("Fee_details_students")); } catch { return(View()); } }
public ActionResult AddFee(StudentFeeViewModel collection) { DBSmartSchoolWebPortalEntities111 db = new DBSmartSchoolWebPortalEntities111(); var student = db.Students.Where(x => x.RegisterationNumber == collection.StudentId).First(); StudentFee fee = new StudentFee(); fee.StudentId = student.Id; fee.Amount = collection.Amount; fee.Date = collection.Date; fee.Status = "UnPaid"; db.StudentFees.Add(fee); db.SaveChanges(); string message = "Student fee Added!"; return(RedirectToAction("Account", "Management", new { Message = message })); }
// GET: StudentFees/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StudentFee studentFee = db.StudentFees.Find(id); if (studentFee == null) { return(HttpNotFound()); } ViewBag.InventoryID = new SelectList(db.Inventories, "InventoryID", "Product_Name", studentFee.InventoryID); ViewBag.MembershipID = new SelectList(db.MembershipTypes, "MembershipID", "Membership_Name", studentFee.MembershipID); ViewBag.StudentID = new SelectList(db.Students, "StudentID", "StudentName", studentFee.StudentID); ViewBag.TestID = new SelectList(db.TestFees, "TestID", "TestID", studentFee.TestID); return(View(studentFee)); }
public void UpdateStudentFee(StudentFee studentfee) { var query = "UPDATE Student_Fee SET Total_Fee = @total_fee , Remaining_Dues = @remaining_dues , Fine = @fine , Transport_Dues = @transport_dues , Due_Date = @due_date , Last_Date = @last_date , Where Student_Id = @student_id "; List <SqlParameter> parameters = new List <SqlParameter> { new SqlParameter() { ParameterName = "@student_id", Value = studentfee.StudentId }, new SqlParameter() { ParameterName = "@total_fee", Value = studentfee.TotalFee }, new SqlParameter() { ParameterName = "@remaining_dues", Value = studentfee.RemainingDues }, new SqlParameter() { ParameterName = "@fine", Value = studentfee.Fine }, new SqlParameter() { ParameterName = "@transport_dues", Value = studentfee.TransportDues }, new SqlParameter() { ParameterName = "@due_date", Value = studentfee.DueDate }, new SqlParameter() { ParameterName = "@last_date", Value = studentfee.LastDate }, }; _dbClient.InvokeParameters(query, parameters); }
public StudentFee GetStudentFee(StudentFee studentFee) { var query = "SELECT * FROM Student_Fee WHERE StudentId ='" + studentFee.StudentId + "'"; _dbClient.InvokeDataReader(query, data => { if (data != null && data.Rows.Count > 0) { studentFee.TotalFee = data.Rows[0].Field <System.Int32>("Total_Fee"); studentFee.RemainingDues = data.Rows[0].Field <System.Int32>("Remaining_Dues"); studentFee.Fine = data.Rows[0].Field <System.Int32>("Fine"); studentFee.TransportDues = data.Rows[0].Field <System.Int32>("Transport_Dues"); studentFee.DueDate = data.Rows[0].Field <System.DateTime>("Due_Date"); studentFee.LastDate = data.Rows[0].Field <System.DateTime>("Last_Date"); studentFee.TransportDues = data.Rows[0].Field <System.Int32>("Transport_Dues"); } }); return(studentFee); }
public static StudentFee GetAllCurrentStatusForSpecificStudent(string studentId) { string connectionString = DataManager.OraConnString(); SqlConnection sqlCon = new SqlConnection(connectionString); try { sqlCon.Open(); string selectQuery = @"SELECT [f_name]+' '+[m_name]+' '+[l_name] As Student_Name ,(SELECT RTRIM(LTRIM(Replace([class_id],' ',''))) FROM dbo.std_current_status WHERE [student_id]=[student_id]) AS Class_Name ,(SELECT [class_year] FROM dbo.std_current_status WHERE [student_id]=[student_id]) AS Class_year ,(SELECT [sect] FROM dbo.std_current_status WHERE [student_id]=[student_id]) AS Class_Section ,(SELECT [std_roll] FROM dbo.std_current_status WHERE [student_id]=[student_id]) AS Class_Roll FROM [student_info] where [student_id]='" + studentId + "'"; SqlCommand cmd = new SqlCommand(selectQuery, sqlCon); SqlDataReader reader = cmd.ExecuteReader(); StudentFee aStudentFeeObj = new StudentFee(); if (reader.HasRows) { while (reader.Read()) { aStudentFeeObj.Name = reader[0].ToString(); aStudentFeeObj.ClassId = reader[1].ToString(); aStudentFeeObj.ClassYear = reader[2].ToString(); aStudentFeeObj.Sect = reader[3].ToString(); aStudentFeeObj.Roll = reader[4].ToString(); } } return(aStudentFeeObj); } catch (Exception ex) { throw new Exception(ex.Message); } finally { if (sqlCon.State == ConnectionState.Open) { sqlCon.Close(); } } }
public ActionResult ManageStudent(FeeModels item) { StudentFee temp = new StudentFee(); temp.StudentId = item.StudentId; temp.CourseId = item.CourseId; if (item.isPaid) { temp.IsPaid = 1; } else { temp.IsPaid = 0; } temp.PaymentDate = item.PaymentDate; db.StudentFees.Add(temp); db.SaveChanges(); return(RedirectToAction("ManageStudent")); }
public void Add(StudentFee obj) { var result = _interface.Add(obj); _interface.SaveChanges(); }
public StudentFeeUC() { InitializeComponent(); _studentFee = new StudentFee(); _studentFeeService = new StudentFeesService(); }