public static List<FieldProperties> FieldsFrom(string className) { try { List<FieldProperties> listFieldProperties = new List<FieldProperties>(); ClassDetails clDetails = new ClassDetails(className); IReflectField[] fields = clDetails.GetFieldList(); if (fields == null) { return null; } foreach (IReflectField field in clDetails.GetFieldList()) { if (!(field is GenericVirtualField || field.IsStatic())) { FieldProperties fp = FieldPropertiesFor(className, field); listFieldProperties.Add(fp); } } return listFieldProperties; } catch (Exception oEx) { LoggingHelper.HandleException(oEx); return null; } }
public ActionResult Add() { int school_id = SessionHandler.GetSchoolID(); ParentDetails _pd = new ParentDetails(); ClassDetails _cd = new ClassDetails(); ViewBag.parents = _pd.GetAll(school_id); ViewBag.classes = _cd.GetAll(school_id); return View(); }
public ActionResult ExamMarks(int class_id = 0, int subject_id = 0) { int school_id = SessionHandler.GetSchoolID(); var exam_types = _ed.GetAll(school_id).ToList(); if (school_id != 0 && class_id != 0 && subject_id != 0) { var rests = _ed.FindOnCondition(school_id,class_id, subject_id); if (rests.ToList().Count == 0 || exam_types.Count != rests.ToList().Count) { foreach (var exam in exam_types) { if (rests.ToList().Count == 0) { _ed.InsertSubjectExam(school_id, subject_id, exam.exam_id, class_id, 1); } else { foreach (var se in rests) { if (se.exam_id == exam.exam_id && se.subject_id == subject_id && class_id == se.class_id) continue; _ed.InsertSubjectExam(school_id, subject_id, exam.exam_id, class_id, 1); } } } } ViewBag.class_id = class_id; ViewBag.subject_id = subject_id; SubjectDetails sbs = new SubjectDetails(); ClassDetails clss = new ClassDetails(); ViewBag.subjects = sbs.GetAll(school_id).ToList().ToJSON(); ViewBag.classes = clss.GetAll(school_id); var rest = _ed.FindOnCondition(school_id, class_id, subject_id); return View(rest); } else { SubjectDetails sbs = new SubjectDetails(); ClassDetails clss = new ClassDetails(); ViewBag.subjects = sbs.GetAll(school_id).ToList().ToJSON(); ViewBag.classes = clss.GetAll(school_id); return View(); } }
/// <summary> /// Chrome's message-loop Window isn't created synchronously, so this may not find it. /// If so, you need to wait and try again later. /// </summary> public static bool TryFindHandle(IntPtr browserHandle, out IntPtr chromeWidgetHostHandle) { var classDetails = new ClassDetails(); var gcHandle = GCHandle.Alloc(classDetails); var childProc = new EnumWindowProc(EnumWindow); EnumChildWindows(browserHandle, childProc, GCHandle.ToIntPtr(gcHandle)); chromeWidgetHostHandle = classDetails.DescendantFound; gcHandle.Free(); return classDetails.DescendantFound != IntPtr.Zero; }
// // GET: /Parent/ public ActionResult Index() { if (Session[Configuration.SESSION_USER_ID] == null) { return RedirectToAction("Index", "Login"); } int school_id = SchoolID(); TeacherDetail _td = new TeacherDetail(); ViewBag.teachers_list = _td.GetAll(school_id); ClassDetails _cd = new ClassDetails(); ViewBag.classes_list = _cd.GetAll(school_id); var result = _sd.GetAll(school_id).ToList(); return View(result); }
public ActionResult StudentFee(int class_id=0,int exam_id = 0) { if (Session[Configuration.SESSION_USER_ID] == null) { return RedirectToAction("Index", "Login"); } int school_id = SessionHandler.GetSchoolID(); ExamDetails _ed = new ExamDetails(); ClassDetails _cd = new ClassDetails(); ViewBag.exams = _ed.GetAll(school_id).ToList(); ViewBag.classes = _cd.GetAll(school_id).ToList(); if (school_id != 0 && class_id != 0 && exam_id != 0) { StudentDetails _sd = new StudentDetails(); var stds = _sd.GetAll(school_id,class_id); //if (stds.ToList().Count == 0 || exam_types.Count != rests.ToList().Count) //{ // foreach (var exam in exam_types) // { // if (rests.ToList().Count == 0) // { // _ed.InsertSubjectExam(school_id, subject_id, exam.exam_id, class_id, 1); // } // else // { // foreach (var se in rests) // { // if (se.exam_id == exam.exam_id && se.subject_id == subject_id && class_id == se.class_id) // continue; // _ed.InsertSubjectExam(school_id, subject_id, exam.exam_id, class_id, 1); // } // } // } //} } return View(); }
public static IEnumerable<Student> GetClassStudent(int school_id, int class_id) { var classes = new ClassDetails().GetAll(school_id); var length = classes.Count(); string cls_ids = "("; int i = 0; foreach (var cls in classes) { cls_ids += cls.class_id; if ((i + 1) != length) { cls_ids += ","; } i++; } cls_ids += ")"; int indexOfComma = cls_ids.LastIndexOf(','); var _sd = new StudentDetails().GetAll(school_id, cls_ids); return _sd; }
public async Task <IActionResult> OnGet() { OtfUser otfUser = HttpContext.GetSignedInOtfUser(); IEnumerable <ClassSummary> summaries = await _api.GetClassSummariesAsync(otfUser.MemberId, otfUser.SignInJwt); summaries = summaries.OrderByDescending(s => s.ClassTime); List <KeyValuePair <ClassSummary, ClassDetails> > details = new List <KeyValuePair <ClassSummary, ClassDetails> >(); foreach (ClassSummary summary in summaries) { ClassDetails detail = await _api.GetClassDetailsAsync(summary.ClassHistoryUuid.ToString(), otfUser.MemberId, otfUser.SignInJwt); details.Add(new KeyValuePair <ClassSummary, ClassDetails>(summary, detail)); } GeneratePointsTrend(details); GenerateClassesTrend(summaries); GenerateHeartRateTrend(details); return(Page()); }
public static ArrayList FieldsFrom(string className) { try { ArrayList listFieldProperties = new ArrayList(); ClassDetails clDetails = new ClassDetails(className); foreach (IReflectField field in clDetails.GetFieldList()) { if (!(field is GenericVirtualField)) { FieldProperties fp = FieldPropertiesFor(className, field); listFieldProperties.Add(fp); } } return(listFieldProperties); } catch (Exception oEx) { LoggingHelper.HandleException(oEx); return(null); } }
protected FeedDetailsExportModel(Person person, string schoolName, string sy, DateTime nowSchoolTime, DateTime?startRange, DateTime?endRange, AnnouncementDetails ann , ClassDetails classDetails, IList <DayType> dayTypes, IList <Staff> staffs, Standard standard, AnnouncementAssignedAttribute attribute, Person student, int studentOrder) : base(person, schoolName, sy, nowSchoolTime, startRange, endRange, classDetails, dayTypes, staffs, ann, standard) { AnnouncementDescription = ann.Content; HasAttributes = ann.AnnouncementAttributes.Count > 0; IsLessonPlan = ann.LessonPlanData != null; IsSupplemental = ann.SupplementalAnnouncementData != null; if (ann.ClassAnnouncementData != null) { TotalPoint = (double?)ann.ClassAnnouncementData.MaxScore ?? ClassAnnouncement.DEFAULT_MAX_SCORE; WeightAddition = (double?)ann.ClassAnnouncementData.WeightAddition ?? ClassAnnouncement.DEFAULT_WEIGHT_ADDITION; WeigntMultiplier = (double?)ann.ClassAnnouncementData.WeightMultiplier ?? ClassAnnouncement.DEFAULT_WEGIHT_MULTIPLIER; ShowScoreSettings = CanShowScoreSettings(ann.ClassAnnouncementData); } if (IsSupplemental && student != null) { StudentId = student.Id; StudentDisplayName = student.FirstName + " " + student.LastName; StudentOrder = studentOrder; } if (standard != null) { StandardId = standard.Id; StandardName = standard.Name; StandardDescription = standard.Description; } if (attribute != null) { AttributeId = attribute.Id; AttributeName = attribute.Name; AttributeDescription = attribute.Text; if (attribute.Attachment != null) { AttributeAttachmentName = attribute.Attachment.Name; } } }
/// <summary> /// Renumber each unit as directed. /// </summary> /// <param name="classFileConfiguration">Class file contents</param> /// <param name="classId">id of the class</param> /// <param name="initialNumber">the first number to change</param> /// <param name="initialSubclass">location of the first number</param> /// <param name="destinationNumber">the first destination number</param> /// <param name="destinationSubclass">location of the destination number</param> /// <param name="numberToChange">number of numbers to change</param> public static void Renumber( ClassDetails classFileConfiguration, string classId, int initialNumber, string initialSubclass, int destinationNumber, string destinationSubclass, int numberToChange) { List <int> originalNumbers = new List <int>(); Subclass subclass = classFileConfiguration.Subclasses.Find( s => string.Compare(s.Type, initialSubclass) == 0); Subclass newSubclass = classFileConfiguration.Subclasses.Find( s => string.Compare(s.Type, destinationSubclass) == 0); if (subclass == null || destinationSubclass == null) { return; } originalNumbers = RenumberFactory.GetOriginalNumbers( classFileConfiguration, initialNumber, subclass, numberToChange); RenumberFactory.RenumberUnits( subclass, newSubclass, originalNumbers, classId, destinationNumber); }
public static IEnumerable AutoAutoAssertion1(String MultipleDataSetName) { String[] DataSetNames = MultipleDataSetName.Split(','); for (int j = 0; j < DataSetNames.Length; j++) { String DataSetName = DataSetNames[j]; MongoDbConnection mongoDbConnection = new MongoDbConnection(); //ClassDetails classDetails = mongoDbConnection.getClassDetails(DataSetName); ClassDetails classDetails = MyDataClass.getClassDetails(DataSetName); //Dictionary<String, Object> reqNames = mongoDbConnection.getRequestData(DataSetName, "Request"); Dictionary <String, Object> reqNames = MyDataClass.getRequestNames(DataSetName); //Dictionary<String, Object> respNames = mongoDbConnection.getRequestData(DataSetName, "Response"); Dictionary <String, Object> respNames = MyDataClass.getResponseNames(DataSetName); int dataSets = 0; int arguments = 0; dataSets = CalculateDataSetParams(reqNames, ref arguments); for (int i = 1; i < dataSets + 1; i++) { //TODO create testcases objects using reflection if (arguments == 1) { yield return(new TestCaseData(classDetails, reqNames["Request" + i + "1"]).Returns(respNames["Response" + i])); } else if (arguments == 2) { yield return(new TestCaseData(classDetails, reqNames["Request" + i + "1"], reqNames["Request" + i + "2"]).Returns(respNames["Response" + i])); } else if (arguments == 3) { yield return(new TestCaseData(classDetails, reqNames["Request" + i + "1"], reqNames["Request" + i + "2"], reqNames["Request" + i + "3"]).Returns(respNames["Response" + i])); } } } }
public ActionResult StudentFee(int student_id=0, int class_id=0) { int school_id = SessionHandler.GetSchoolID(); var session_id = SessionHandler.GetSchoolSessionID(); var classes = Utils.GetClasses(school_id); var _sd = Utils.GetClassStudent(school_id, class_id); var sds = (from s in _sd select new { fullname = s.first_name + " " + s.last_name, id = s.user_id,class_id= s.class_id }).ToList().ToJSON(); ViewBag.classes = classes; ViewBag.student_id = student_id; ViewBag.class_id = class_id; ViewBag.students = sds; if(student_id != 0 && class_id != 0) { ViewBag.isSelected = true; var fees = new StudentFeeDetails().GetAll(school_id, student_id, class_id); var std_itself = new StudentDetails().FindSingle(student_id, school_id); var parent = new ParentDetails().FindSingle(std_itself.parent_id, school_id); var cls = new ClassDetails().FindSingle(std_itself.class_id, school_id); std_itself.parent_name = parent.full_name; std_itself.class_name = cls.name; ViewBag.student = std_itself; var add_fee = (from f in fees where f.type == FeeType.EXAMINATION_FEE || f.type == FeeType.ADMISSION_FEE || f.type == FeeType.OTHER_CHARGES select f).ToList(); var monthly_fee = (from f in fees where f.type == FeeType.MONTHLY_FEE select f).ToList(); foreach (var f in add_fee) { if (f.type == FeeType.ADMISSION_FEE) f.fee = std_itself.admission_fee; if (f.type == FeeType.EXAMINATION_FEE) f.fee = std_itself.examination_fee; if (f.type == FeeType.OTHER_CHARGES) f.fee = std_itself.other_charges; } var total = 0; foreach (var f in fees) { f.fee = std_itself.monthly_fee; if (f.paid_status == FeePaidStatus.PAID) { total += f.fee; } } //to find the discount amount int discount = (int)(from std in _sd where std.user_id == student_id select std.discount).FirstOrDefault(); ViewBag.total = total - discount; ViewBag.discount = discount; ViewBag.add_fee = add_fee; return View("StudentFee", monthly_fee); } return View("StudentFee"); }
public async Task <IActionResult> GetClassDetails(int id) { ClassDetails result = await _classGateway.GetDetails(id); return(Ok(result)); }
protected ClassPanoramaViewData(ClassDetails cClass) : base(cClass) { }
public static void SetIndexedConfiguration(ArrayList fieldname, string className, ArrayList isIndexed, string dbPath,bool customConfig) { ClassDetails classDetails = new ClassDetails(className); classDetails.SetIndex(fieldname, className, isIndexed, dbPath, customConfig ); }
protected ClassExpolorerViewData(ClassDetails classComplex) : base(classComplex) { }
protected ShortFeedExportModel(Person person, string schoolName, string sy, DateTime nowSchoolTime, DateTime?fromReport, DateTime?toReport, ClassDetails c, IList <DayType> dayTypes, IList <Staff> teachers , AnnouncementComplex announcement, Standard standard, int?standardNumber = null) : this(person, schoolName, sy, nowSchoolTime, fromReport, toReport) { if (c != null) { ClassId = c.Id; ClassName = c.Name; ClassNumber = c.ClassNumber; if (c.PrimaryTeacherRef.HasValue) { PersonFirstName = c.PrimaryTeacher.FirstName; PersonLastName = c.PrimaryTeacher.LastName; Owners = BuildTeachersNames(c.PrimaryTeacherRef.Value, c.ClassTeachers, teachers); } DayTypes = dayTypes.Where(x => c.ClassPeriods.Any(y => y.DayTypeRef == x.Id)) .Select(x => x.Name.ToString()) .Distinct() .JoinString(","); Periods = c.ClassPeriods.Select(x => x.Period.Name).Distinct().JoinString(","); } AnnouncementId = announcement.Id; AnnouncementName = announcement.Title; AnnouncementType = GetTypeName(announcement); CategoryName = GetCategoryName(announcement); Complete = announcement.Complete; HasStandards = announcement.StandardsCount > 0; HasAttachments = announcement.AttachmentNames.Count + announcement.ApplicationCount > 0; if (announcement.ClassAnnouncementData != null) { StartDate = null; EndDate = announcement.ClassAnnouncementData.Expires; IsHidden = !announcement.ClassAnnouncementData.VisibleForStudent; TotalPoint = (double?)announcement.ClassAnnouncementData.MaxScore; } if (announcement.LessonPlanData != null) { StartDate = announcement.LessonPlanData.StartDate; EndDate = announcement.LessonPlanData.EndDate; IsHidden = !announcement.LessonPlanData.VisibleForStudent; } if (announcement.SupplementalAnnouncementData != null) { StartDate = null; EndDate = announcement.SupplementalAnnouncementData.Expires; IsHidden = !announcement.SupplementalAnnouncementData.VisibleForStudent; } var adminAnn = announcement.AdminAnnouncementData; if (adminAnn != null) { //TODO: Add to model first and last admin name string adminFirstName = null, adminLastName = null; if (adminAnn.AdminName != null) { string[] words = adminAnn.AdminName.Split(new [] { ' ' }, StringSplitOptions.RemoveEmptyEntries); adminFirstName = words[0]; if (words.Count() > 1) { adminLastName = words[1]; } } EndDate = adminAnn.Expires; IsAdminAnnouncement = true; Owners = NameHelper.FullName(adminFirstName ?? "", adminLastName ?? "", "", false, adminAnn.AdminGender); PersonFirstName = adminLastName; PersonLastName = adminLastName; AdminId = announcement.AdminRef; } if (standard != null) { StandardId = standard.Id; StandardName = standard.Name; StandardNumber = standardNumber; } }
public void SetSkillsAndSavingThrows() { // SKILLS var Intelligence = (int)AbilityScores.getAbilityScoreModifier(AbilityScores.GetIntelligenceScore()); var Strength = (int)AbilityScores.getAbilityScoreModifier(AbilityScores.GetStrengthScore()); var Constitution = (int)AbilityScores.getAbilityScoreModifier(AbilityScores.GetConstitutionScore()); var Dexterity = (int)AbilityScores.getAbilityScoreModifier(AbilityScores.GetDexterityScore()); var Wisdom = (int)AbilityScores.getAbilityScoreModifier(AbilityScores.GetWisdomScore()); var Charisma = (int)AbilityScores.getAbilityScoreModifier(AbilityScores.GetCharismaScore()); var skillAndMods = new Dictionary <string, int>(); skillAndMods["athletics"] = Strength; skillAndMods["acrobatics"] = Dexterity; skillAndMods["sleightOfHand"] = Dexterity; skillAndMods["arcana"] = Intelligence; skillAndMods["stealth"] = Dexterity; skillAndMods["history"] = Intelligence; skillAndMods["nature"] = Intelligence; skillAndMods["religion"] = Intelligence; skillAndMods["animalHandling"] = Wisdom; skillAndMods["insight"] = Wisdom; skillAndMods["medicine"] = Wisdom; skillAndMods["perception"] = Wisdom; skillAndMods["survival"] = Wisdom; skillAndMods["deception"] = Charisma; skillAndMods["intimidation"] = Charisma; skillAndMods["investigation"] = Intelligence; skillAndMods["performance"] = Charisma; skillAndMods["persuasion"] = Charisma; // Add prof bonus var profBonuses = ClassDetails.GetProficiencies()["Skills"]; foreach (var skill in profBonuses) { if (skillAndMods.ContainsKey(skill)) { skillAndMods[skill] += ClassDetails.GetProficiencyBonus(); } } Skills = skillAndMods; // SAVING THROWS var savingThrowProfs = ClassDetails.GetProficiencies()["Saving Throws"]; var savingThrows = new Dictionary <string, int>() { { "Strength", Strength }, { "Dexterity", Dexterity }, { "Constitution", Constitution }, { "Intelligence", Intelligence }, { "Wisdom", Wisdom }, { "Charisma", Charisma } }; foreach (var savingThrow in savingThrowProfs) { if (skillAndMods.ContainsKey(savingThrow)) { savingThrows[savingThrow] += ClassDetails.GetProficiencyBonus(); } } SavingThrows = savingThrows; }
public ActionResult StudentMarks(int class_id = 0, int subject_id = 0, int exam_id = 0) { int school_id = SessionHandler.GetSchoolID(); int user_id = SessionHandler.GetUserID(); SubjectDetails sbs = new SubjectDetails(); ClassDetails clss = new ClassDetails(); ViewBag.subjects = sbs.GetAll(school_id).ToList().ToJSON(); ViewBag.classes = clss.GetAll(school_id); ViewBag.exams = _ed.GetAll(school_id).ToList(); if (school_id != 0 && class_id != 0 && subject_id != 0 && exam_id != 0) { StudentDetails stds = new StudentDetails(); var stnds_result = stds.GetAll(school_id, class_id).ToList(); var rests = _ed.FindMarksOnCondition(school_id, class_id, subject_id, exam_id); if (rests.ToList().Count == 0 || stnds_result.Count != rests.ToList().Count) { foreach (var std in stnds_result) { if (rests.ToList().Count == 0) { _ed.InsertSubjectMarks(school_id, subject_id, exam_id, class_id, std.user_id, user_id); } else { bool isExisted = false; foreach (var se in rests) { if (se.exam_id == exam_id && se.subject_id == subject_id && class_id == se.class_id && se.student_id == std.user_id) isExisted = true; } if (!isExisted) { _ed.InsertSubjectMarks(school_id, subject_id, exam_id, class_id, std.user_id, user_id); } } } } ViewBag.class_id = class_id; ViewBag.subject_id = subject_id; var rest = _ed.FindMarksOnCondition(school_id, class_id, subject_id, exam_id); return View(rest); } return View(); }
public bool Update(ClassDetails objClass) { return(classDetails.Update(objClass)); }
public static int NoOfObjectsforAClass(string classname) { ClassDetails db = new ClassDetails(classname); return(db.GetNumberOfObjects()); }
public static IEnumerable<Class> GetClasses(int school_id) { var classes = new ClassDetails().GetAll(school_id); return classes; }
public static Hashtable FetchStoredFields(string classname) { ClassDetails clsDetails = new ClassDetails(classname); return clsDetails.GetFields(); }
public ClassViewModel(ClassDetails type, TreeViewItemViewModel parent) : base(type, parent) { }
public void Put(int id, ClassDetails classDetails) { }
public ActionResult MarkClass(int class_id = 0, string date = "") { if (Session[Configuration.SESSION_USER_ID] == null) { return RedirectToAction("Index", "Login"); } ClassDetails _cd = new ClassDetails(); int school_id = SessionHandler.GetSchoolID(); ViewBag.class_id = class_id; ViewBag.date = date; ViewBag.classes = _cd.GetAll(school_id); ViewBag.Days = 0; if (class_id != 0) { var result = _ad.GetAll(school_id, class_id).ToList(); var _sd = new StudentDetails(); var stds = _sd.GetAll(school_id, class_id); var adResult = _ad.GetAll(school_id, class_id, date).ToList(); //int daysInMonth = this.GetDaysInMonth(date); ViewBag.Days = 1; var day = date.GetDayOfMonth(); List<StudentOneDay> attendance = new List<StudentOneDay>(); foreach (var std in stds) { StudentOneDay stdAttnd = new StudentOneDay() { student_name = std.first_name + " " + std.last_name, student_id = std.user_id, status = -1 }; attendance.Add(stdAttnd); var isExsited = false; foreach (var adr in adResult) { if (std.user_id == adr.student_id) { isExsited = true; } } if (!isExsited) { Attendance atd = new Attendance() { student_id = std.user_id, school_id = SessionHandler.GetSchoolID(), status = -1, class_id = class_id, date = date, updated_by = SessionHandler.GetUserID() }; _ad.Insert(atd); } } return View(attendance); } return View(); }
private void BuildClass(FormattedStringBuilder formattedStringBuilder, ClassDetails classDefinition) { classStringBuilderSettings.ClassGenerationTemplate.Generate(formattedStringBuilder, classDefinition.ClassName, classDefinition.Visibility, classStringBuilderSettings.MemberGenerationTemple, classDefinition.Members); }
public static int GetFieldCount(string classname) { ClassDetails clsDetails = new ClassDetails(classname); return clsDetails.GetFieldCount(); }
public static int GetFieldCount(string classname) { ClassDetails clsDetails = new ClassDetails(classname); return(clsDetails.GetFieldCount()); }
public static ClassPeriodViewData Create(ClassPeriod classPeriod, ClassDetails classComplex, Room room) { return(new ClassPeriodViewData(classPeriod, room, classComplex)); }
public ActionResult ViewClass(int class_id = 0, string date = "") { ClassDetails _cd = new ClassDetails(); int school_id = SessionHandler.GetSchoolID(); ViewBag.classes = _cd.GetAll(school_id); ViewBag.Days = 0; ViewBag.class_id = class_id; ViewBag.date = date; if (class_id != 0 && date != "") { string startDate = ""; string endDate = ""; date.makeDateString(ref startDate, ref endDate); int daysInMonth = date.GetDaysInMonth(); var result = _ad.GetAll(school_id, class_id, startDate, endDate).ToList(); var _sd = new StudentDetails(); var stds = _sd.GetAll(school_id, class_id); ViewBag.Days = daysInMonth; List<StudentAttendance> attendance = new List<StudentAttendance>(); foreach (var std in stds) { StudentAttendance stdAttnd = new StudentAttendance() { student_name = std.first_name + " " + std.last_name, student_id = std.user_id }; for (int x = 1; x <= daysInMonth; x++) { PresentStatus _ps = new PresentStatus() { dayOfMonth = x, status = -1 }; foreach (var atnd in result) { int dayInAtnd = atnd.date.GetDayOfMonth(); if (atnd.student_id == std.user_id && x == dayInAtnd) { _ps.status = atnd.status; break; } } stdAttnd.AttendanceDays.Add(_ps); } attendance.Add(stdAttnd); } return View(attendance); } return View(); }
public int GetObjectCountForAClass(string classname) { ClassDetails classDetails = new ClassDetails(classname); return(classDetails.GetNumberOfObjects()); }
public static ClassViewData Create(ClassDetails classComplex) { return(new ClassViewData(classComplex)); }
public static ClassInfoViewData Create(ClassDetails cClass, Room roomInfo, ChalkableDepartment department) { return(new ClassInfoViewData(cClass, roomInfo, department)); }
private static IList <FeedDetailsExportModel> CreateGroupOfItems(Person person, string schoolName, string sy, DateTime nowSchoolTime , DateTime?startRange, DateTime?endRange, IList <AnnouncementDetails> anns, ClassDetails classDetails, IList <DayType> dayTypes , IList <Staff> staffs, IList <Application> apps, IDictionary <Guid, byte[]> appsImages) { var items = (from a in anns from sa in a.AnnouncementStandards.DefaultIfEmpty() from aa in a.AnnouncementAttributes.DefaultIfEmpty() from attItem in PrepareAttachmentItems(a.AnnouncementAttachments, a.AnnouncementApplications, apps, appsImages).DefaultIfEmpty() from recipient in (PrepareOrderedStudents(a)).DefaultIfEmpty() select Create(person, schoolName, sy, nowSchoolTime, startRange, endRange, a, classDetails, dayTypes, staffs, sa?.Standard, aa, attItem, recipient?.First, recipient?.Second ?? 0)).ToList(); return(items); }
public ActionResult Edit(int id, StudentModelView student) { int school_id = SessionHandler.GetUserID(); var result = _sd.FindSingle(id, school_id); ParentDetails _pd = new ParentDetails(); ClassDetails _cd = new ClassDetails(); ViewBag.parents = _pd.GetAll(school_id); ViewBag.classes = _cd.GetAll(school_id); return View(result); }
private static IList <ShortFeedExportModel> BuildClassItems(Person person, string schoolName, string sy, DateTime nowTime, DateTime?fromReport, DateTime?toReport, ClassDetails @class, IList <DayType> dayTypes, IList <Staff> staffs, IList <AnnouncementDetails> announcements, Standard standard, int?standardNumber = null) { var res = new List <ShortFeedExportModel>(); if (announcements.Count == 0) { return(res); } announcements = announcements.OrderBy(x => { if (x.ClassAnnouncementData != null) { return(x.ClassAnnouncementData.Expires); } if (x.SupplementalAnnouncementData != null) { return(x.SupplementalAnnouncementData.Expires); } return(x.LessonPlanData != null ? x.LessonPlanData.StartDate : x.Created); }).ToList(); res.AddRange(announcements.Select(a => new ShortFeedExportModel(person, schoolName, sy, nowTime, fromReport, toReport, @class, dayTypes, staffs, a, standard, standardNumber)).ToList()); return(res); }
public bool AddNew(ClassDetails objClass) { return(classDetails.AddNew(objClass)); }
public static Hashtable FetchStoredFields(string classname) { ClassDetails clsDetails = new ClassDetails(classname); return(clsDetails.GetFields()); }
public static int NoOfObjectsforAClass(string classname) { ClassDetails db = new ClassDetails(classname); return db.GetNumberOfObjects(); }
public void SetIndexedConfiguration(ArrayList fieldname, string className, ArrayList isIndexed, string dbPath, bool customConfig) { ClassDetails classDetails = new ClassDetails(className); classDetails.SetIndex(fieldname, className, isIndexed, dbPath, customConfig); }
public static StudentSummaryViewData Create(StudentSummaryInfo studentSummary, Room room, ClassDetails currentClass, IList <ClassDetails> classes , IList <StudentCustomAlertDetail> customAlerts, IList <StudentHealthCondition> healthConditions, IList <StudentHealthFormInfo> studentHealthForms, bool isStudent = false) { var res = new StudentSummaryViewData(studentSummary.StudentInfo, room, customAlerts, healthConditions, studentHealthForms) { ClassesSection = ClassViewData.Create(classes), AttendanceBox = StudentHoverBoxViewData <TotalAbsencesPerClassViewData> .Create(studentSummary.DailyAttendance, studentSummary.Attendances, classes), DisciplineBox = StudentHoverBoxViewData <DisciplineTypeSummaryViewData> .Create(studentSummary.InfractionSummaries, studentSummary.TotalDisciplineOccurrences), GradesBox = StudentHoverBoxViewData <StudentSummaryGradeViewData> .Create(studentSummary.StudentAnnouncements), RanksBox = studentSummary.ClassRank != null ? StudentHoverBoxViewData <StudentSummaryRankViewData> .Create(studentSummary.ClassRank) : null, CurrentClassName = NO_CLASS_SCHEDULED, }; if (currentClass != null) { res.CurrentClassName = currentClass.Name; } res.CurrentAttendanceLevel = studentSummary.CurrentAttendanceLevel; if (isStudent) { ClearAlertsForStudent(res); } return(res); }
public IHttpActionResult DownloadTemplate(int classID) { ClassDetails objClassDetails = _unitOfWork.ClassesDetails.SingleOrDefault(c => c.ClassID == classID); if (objClassDetails != null) { School objSchool = _unitOfWork.Schools.GetSchools().SingleOrDefault(s => s.schlID == objClassDetails.schlID); if (objSchool != null) { List <PerformanceCount> performanceCountList = new List <PerformanceCount>(); List <Student> lstStudent = _unitOfWork.Students.GetStudents().Where(s => s.ClassID == classID).ToList(); Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application(); // Create empty workbook excel.Workbooks.Add(); // Create Worksheet from active sheet Microsoft.Office.Interop.Excel._Worksheet workSheet = excel.ActiveSheet; // I created Application and Worksheet objects before try/catch, // so that i can close them in finnaly block. // It's IMPORTANT to release these COM objects!! try { int row = 2; // start row (in row 1 are header cells) workSheet.Cells[row, "A"] = objSchool.schlID; workSheet.Cells[row, "B"] = "School Name"; workSheet.Cells[row, "C"] = objSchool.schoolName; row = 3; workSheet.Cells[row, "A"] = objClassDetails.ClassID; workSheet.Cells[row, "B"] = "Class Name"; workSheet.Cells[row, "C"] = objClassDetails.classStandard.ToString() + "-" + objClassDetails.sectName; row = 4; // ------------------------------------------------ // Creation of header cells // ------------------------------------------------ workSheet.Cells[row, "A"] = "StudentID"; workSheet.Cells[row, "B"] = "Roll No"; workSheet.Cells[row, "C"] = "Name"; List <ParameterAttribute> lstParameterAttribute = _unitOfWork.ParameterAttributes.GetParameterAttributes().ToList(); string[] alphabets = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }; int indexOfAlphabet = 2; foreach (ParameterAttribute obj in lstParameterAttribute) { indexOfAlphabet++; if (indexOfAlphabet < 26) { workSheet.Cells[row, alphabets[indexOfAlphabet]] = obj.ParamName; } } //List<Car> cars = new List<Car>() //{ // new Car {Name = "Toyota", Color = "Red", MaximumSpeed = 195}, // new Car {Name = "Honda", Color = "Blue", MaximumSpeed = 224}, // new Car {Name = "Mazda", Color = "Green", MaximumSpeed = 205} //}; // ------------------------------------------------ // Populate sheet with some real data from "cars" list // ------------------------------------------------ indexOfAlphabet = 2; foreach (Student student in lstStudent) { workSheet.Cells[row, "A"] = student.studID; workSheet.Cells[row, "B"] = student.RollNo; workSheet.Cells[row, "C"] = student.studName; foreach (ParameterAttribute obj in lstParameterAttribute) { indexOfAlphabet++; if (indexOfAlphabet < 26) { workSheet.Cells[row, alphabets[indexOfAlphabet]] = true; //workSheet.Range[row.ToString() + alphabets[indexOfAlphabet]].DataValidation.AllowType = CellDataType.Decimal; //workSheet.Range[row.ToString() + alphabets[indexOfAlphabet]]. } } row++; } // Apply some predefined styles for data to look nicely :) workSheet.Range["A1"].AutoFormat(Microsoft.Office.Interop.Excel.XlRangeAutoFormat.xlRangeAutoFormat3DEffects1);//xlRangeAutoFormatClassic1 string fileName = "StudentPerformanceRecord_" + objSchool.schoolName + "_" + objClassDetails.classStandard.ToString() + "_" + objClassDetails.sectName + "_" + DateTime.UtcNow.ToString("yyyyMMddHHmmss") + ".xlsx"; // Define filename string filePath = HttpContext.Current.Server.MapPath("~/UploadFile/" + fileName); // Save this data as a file workSheet.SaveAs(fileName); // Display SUCCESS message } catch (Exception exception) { } finally { // Quit Excel application excel.Quit(); // Release COM objects (very important!) if (excel != null) { System.Runtime.InteropServices.Marshal.ReleaseComObject(excel); } if (workSheet != null) { System.Runtime.InteropServices.Marshal.ReleaseComObject(workSheet); } // Empty variables excel = null; workSheet = null; // Force garbage collector cleaning GC.Collect(); } } } return(Ok("/UploadFile/" + "ExcelData.xlsx")); }
protected ClassAlphaGradesViewData(ClassDetails classComplex) : base(classComplex) { }
// // GET: /Student/ public ActionResult Index() { int school_id =SessionHandler.GetSchoolID(); var students = _sd.GetAll(school_id); var parents = new ParentDetails().GetAll(school_id); var classes = new ClassDetails().GetAll(school_id); foreach(Student std in students) { foreach(Parent p in parents) { if(std.parent_id == p.user_id) { std.parent_name = p.full_name; } } foreach (Class c in classes) { if (std.class_id == c.class_id) { std.class_name = c.name; } } } return View(students); }
/// <summary> /// Initialises a new instance of the <see cref="ClassConfigViewModel"/> class. /// </summary> /// <param name="unitsIoController">units IO controller</param> /// <param name="unitsXmlIoController">units XML IO controller</param> /// <param name=")">individual units XML IO controller</param> /// <param name="classId">class id</param> public ClassConfigViewModel( UnitsIOController unitsIoController, UnitsXmlIOController unitsXmlIoController, string classId) { this.unitsIoController = unitsIoController; this.unitsXmlIoController = unitsXmlIoController; this.unsavedChanges = false; this.SubClassNumbers = new ObservableCollection <string>(); this.NumbersList = new ObservableCollection <int>(); this.Images = new ObservableCollection <IClassConfigImageSelectorViewModel>(); this.classId = classId; // If the file doesn't exist then leave m_classData, as initialised. if (this.unitsXmlIoController.DoesFileExist(this.classId)) { this.classFileConfiguration = this.unitsXmlIoController.Read( this.classId); this.formation = this.classFileConfiguration.Formation; this.alphaIdentifier = this.classFileConfiguration.AlphaId; this.year = this.classFileConfiguration.Year; foreach (Subclass subclass in this.classFileConfiguration.Subclasses) { this.SubClassNumbers.Add(subclass.Type); } if (this.SubClassNumbers.Count > 0) { this.subClassListIndex = 0; foreach (Number number in this.classFileConfiguration.Subclasses[this.SubClassListIndex].Numbers) { this.NumbersList.Add(number.CurrentNumber); } for (int imageIndex = 0; imageIndex < MaxImages; ++imageIndex) { string imageName = imageIndex < this.classFileConfiguration.Subclasses[this.SubClassListIndex].Images.Count ? this.classFileConfiguration.Subclasses[this.SubClassListIndex].Images[imageIndex].Name : string.Empty; IClassConfigImageSelectorViewModel selector = new ClassConfigImageSelectorViewModel( this.unitsIoController, imageName); selector.SelectionMadeEvent += this.UpdateImagesInModel; this.Images.Add(selector); } } else { this.subClassListIndex = -1; for (int imageIndex = 0; imageIndex < MaxImages; ++imageIndex) { IClassConfigImageSelectorViewModel selector = new ClassConfigImageSelectorViewModel( this.unitsIoController, string.Empty); selector.SelectionMadeEvent += this.UpdateImagesInModel; this.Images.Add(selector); } } } else { this.classFileConfiguration = new ClassDetails(); } this.CanSave = false; this.SaveCmd = new CommonCommand(this.SaveModel, () => true); this.CloseCmd = new CommonCommand(this.CloseWindow); this.AddNewSubClassCmd = new CommonCommand(this.AddNewSubClass, this.CanPerformAction); this.AddNewNumberCmd = new CommonCommand(this.AddNewNumber, this.CanPerformAction); this.AddNewNumberSeriesCmd = new CommonCommand(this.AddNewNumberSeries, this.CanPerformAction); this.RenumberCmd = new CommonCommand(this.Renumber, this.CanPerformAction); }
public static StudentInfoViewData Create(PersonDetails student, StudentDetailsInfo studentDetails, StudentSummaryInfo studentSummary, IList <ClassDetails> studentClasses, ClassDetails currentClass, Room currentRoom, int currentSchoolYearId) { var res = Create(student); res.DisplayName = studentDetails.DisplayName(includeMiddleName: true); var gradeLevels = student.StudentSchoolYears .OrderBy(x => x.SchoolYearRef) .Select(x => IdNameViewData <int> .Create(x.GradeLevelRef, x.GradeLevel.Name)) .ToList(); var currentStudentSchoolYear = student.StudentSchoolYears.FirstOrDefault(x => x.SchoolYearRef == currentSchoolYearId); if (currentStudentSchoolYear != null) { res.GradeLevel = gradeLevels.First(x => x.Id == currentStudentSchoolYear.GradeLevelRef); } res.IsHispanic = studentDetails.IsHispanic; res.HasMedicalAlert = studentDetails.HasMedicalAlert; res.IsAllowedInetAccess = studentDetails.IsAllowedInetAccess; res.SpecialInstructions = studentDetails.SpecialInstructions; res.SpEdStatus = studentDetails.SpEdStatus; res.IsIEPActive = studentDetails.IsIEPActive; res.IsTitle1Eligible = studentDetails.StudentSchool.IsTitle1Eligible; res.Section504 = !string.IsNullOrWhiteSpace(studentDetails.Section504Qualification) && studentDetails.Section504Qualification.Trim() != "NA"; res.IsHomeless = studentDetails.IsHomeless; res.IsImmigrant = studentDetails.IsImmigrant; res.Language = studentDetails.Language != null ? IdNameViewData <int> .Create(studentDetails.Language.Id, studentDetails.Language.Name) : null; res.Nationality = studentDetails.Country != null ? IdNameViewData <int> .Create(studentDetails.Country.Id, studentDetails.Country.Name) : null; res.Ethnicity = studentDetails.Ethnicity != null ? EthnicityViewData.Create(studentDetails.Ethnicity) : null; res.Lep = studentDetails.LimitedEnglishRef.HasValue; res.LimitedEnglishId = studentDetails.LimitedEnglishRef; res.IsForeignExchange = studentDetails.IsForeignExchange; res.StateIdNumber = studentDetails.StateIdNumber; res.AlternateStudentNumber = studentDetails.AltStudentNumber; res.StudentNumber = studentDetails.StudentNumber; res.OriginalEnrollmentDate = studentDetails.OriginalEnrollmentDate; res.IsRetained = student.StudentSchoolYears.First(x => x.SchoolYearRef == currentSchoolYearId).IsRetained; res.Counselor = studentDetails.Counselor != null ? ShortPersonViewData.Create(studentDetails.Counselor) : null; res.AttendanceBox = StudentHoverBoxViewData <TotalAbsencesPerClassViewData> .Create(studentSummary.DailyAttendance, studentSummary.Attendances, studentClasses); res.DisciplineBox = StudentHoverBoxViewData <DisciplineTypeSummaryViewData> .Create(studentSummary.InfractionSummaries, studentSummary.TotalDisciplineOccurrences); res.GradesBox = StudentHoverBoxViewData <StudentSummaryGradeViewData> .Create(studentSummary.StudentAnnouncements); res.CurrentAttandanceLevel = studentSummary.CurrentAttendanceLevel; res.CurrentClassName = NO_CLASS_SCHEDULED; if (currentClass != null) { res.CurrentClassName = currentClass.Name; } return(res); }
public ActionResult MineFee() { int school_id = SessionHandler.GetSchoolID(); int student_id = SessionHandler.GetUserID(); ViewBag.isSelected = true; var std_itself = new StudentDetails().FindSingle(student_id, school_id); var fees = new StudentFeeDetails().GetAll(school_id, student_id, std_itself.class_id); var parent = new ParentDetails().FindSingle(std_itself.parent_id, school_id); var cls = new ClassDetails().FindSingle(std_itself.class_id, school_id); std_itself.parent_name = parent.full_name; std_itself.class_name = cls.name; ViewBag.student = std_itself; var add_fee = (from f in fees where f.type == FeeType.EXAMINATION_FEE || f.type == FeeType.ADMISSION_FEE || f.type == FeeType.OTHER_CHARGES select f).ToList(); var total = 0; foreach (var f in add_fee) { if (f.type == FeeType.ADMISSION_FEE) f.fee = std_itself.admission_fee; if (f.type == FeeType.EXAMINATION_FEE) f.fee = std_itself.examination_fee; if (f.type == FeeType.OTHER_CHARGES) f.fee = std_itself.other_charges; if (f.paid_status == FeePaidStatus.PAID) total += f.fee; } var monthly_fee = (from f in fees where f.type == FeeType.MONTHLY_FEE select f).ToList(); foreach (var f in monthly_fee) { f.fee = std_itself.monthly_fee; if (f.paid_status == FeePaidStatus.PAID) { total += f.fee; } } //to find the discount amount int discount = std_itself.discount; ViewBag.total = total - discount; ViewBag.discount = discount; ViewBag.add_fee = add_fee; return View("MineFee", monthly_fee); }