コード例 #1
0
        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");
        }
コード例 #2
0
        public ActionResult Fine(int TableId, int EquipmentId, int ClassId, string Barcode)
        {
            Liability a = new Liability();

               a.Equipment = (from y in con.Equipments where y.EquipmentId == EquipmentId select y.Make).FirstOrDefault();
               a.StudenInfotId = (from y in con.Tables where y.TableId == TableId select y.StudentId).FirstOrDefault();
               a.Fine = "To be Determined";
               a.Status = "Unsettled";
               a.Barcode = Barcode;
               a.LaboratoryId = (from y in con.Classes where y.ClassId == ClassId select y.LabId).FirstOrDefault();

               con.AddToLiabilities(a);

               Dispense b = new Dispense();

               var x = (from y in con.Dispenses
                   where y.EquipmentId == EquipmentId && y.TableId == TableId && y.ClassId == ClassId
                   select y).FirstOrDefault();
               x.Status = "liability";

               con.SaveChanges();

               return RedirectToAction("ViewEquipment", "Staff", new { TableId = TableId, ClassId = ClassId });
        }
コード例 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Liabilities EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToLiabilities(Liability liability)
 {
     base.AddObject("Liabilities", liability);
 }
コード例 #4
0
        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");
        }
コード例 #5
0
 /// <summary>
 /// Create a new Liability object.
 /// </summary>
 /// <param name="liabilityId">Initial value of the LiabilityId property.</param>
 /// <param name="studenInfotId">Initial value of the StudenInfotId property.</param>
 /// <param name="equipment">Initial value of the Equipment property.</param>
 /// <param name="fine">Initial value of the Fine property.</param>
 /// <param name="status">Initial value of the Status property.</param>
 /// <param name="laboratoryId">Initial value of the LaboratoryId property.</param>
 public static Liability CreateLiability(global::System.Int32 liabilityId, global::System.String studenInfotId, global::System.String equipment, global::System.String fine, global::System.String status, global::System.Int32 laboratoryId)
 {
     Liability liability = new Liability();
     liability.LiabilityId = liabilityId;
     liability.StudenInfotId = studenInfotId;
     liability.Equipment = equipment;
     liability.Fine = fine;
     liability.Status = status;
     liability.LaboratoryId = laboratoryId;
     return liability;
 }