示例#1
0
        public ActionResult del(Guid?strId)
        {
            OilMaterialOrder oi = osms.OilMaterialOrder.Where(x => x.Id == strId).FirstOrDefault();
            List <OilMaterialOrderDetail> od = osms.OilMaterialOrderDetail.Where(x => x.OrderId == strId).ToList();

            foreach (var item in od)
            {
                osms.Entry(item).State = System.Data.Entity.EntityState.Modified;
                item.IsDel             = true;
            }

            osms.Entry(oi).State = System.Data.Entity.EntityState.Modified;
            oi.IsDel             = true;

            List <ProcessStepRecord> lpr = (osms.ProcessStepRecord.Where(x => x.RefOrderId == strId)).ToList();

            foreach (var item in lpr)
            {
                osms.ProcessStepRecord.Remove(item);
            }

            int i = osms.SaveChanges();

            if (i > 0)
            {
                return(Content("OK"));
            }
            else
            {
                return(Content("NO"));
            }
        }
示例#2
0
        public ActionResult Save(Job j)
        {
            int    a;
            string state;

            if (j.Id != Guid.Empty)
            {
                state = "EditOK";
                Job job = osms.Job.Where(x => x.Id == j.Id).FirstOrDefault();
                osms.Entry <Job>(job).State = System.Data.Entity.EntityState.Modified;
                job.Code       = j.Code;
                job.UpdateTime = DateTime.Now.ToLocalTime();;
                job.Name       = j.Name;
                a = osms.SaveChanges();
            }
            else
            {
                state        = "AddOK";
                j.Id         = Guid.NewGuid();
                j.CreateTime = DateTime.Now.ToLocalTime();
                j.UpdateTime = DateTime.Now.ToLocalTime();
                j.IsDel      = true;
                osms.Job.Add(j);
                a = osms.SaveChanges();
            }

            if (a > 0)
            {
                return(Content(state));
            }
            else
            {
                return(Content("NO"));
            }
        }
示例#3
0
        public ActionResult del(Guid strId)
        {
            OrganizationStructure or = osms.OrganizationStructure.Where(x => x.Id == strId).FirstOrDefault();

            osms.Entry <OrganizationStructure>(or).State = System.Data.Entity.EntityState.Modified;
            or.IsDel = true;
            int a = osms.SaveChanges();

            if (a > 0)
            {
                return(Content("OK"));
            }
            else
            {
                return(Content("NO"));
            }
        }
 public ActionResult Edit([Bind(Include = "Admin_ID,AdminName,AdminEmail,AdminPassword,AdminContactNumber,AdminAddress")] ADMIN aDMIN)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aDMIN).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(aDMIN));
 }
 public ActionResult Edit([Bind(Include = "Teacher_ID,TeacherName,TeacherEmail,TeacherPassword,TeacherContactNumber,TeacherAddress,Admin_ID")] TEACHER tEACHER)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tEACHER).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Admin_ID = new SelectList(db.ADMINs, "Admin_ID", "AdminName", tEACHER.Admin_ID);
     return(View(tEACHER));
 }
 public ActionResult Edit([Bind(Include = "Payment_ID,PaymentAmount,PaymentDate,PaymentMonth,Student_ID")] PAYMENT pAYMENT)
 {
     if (ModelState.IsValid)
     {
         db.Entry(pAYMENT).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Student_ID = new SelectList(db.STUDENTs, "Student_ID", "StudentName", pAYMENT.Student_ID);
     return(View(pAYMENT));
 }
 public ActionResult Edit([Bind(Include = "Class_ID,ClassName,TotalSectons,TotalStudents,Admin_ID")] CLASS cLASS)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cLASS).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Admin_ID = new SelectList(db.ADMINs, "Admin_ID", "AdminName", cLASS.Admin_ID);
     return(View(cLASS));
 }
 public ActionResult Edit([Bind(Include = "Review_ID,ReviewDescription,Guardian_ID")] GUARDIANREVIEW gUARDIANREVIEW)
 {
     if (ModelState.IsValid)
     {
         db.Entry(gUARDIANREVIEW).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Guardian_ID = new SelectList(db.GUARDIANs, "Guardian_ID", "GuardianName", gUARDIANREVIEW.Guardian_ID);
     return(View(gUARDIANREVIEW));
 }
 public ActionResult Edit([Bind(Include = "Event_ID,Title,Description,AnnouncementDate,IssuedBY,FileDirectory,ImageDirectory,Admin_ID")] EVENT eVENT)
 {
     if (ModelState.IsValid)
     {
         db.Entry(eVENT).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Admin_ID = new SelectList(db.ADMINs, "Admin_ID", "AdminName", eVENT.Admin_ID);
     return(View(eVENT));
 }
 public ActionResult Edit([Bind(Include = "Section_ID,SectionName,TotalStudents,Admin_ID,Class_ID,SectionGroup")] SECTION sECTION)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sECTION).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Admin_ID = new SelectList(db.ADMINs, "Admin_ID", "AdminName", sECTION.Admin_ID);
     ViewBag.Class_ID = new SelectList(db.CLASSes, "Class_ID", "ClassName", sECTION.Class_ID);
     return(View(sECTION));
 }
