Exemple #1
0
 //Constructor
 public Student(int id, string name, double gpa) //No default ctor. We have to fill it by assigning its variables
 {
     Id     = id;
     Name   = name;
     Gpa    = gpa;
     Status = StudentStatus.FullTime;
 }
Exemple #2
0
        public IList <StudentStatus> GetStudentStatusList(bool fetchActiveOnly = true)
        {
            var studentStatusList = new List <StudentStatus>();

            var sql = new StringBuilder();

            sql.Append("SELECT StudentStatusID, StudentStatus from StudentStatus ");
            if (fetchActiveOnly)
            {
                sql.Append(" WHERE Active = 'Y' ");
            }

            using (IDataReader reader = this.ExecuteReader(CommandType.Text, sql.ToString()))
            {
                while (reader.Read())
                {
                    int colIndex         = -1;
                    var newStudentStatus = new StudentStatus
                    {
                        StudentStatusId   = reader.GetInt32(++colIndex),
                        StudentStatusInfo = reader.GetString(++colIndex)
                    };
                    studentStatusList.Add(newStudentStatus);
                }
            }

            return(studentStatusList);
        }
Exemple #3
0
 public IHttpActionResult RemoveOldStudentStatus(StudentStatus oldstudentstatustoremove)
 {
     oldstudentstatustoremove.IsTerminated = true;
     unitOfWork.studentstatuses.Update(p => p.Id == oldstudentstatustoremove.Id, oldstudentstatustoremove);
     unitOfWork.Complete();
     return(Ok("Status Removed Successfully"));
 }
Exemple #4
0
 public Student()
 {
     this.CreateAt = DateTime.Now;
     this.UpdateAt = DateTime.Now;
     this.Gender   = Gender.Male;
     this.Status   = StudentStatus.Activated;
 }
        internal static void Test()
        {
            //Using the Enums
            StudentStatus status = (StudentStatus.Missing);

            Console.WriteLine(status.ToString());
            foreach (var item in Enum.GetNames(typeof(StudentStatus)))
            {
                Console.WriteLine(item);
            }

            Marks m1 = new Marks();

            m1.ShowDetails();
            Marks m2;

            m2.RollNo  = 1234;
            m2.Name    = "Ravivarma";
            m2.Kannada = 98;
            m2.English = 98;
            m2.Social  = 88;
            m2.Science = 78;
            m2.maths   = 69;
            m2.ShowDetails();
        }
Exemple #6
0
        } // end getTheStudent

        public StudentStatus getStudentStatus(string studentID)
        {
            using (SqlConnection conn = DBUltiity.getConnection)
            {
                string query = "SELECT Slot.studentID, name, slotNumber, Slot.roomID, dom FROM dbo.Student "
                               + "INNER JOIN dbo.Slot ON Slot.studentID = Student.studentID "
                               + "INNER JOIN dbo.Room ON Room.roomID = Slot.roomID WHERE Student.studentID=@studentID";

                SqlCommand cmd = new SqlCommand();
                cmd.Connection  = conn;
                cmd.CommandType = CommandType.Text;
                cmd.CommandText = query;
                cmd.Parameters.AddWithValue("@studentID", studentID);

                SqlDataAdapter da          = new SqlDataAdapter(cmd);
                DataTable      statusTable = new DataTable();
                da.Fill(statusTable);
                DataRow row        = statusTable.Rows[0];
                string  name       = row["name"].ToString();
                int     slotNumber = 0;
                try {
                    int.TryParse(row["slotNumber"].ToString(), out slotNumber);
                } catch
                {
                }
                string        roomID  = row["roomID"].ToString();
                string        dom     = row["dom"].ToString();
                StudentStatus student = new StudentStatus(studentID, name, dom, roomID, slotNumber);
                return(student);
            }
        }
 // GET: StudentStatus/Delete/5
 public ActionResult Delete(int?id)
 {
     if (User.IsInRole("Admin"))
     {
         if (id == null)
         {
             return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
         }
         StudentStatus studentStatus = db.StudentStatuses.Find(id);
         if (studentStatus == null)
         {
             //404 error
             return(HttpNotFound());
         }
         if (studentStatus.Students.Count == 0)
         {
             return(View(studentStatus));
         }
         else
         {
             return(RedirectToAction("Index"));
         }
     }
     else
     {
         return(RedirectToAction("Login", "Account"));
     }
 }
