public ActionResult StudentReport(DateTime fromdate, DateTime todate, Stu_rec sturec) { //dynamic expando = new ExpandoObject(); //var marksModel = expando as IDictionary<string, object>; List <Stu_rec> sturecord = new List <Stu_rec>(); var receiptdetail = from Recipt_Details in db.Recipt_Details join tblstudentdata in db.tblstudentdata on Recipt_Details.RollNo equals tblstudentdata.rollno join Course in db.Courses on Recipt_Details.CourseId equals Course.CourseId where tblstudentdata.Status == true && Recipt_Details.Date >= fromdate && Recipt_Details.Date <= todate select new { ID = Recipt_Details.Id, Recipt_Details.RollNo, Recipt_Details.Amount, Recipt_Details.Date, Recipt_Details.ReciptNo, Course.CourseName, tblstudentdata.name, }; foreach (var item in receiptdetail) { sturecord.Add(new Stu_rec() { id = item.ID, name = item.name, RollNo = item.RollNo, Amount = item.Amount, CourseName = item.CourseName, Date = item.Date, ReciptNo = item.ReciptNo }); } return(View(sturecord)); }
public ActionResult TotalReport(DateTime fromdate, DateTime todate, Stu_rec sturec) { //string a = User.IsInRole("Franchisee") ? help.Franchisee() : help.Receptionist(); ////dynamic expando = new ExpandoObject(); ////var marksModel = expando as IDictionary<string, object>; //List<Stu_rec> sturecord = new List<Stu_rec>(); //var receiptdetail = from Recipt_Details in db.Recipt_Details.Where(x => x.franchid == a) // join tblstudentdata in db.tblstudentdata.Where(x => x.uid == a) on Recipt_Details.RollNo equals tblstudentdata.rollno // join Course in db.Courses.Where(x => x.franchid == a) on Recipt_Details.CourseId equals Course.CourseId // where tblstudentdata.Status == true && Recipt_Details.Date >= fromdate && Recipt_Details.Date <= todate // select new // { // ID = Recipt_Details.Id, // Recipt_Details.RollNo, // Recipt_Details.Amount, // Recipt_Details.Date, // Recipt_Details.ReciptNo, // Course.CourseName, // tblstudentdata.name, // }; //foreach (var item in receiptdetail) //{ // sturecord.Add(new Stu_rec() // { // id = item.ID, // name = item.name, // RollNo = item.RollNo, // Amount = item.Amount, // CourseName = item.CourseName, // Date = item.Date, // ReciptNo = item.ReciptNo // }); //} return(View(db.tblstudentdata.Where(x => x.Status == true && x.date >= fromdate && x.date <= todate).OrderBy(x => x.date))); }