public ActionResult Liability(itmmLiability a)
        {
            StudentInfo c = new StudentInfo();
            c.FirstName = "autogen";
            c.FamiliyName = "autogen";
            c.StudentId = a.IdNumber.ToString();
            c.CourseAndYear = "autogen";

            con.AddToStudentInfoes(c);

            var labid = getLabId();

            Liability b = new Liability();
            b.StudenInfotId = a.IdNumber;//Convert.ToInt32(a.IdNumber);
            // b.Equipment = a.Equipment;
            b.Equipment = (from y in con.Equipments where y.Barcode == a.Barcode select y.Make).FirstOrDefault();
            b.Fine = a.Fine;
            b.Status = a.Status;
            b.LaboratoryId = labid;
            b.Barcode = a.Barcode;
               // b.StudenInfotId = c.StudentInfoId;
            con.AddToLiabilities(b);

            var d = (from y in con.Equipments
                     where y.Barcode == a.Barcode
                     select y).FirstOrDefault();

            d.Status = "Liability";

            con.SaveChanges();

            return RedirectToAction("Liability");
        }
        public ActionResult Income(itmmIncome a)
        {
            itmm.Models.Income b = new itmm.Models.Income();
            b.Transactionn = a.Transaction;
            b.cost = a.Cost;
            b.LaboratoryId = getLabId();
            b.DateCreated = DateTime.Now;

            StudentInfo c = new StudentInfo();
            c.FirstName = a.FirstName;
            c.FamiliyName = a.FamilyName;
            c.StudentId = a.IdNumber.ToString();
            c.CourseAndYear = a.Course;

            c.IncomeId = b.IncomeId;
            b.StudentInfoId = c.StudentInfoId;

            con.AddToIncomes(b);
            con.AddToStudentInfoes(c);

            con.SaveChanges();
            return RedirectToAction("Income");
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the StudentInfoes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToStudentInfoes(StudentInfo studentInfo)
 {
     base.AddObject("StudentInfoes", studentInfo);
 }
        public ActionResult Liability(itmmLiability a)
        {
            StudentInfo c = new StudentInfo();
            c.FirstName = "autogen";
            c.FamiliyName = "autogen";
            c.StudentId = a.IdNumber.ToString();
            c.CourseAndYear = "autogen";
            con.AddToStudentInfoes(c);

            var labid = getLabId();
            Liability b = new Liability();
            b.StudenInfotId = Convert.ToInt32(a.IdNumber);
            b.Equipment = a.Equipment;
            b.Fine = a.Fine;
            b.Status = a.Status;
            b.LaboratoryId = labid;
            b.StudenInfotId = c.StudentInfoId;
            con.AddToLiabilities(b);

            con.SaveChanges();

            return RedirectToAction("Liability");
        }
 /// <summary>
 /// Create a new StudentInfo object.
 /// </summary>
 /// <param name="studentId">Initial value of the StudentId property.</param>
 /// <param name="familiyName">Initial value of the FamiliyName property.</param>
 /// <param name="firstName">Initial value of the FirstName property.</param>
 /// <param name="courseAndYear">Initial value of the CourseAndYear property.</param>
 /// <param name="studentInfoId">Initial value of the StudentInfoId property.</param>
 public static StudentInfo CreateStudentInfo(global::System.String studentId, global::System.String familiyName, global::System.String firstName, global::System.String courseAndYear, global::System.Int32 studentInfoId)
 {
     StudentInfo studentInfo = new StudentInfo();
     studentInfo.StudentId = studentId;
     studentInfo.FamiliyName = familiyName;
     studentInfo.FirstName = firstName;
     studentInfo.CourseAndYear = courseAndYear;
     studentInfo.StudentInfoId = studentInfoId;
     return studentInfo;
 }