Exemple #8
0
        public int CreditScore { get; private set; }// set to Private so that a value can't be put in that is outside the accepted values
        /// </summary>
        /// <param name="status"></param>

        //above are the Properties; below are the Methods
        //'Void' doesn't return a value.

        public void SetStatus(StudentStatus status) {
            if ((status == "CURRENT")
                    || (status == "PAST")
                    || (status == "FUTURE")) {
                this.Status = status;
        } else {
                Console.WriteLine("Status must be: PAST, CURRENT or FUTURE");
Exemple #9
0
        public static string GetStudentStatusDesc(StudentStatus status)
        {
            string _desc;

            switch (status)
            {
            case StudentStatus.Studying:
                _desc = "Учится";
                break;

            case StudentStatus.graduated:
                _desc = "Закончил университет";
                break;

            case StudentStatus.Deducted:
                _desc = "Отчислен";
                break;

            case StudentStatus.AcademicHolidays:
                _desc = "Академический отпуск";
                break;

            default:
                _desc = "не известно";
                break;
            }
            return(_desc);
        }
Exemple #10
0
 void BecomeChaotic()
 {
     status = StudentStatus.Chaotic;
     myDesk.HideObject();
     timer = GameManager.GetSharedInstance().stealInTime;
     GameManager.GetSharedInstance().chaos++;
 }
Exemple #11
0
    void Steal()
    {
        TileMap map = TileMap.GetSharedInstance();

        Student[] possibleTargets = map.GetValidStudents();
        if (possibleTargets.Length > 0)
        {
            GameObject puff = Instantiate(SharedResources.GetSharedInstance().puff);

            Student target = possibleTargets[Random.Range(0, possibleTargets.Length - 1)];
            target.status = StudentStatus.Searching;
            target.timer  = GameManager.GetSharedInstance().timeSeeking;
            target.myDesk.ShowObject(true);

            myDesk.objectInPlace.ChangeTexture(target.myDesk.objectInPlace.GetTexture());
            myDesk.ShowObject();
            myDesk.objectInPlace.tag = "Stolen";
            myDesk.objectInPlace.SetAlpha(1f);
            myDesk.objectInPlace.target = target.myDesk.objectInPlace.gameObject;

            puff.transform.position = myDesk.objectInPlace.transform.position;



            this.status = StudentStatus.ChaoticBusy;
            this.timer  = target.timer;
        }
        else
        {
            this.timer = 0.5f;
        }
    }
Exemple #12
0
        public ActionResult DeleteConfirmed(int id)
        {
            StudentStatus studentStatus = db.StudentStatuses.Find(id);

            db.StudentStatuses.Remove(studentStatus);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #13
0
        /// <summary>
        /// Cập nhật trạng thái học sinh
        /// </summary>
        /// <param name="id"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        public async Task <int> UpdateStatus(int id, StudentStatus status)
        {
            var student = await _context.Students.Where(x => x.IsDeleted == false).FirstOrDefaultAsync(x => x.Id == id);

            student.Status = status;
            _context.Students.Update(student);
            return(await _context.SaveChangesAsync());
        }
        public ActionResult Create(int id)
        {
            var currentEnrollee = _enrolleeService.Find(customer => customer.AppCustomer.UserName == User.Identity.Name).First();

            var faculty = _facultyService.Get(id);

            var addedFaculty = _facultyService.GetAll().Where(f => f.FacultyNumber == faculty.FacultyNumber && faculty.Enrollees.Any()).ToList();

            if (currentEnrollee.Faculties.Any(f => f.FacultyNumber == faculty.FacultyNumber))
            {
                ModelState.AddModelError("AddFaculty", "This faculty already added.");
                return(View());
            }
            else if (addedFaculty.Any() && addedFaculty.First().Enrollees.Any() &&
                     addedFaculty.First().Enrollees.Count(e => e.StudentStatuses.Any(s => s.FacultyStatus == true && s.Faculty.FacultyNumber == faculty.FacultyNumber))
                     == faculty.AllPlaces)
            {
                ModelState.AddModelError("AddFaculty", "No places are there :(");

                return(View());
            }
            else
            {
                currentEnrollee.ExaminationSubjects.Clear();
                currentEnrollee.SchoolSubjects.Clear();
                foreach (var item in _schoolSubjectsService.GetAll().ToList())
                {
                    if (!currentEnrollee.SchoolSubjects.Contains(item))
                    {
                        currentEnrollee.SchoolSubjects.Add(item);
                    }
                }

                var exSubjects = _examinationSubjectService.Find(e => e.Faculties.Any(f => f.FacultyNumber == faculty.FacultyNumber)).ToList();

                foreach (var item in exSubjects)
                {
                    if (!currentEnrollee.ExaminationSubjects.Any(s => s.Name == item.Name))
                    {
                        currentEnrollee.ExaminationSubjects.Add(item);
                    }
                }

                currentEnrollee.Faculties.Add(faculty);

                var status = new StudentStatus()
                {
                    Faculty = faculty, FacultyStatus = false, Enrollee = currentEnrollee, Status = "Enrollee"
                };

                _studentStatusService.Create(status);

                _enrolleeService.Update(currentEnrollee);

                return(View("Create", currentEnrollee));
            }
        }
Exemple #15
0
 public ActionResult Edit([Bind(Include = "SSID,SSName,SSdescription")] StudentStatus studentStatus)
 {
     if (ModelState.IsValid)
     {
         db.Entry(studentStatus).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(studentStatus));
 }
Exemple #16
0
 public Student(string rollNumber, string fullName, DateTime birthday, string email, string phone, DateTime createdAt, StudentStatus status)
 {
     RollNumber = rollNumber;
     FullName   = fullName;
     Birthday   = birthday;
     Email      = email;
     Phone      = phone;
     CreatedAt  = createdAt;
     Status     = status;
 }
Exemple #17
0
 public Student(string RollNumber, string FullName, DateTime Birthday, string Email, string Phone, DateTime CreatedAt, StudentStatus Status)
 {
     this.RollNumber = RollNumber;
     this.FullName   = FullName;
     this.Birthday   = Birthday;
     this.Email      = Email;
     this.Phone      = Phone;
     this.CreatedAt  = CreatedAt;
     this.Status     = Status;
 }
Exemple #18
0
        public static List <bool> CreateBinaryVector(StudentStatus status)
        {
            var enumList     = Enum.GetValues(typeof(StudentStatus));
            var binaryVector = new List <bool>(new bool[enumList.Length]);

            var statusIndex = (int)status;

            binaryVector[statusIndex] = true;

            return(binaryVector);
        }
Exemple #19
0
        public ActionResult Create([Bind(Include = "SSID,SSName,SSdescription")] StudentStatus studentStatus)
        {
            if (ModelState.IsValid)
            {
                db.StudentStatuses.Add(studentStatus);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(studentStatus));
        }
Exemple #20
0
        public void initialValue()
        {
            StudentDAL    dao     = new StudentDAL();
            StudentStatus student = dao.getStudentStatus(this.studentID);

            txtStudentName.Text = student.StudentName;
            txtStudentID.Text   = student.StudentID;
            txtDom.Text         = student.Dom.ToUpper();
            txtSlotNumber.Text  = student.Slot.ToString();
            txtRoom.Text        = student.Room.ToString();
        }
Exemple #21
0
        public SelectList GetStudentStatusOptions(StudentStatus defaultStatus = StudentStatus.OnRoll)
        {
            var searchTypes = new Dictionary <string, int>();

            searchTypes.Add("Any", (int)StudentStatus.Any);
            searchTypes.Add("On Roll", (int)StudentStatus.OnRoll);
            searchTypes.Add("Leavers", (int)StudentStatus.Leavers);
            searchTypes.Add("Future", (int)StudentStatus.Future);

            return(new SelectList(searchTypes, "Value", "Key", (int)defaultStatus));
        }
Exemple #22
0
 /// <summary>
 /// Creates a new person
 /// </summary>
 /// <param name="household">The household that this person belongs to, may not be null!</param>
 /// <param name="id">The identifyer for this person</param>
 /// <param name="age">The age of this person</param>
 /// <param name="employmentStatus">How this person is employed, if at all</param>
 /// <param name="studentStatus">If this person is a student, and if so what type of student</param>
 /// <param name="female">Is this person female</param>
 /// <param name="licence">Does this person have a driver's licence</param>
 public Person(ITashaHousehold household, int id, int age, Occupation occupation, TTSEmploymentStatus employmentStatus, StudentStatus studentStatus, bool license, bool female)
     : this()
 {
     Household = household;
     Id = id;
     Age = age;
     Occupation = occupation;
     EmploymentStatus = employmentStatus;
     StudentStatus = studentStatus;
     Licence = license;
     Female = female;
 }
Exemple #23
0
 /// <summary>
 /// Creates a new person
 /// </summary>
 /// <param name="household">The household that this person belongs to, may not be null!</param>
 /// <param name="id">The identifyer for this person</param>
 /// <param name="age">The age of this person</param>
 /// <param name="employmentStatus">How this person is employed, if at all</param>
 /// <param name="studentStatus">If this person is a student, and if so what type of student</param>
 /// <param name="female">Is this person female</param>
 /// <param name="licence">Does this person have a driver's licence</param>
 public Person(ITashaHousehold household, int id, int age, Occupation occupation, TTSEmploymentStatus employmentStatus, StudentStatus studentStatus, bool license, bool female)
     : this()
 {
     this.Household = household;
     this.Id = id;
     this.Age = age;
     this.Occupation = occupation;
     this.EmploymentStatus = employmentStatus;
     this.StudentStatus = studentStatus;
     this.Licence = license;
     this.Female = female;
 }
Exemple #24
0
 /// <summary>
 /// Creates a new person
 /// </summary>
 /// <param name="household">The household that this person belongs to, may not be null!</param>
 /// <param name="id">The identifier for this person</param>
 /// <param name="age">The age of this person</param>
 /// <param name="occupation"></param>
 /// <param name="employmentStatus">How this person is employed, if at all</param>
 /// <param name="studentStatus">If this person is a student, and if so what type of student</param>
 /// <param name="license"></param>
 /// <param name="female">Is this person female</param>
 public Person(ITashaHousehold household, int id, int age, Occupation occupation, TTSEmploymentStatus employmentStatus, StudentStatus studentStatus, bool license, bool female)
     : this()
 {
     Household        = household;
     Id               = id;
     Age              = age;
     Occupation       = occupation;
     EmploymentStatus = employmentStatus;
     StudentStatus    = studentStatus;
     Licence          = license;
     Female           = female;
 }
Exemple #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            List <Student>       allStudents;
            List <StudentStatus> allStatuses;
            List <Student>       displayedStudents = new List <Student>();

            using (SqlConnection connection = new SqlConnection(LSKYCommon.dbConnectionString_SchoolLogic))
            {
                allStudents = Student.loadAllStudents(connection);
                allStatuses = StudentStatus.loadAllStudentStatuses(connection);
            }

            foreach (StudentStatus status in allStatuses)
            {
                if ((string.IsNullOrEmpty(status.outStatus)) && (status.inStatus != "Not Base School"))
                {
                    foreach (Student student in allStudents)
                    {
                        if (status.studentNumber == student.getStudentID())
                        {
                            student.statuses.Add(status);
                        }
                    }
                }
            }

            foreach (Student student in allStudents)
            {
                if (student.statuses.Count > 1)
                {
                    displayedStudents.Add(student);
                }
            }

            if (displayedStudents.Count > 0)
            {
                foreach (Student student in displayedStudents)
                {
                    litStudents.Text += addStudentRow(student);
                    foreach (StudentStatus status in student.statuses)
                    {
                        litStudents.Text += addStatusRow(student, status);
                        litStudents.Text += "<BR>";
                    }
                }
            }
            else
            {
                litStudents.Text += "<i>None</i>";
            }
        }
Exemple #26
0
 public IiTPStudent(string name, string surname, string nationality, Gender gender, int day, int month, int year,
                    BsuirFaculty faculty, string specialty, StudentStatus status, string curator, string groupNumber, string studentNumber,
                    ushort language, ushort mathematic, ushort physics, ushort sertificate, ushort yearOfEntering, ushort grade,
                    bool isWinnerOlympiad, bool isSetteled, bool isBuget)
     : base(name, surname, nationality, gender, day, month, year, faculty, specialty, status, curator, groupNumber, studentNumber,
            language, mathematic, physics, sertificate, yearOfEntering, grade, isWinnerOlympiad, isSetteled, isBuget)
 {
     if (faculty != BsuirFaculty.FKSiS || specialty != "IiTP")
     {
         Console.WriteLine("Неверная специальность или факультет");
         Faculty   = BsuirFaculty.FKSiS;
         Specialty = "IiTP";
     }
 }
        private char GetStudentChar(StudentStatus studentStatus)
        {
            switch (studentStatus)
            {
            case StudentStatus.FullTime:
                return('F');

            case StudentStatus.PartTime:
                return('P');

            default:
                return('O');
            }
        }
Exemple #28
0
        // GET: StudentStatus/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StudentStatus studentStatus = db.StudentStatuses.Find(id);

            if (studentStatus == null)
            {
                return(HttpNotFound());
            }
            return(View(studentStatus));
        }
Exemple #29
0
        public override int GetHashCode()
        {
            int result = 1;

            result = (result * 397) ^ (AccumulatedCreditUnits != null ? AccumulatedCreditUnits.GetHashCode() : 0);
            result = (result * 397) ^ (Cgpa != null ? Cgpa.GetHashCode() : 0);
            result = (result * 397) ^ (Gpa != null ? Gpa.GetHashCode() : 0);
            result = (result * 397) ^ Id.GetHashCode();
            result = (result * 397) ^ (RegistrationApprovalDateTime != null ? RegistrationApprovalDateTime.GetHashCode() : 0);
            result = (result * 397) ^ RegistrationDateTime.GetHashCode();
            result = (result * 397) ^ (SemesterCreditUnits != null ? SemesterCreditUnits.GetHashCode() : 0);
            result = (result * 397) ^ (StudentRemark != null ? StudentRemark.GetHashCode() : 0);
            result = (result * 397) ^ (StudentStatus != null ? StudentStatus.GetHashCode() : 0);
            return(result);
        }
Exemple #30
0
 public Student(string firstName, string lastName, string isStudying)
 {
     FirstName = firstName;
     LastName  = lastName;
     Enum.TryParse(isStudying, true, out StudentStatus studentStatus);
     Status = studentStatus;
     if (Status == StudentStatus.Studying)
     {
         IsStudying = true;
     }
     else
     {
         IsStudying = false;
     }
 }
Exemple #31
0
        public override int GetHashCode()
        {
            int result = 1;

            result = (result * 397) ^ CurrentYear.GetHashCode();
            result = (result * 397) ^ Id.GetHashCode();
            result = (result * 397) ^ (RegistrationNumber != null ? RegistrationNumber.GetHashCode() : 0);
            result = (result * 397) ^ (Remark != null ? Remark.GetHashCode() : 0);
            result = (result * 397) ^ StudentStatus.GetHashCode();
            result = (result * 397) ^ (StudentNumber != null ? StudentNumber.GetHashCode() : 0);
            result = (result * 397) ^ CurrentCGPA.GetHashCode();
            result = (result * 397) ^ CurrentCTCU.GetHashCode();
            result = (result * 397) ^ CurrentAward.GetHashCode();
            return(result);
        }
 public ASOIStudent(string name, string surname, string nationality, Gender gender, int day, int month, int year,
                    BsuirFaculty faculty, string specialty, StudentStatus status, string curator, string groupNumber, string studentNumber,
                    ushort language, ushort mathematic, ushort physics, ushort sertificate, ushort yearOfEntering, ushort grade,
                    bool isWinnerOlympiad, bool isSetteled, bool isBuget)
     : base(name, surname, nationality, gender, day, month, year, faculty, specialty, status, curator, groupNumber, studentNumber,
            language, mathematic, physics, sertificate, yearOfEntering, grade, isWinnerOlympiad, isSetteled, isBuget)
 {
     Console.WriteLine("ии - топ спецуха \nНа ксисе нет ни сетей, ни системотехники\n");
     if (faculty != BsuirFaculty.FITU || specialty != "II")
     {
         Console.WriteLine("Неверная специальность или факультет");
         Faculty   = BsuirFaculty.FITU;
         Specialty = "II";
     }
 }
Exemple #33
0
        public CY.GFive.Core.Business.StudentStatus GetStatusByStudentCode(string code)
        {
            Core.Business.StudentStatus s = new StudentStatus();

            SqlServerUtility utility = new SqlServerUtility();

            utility.AddParameter("@StdCode", SqlDbType.NVarChar, code);

            SqlDataReader reader = utility.ExecuteSqlReader(SQL_GET_STATUS_BY_CODE);

            if (reader != null && !reader.IsClosed)
            {

                if (reader.Read())
                {
                    if (!reader.IsDBNull(0))
                        s.Id = reader.GetInt32(0);
                    if (!reader.IsDBNull(1))
                        s.StdStatus = reader.GetString(1);
                    if (!reader.IsDBNull(2))
                        s.YearNum = reader.GetString(2);
                    if (!reader.IsDBNull(3))
                        s.Terminal = reader.GetInt32(3);
                    if (!reader.IsDBNull(4))
                        s.StdCode = reader.GetString(4);
                }

                s.MarkOld();
                reader.Close();
            }

            return s;
        }
Exemple #34
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "application/json";

            string stdCode;
            Student student;
            Semester semester;
            StringBuilder sbResult = new StringBuilder();

            #region Validate and Get Basic Info

            if (string.IsNullOrEmpty(context.Request.Form["stdCode"]))
            {
                context.Response.Write("{success: false, msg: '参数不正确'}");
                return;
            }
            stdCode = context.Request.Form["stdCode"];

            student = Student.GetStudentByCode(stdCode);
            if (stdCode == null)
            {
                context.Response.Write("{success: false, msg: '学生不存在'}");
                return;
            }

            semester = Semester.GetCurrentSemester();
            if (semester == null)
            {
                context.Response.Write("{success: false, msg: '当前时间未处于任何有效的学期内!'}");
                return;
            }

            #endregion

            try
            {
                StudentStatus ss = StudentStatus.GetStudentStatus(student, semester);

                if (ss == null)
                {
                    ss = new StudentStatus();
                }

                ss.StdStatus = "InRegister";
                ss.Terminal = semester.Id;
                ss.YearNum = semester.AcademicYear.Id.ToString();
                ss.StdCode = student.Code;

                ss.Save();

                sbResult.Append("{success: true}");
            }
            catch (Exception ex)
            {
                sbResult = new StringBuilder();

                sbResult.Append("{success: false, msg: '" + ex.Message.Replace('\'', '-').Replace('"', '-') + "'}");
            }

            context.Response.Write(sbResult.ToString());
        }