示例#11
0
 public ActionResult Edit([Bind(Include = "Guardian_ID,GuardianName,GuardianEmail,GuardianPassword,GuardianContactNumber,GuardianAddress,Admin_ID,Student_ID")] GUARDIAN gUARDIAN)
 {
     if (ModelState.IsValid)
     {
         db.Entry(gUARDIAN).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Admin_ID   = new SelectList(db.ADMINs, "Admin_ID", "AdminName", gUARDIAN.Admin_ID);
     ViewBag.Student_ID = new SelectList(db.STUDENTs, "Student_ID", "StudentName", gUARDIAN.Student_ID);
     return(View(gUARDIAN));
 }
示例#12
0
 public ActionResult Edit([Bind(Include = "TeacherRoutine_ID,TeacherRoutineDirectory,Teacher_ID,Admin_ID")] TEACHER_ROUTINE tEACHER_ROUTINE)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tEACHER_ROUTINE).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Admin_ID   = new SelectList(db.ADMINs, "Admin_ID", "AdminName", tEACHER_ROUTINE.Admin_ID);
     ViewBag.Teacher_ID = new SelectList(db.TEACHERs, "Teacher_ID", "TeacherName", tEACHER_ROUTINE.Teacher_ID);
     return(View(tEACHER_ROUTINE));
 }
示例#13
0
        public ActionResult upApprover(Guid strid)
        {
            Approver a = osms.Approver.Where(x => x.Id == strid).FirstOrDefault();
            Approver b = osms.Approver.Where(x => x.ProcessItemId == a.ProcessItemId & x.Order == (a.Order - 1)).FirstOrDefault();

            osms.Entry(a).State = System.Data.Entity.EntityState.Modified;
            osms.Entry(b).State = System.Data.Entity.EntityState.Modified;

            a.Order = a.Order - 1;
            b.Order = b.Order + 1;

            int l = osms.SaveChanges();

            if (l > 0)
            {
                return(Content("OK"));
            }
            else
            {
                return(Content("NO"));
            }
        }
 public ActionResult Edit([Bind(Include = "ClassRoutine_ID,ClassRoutineDirectory,Class_ID,Section_ID,Admin_ID")] CLASSROUTINE cLASSROUTINE)
 {
     if (ModelState.IsValid)
     {
         db.Entry(cLASSROUTINE).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Admin_ID   = new SelectList(db.ADMINs, "Admin_ID", "AdminName", cLASSROUTINE.Admin_ID);
     ViewBag.Class_ID   = new SelectList(db.CLASSes, "Class_ID", "ClassName", cLASSROUTINE.Class_ID);
     ViewBag.Section_ID = new SelectList(db.SECTIONs, "Section_ID", "SectionName", cLASSROUTINE.Section_ID);
     return(View(cLASSROUTINE));
 }
示例#15
0
 public ActionResult Edit([Bind(Include = "Subject_ID,SubjectName,Class_ID,Teacher_ID,Admin_ID")] SUBJECT sUBJECT)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sUBJECT).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Admin_ID   = new SelectList(db.ADMINs, "Admin_ID", "AdminName", sUBJECT.Admin_ID);
     ViewBag.Class_ID   = new SelectList(db.CLASSes, "Class_ID", "ClassName", sUBJECT.Class_ID);
     ViewBag.Teacher_ID = new SelectList(db.TEACHERs, "Teacher_ID", "TeacherName", sUBJECT.Teacher_ID);
     return(View(sUBJECT));
 }
