TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Prakash
NA
258
78.5k
mvc
May 22 2015 4:38 AM
hello this is the piece code (below) i want to calculate progress of chapter and subject...in this code use random method...but i want do manual...plz help..and give me sample code if possible....
thank u
public ActionResult GetSubjectProgress(string id)
{
Guid stdid = new Guid(id);
var subjects = from s in db.Subjects
where s.Standard == stdid
select s;
List<SubjectProgress> subjectPropgress = new List<SubjectProgress>();
Random rnd = new Random();
foreach (Subject s in subjects)
{
SubjectProgress subProg = new SubjectProgress();
subProg.id = s.Id;
subProg.name = s.Name;
subProg.chapters = new List<ChapterProgress>();
foreach (Chapter c in s.Chapters)
{
ChapterProgress chptProg = new ChapterProgress();
chptProg.id = c.Id;
chptProg.name = c.Name;
chptProg.progress = rnd.Next(1, 100);
subProg.chapters.Add(chptProg);
}
subProg.progress = rnd.Next(1, 100);
subjectPropgress.Add(subProg);
}
return View(subjectPropgress);
}
Reply
Answers (
5
)
How to Work Dropdownlist when disabled JavaScript of browse
How to access client side scanner from server?