示例#16
0
 public ActionResult Edit([Bind(Include = "Student_ID,StudentName,StudentEmail,StudentPassword,StudentContactNumber,StudentAddress,Admin_ID,Class_ID,Section_ID")] STUDENT sTUDENT)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sTUDENT).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Admin_ID   = new SelectList(db.ADMINs, "Admin_ID", "AdminName", sTUDENT.Admin_ID);
     ViewBag.Class_ID   = new SelectList(db.CLASSes, "Class_ID", "ClassName", sTUDENT.Class_ID);
     ViewBag.Section_ID = new SelectList(db.SECTIONs, "Section_ID", "SectionName", sTUDENT.Section_ID);
     return(View(sTUDENT));
 }
示例#17
0
 public ActionResult Edit([Bind(Include = "Result_ID,ExamDate,MarksObtained,Grade,Student_ID,Class_ID,Section_ID,Subject_ID,Teacher_ID,Admin_ID")] RESULT rESULT)
 {
     if (ModelState.IsValid)
     {
         db.Entry(rESULT).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Admin_ID   = new SelectList(db.ADMINs, "Admin_ID", "AdminName", rESULT.Admin_ID);
     ViewBag.Class_ID   = new SelectList(db.CLASSes, "Class_ID", "ClassName", rESULT.Class_ID);
     ViewBag.Section_ID = new SelectList(db.SECTIONs, "Section_ID", "SectionName", rESULT.Section_ID);
     ViewBag.Student_ID = new SelectList(db.STUDENTs, "Student_ID", "StudentName", rESULT.Student_ID);
     ViewBag.Subject_ID = new SelectList(db.SUBJECTs, "Subject_ID", "SubjectName", rESULT.Subject_ID);
     ViewBag.Teacher_ID = new SelectList(db.TEACHERs, "Teacher_ID", "TeacherName", rESULT.Teacher_ID);
     return(View(rESULT));
 }
示例#18
0
 public ActionResult Edit([Bind(Include = "Attendance_ID,Attendance_Date,Attendance_Status,Student_ID,Class_ID,Section_ID,Subject_ID,Teacher_ID,Admin_ID")] ATTENDANCE aTTENDANCE)
 {
     if (ModelState.IsValid)
     {
         db.Entry(aTTENDANCE).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Admin_ID   = new SelectList(db.ADMINs, "Admin_ID", "AdminName", aTTENDANCE.Admin_ID);
     ViewBag.Class_ID   = new SelectList(db.CLASSes, "Class_ID", "ClassName", aTTENDANCE.Class_ID);
     ViewBag.Section_ID = new SelectList(db.SECTIONs, "Section_ID", "SectionName", aTTENDANCE.Section_ID);
     ViewBag.Student_ID = new SelectList(db.STUDENTs, "Student_ID", "StudentName", aTTENDANCE.Student_ID);
     ViewBag.Subject_ID = new SelectList(db.SUBJECTs, "Subject_ID", "SubjectName", aTTENDANCE.Subject_ID);
     ViewBag.Teacher_ID = new SelectList(db.TEACHERs, "Teacher_ID", "TeacherName", aTTENDANCE.Teacher_ID);
     return(View(aTTENDANCE));
 }