コード例 #1
0
        //insert student
        public int InserStudent(AdmissionForm student)
        {
            int result = 0;

            if (student != null)
            {
                SchoolDB.AdmissionForms.Add(student);
                result = SchoolDB.SaveChanges();
            }
            return(result);
        }
コード例 #2
0
 public ActionResult EditFeeDetail(StudentFeeDetail objClass)
 {
     using (wisdomDBEntities db = new wisdomDBEntities())
     {
         ClassController _class = new ClassController();
         objClass.Class = _class.GetClassID(objClass.Class).ToString();
         StudentFeeDetail Existing = db.StudentFeeDetails.Find(objClass.Id);
         Existing.Name         = objClass.Name;
         Existing.Class        = objClass.Class;
         Existing.AdmissionNo  = objClass.AdmissionNo;
         Existing.ReciptNo     = objClass.ReciptNo;
         Existing.Months       = objClass.Months;
         Existing.PaidAmount   = objClass.PaidAmount;
         Existing.PreviousDue  = objClass.PreviousDue;
         Existing.TotalAmount  = objClass.TotalAmount;
         Existing.GrandTotal   = objClass.GrandTotal;
         Existing.Balance      = objClass.Balance;
         Existing.Concession   = objClass.Concession;
         Existing.Fine         = objClass.Fine;
         Existing.OldBalanced  = objClass.OldBalanced;
         Existing.TransportFee = objClass.TransportFee;
         Existing.BalancedShow = objClass.BalancedShow;
         db.SaveChanges();
         return(RedirectToAction("StudentFeeDetailList"));
     }
 }
コード例 #3
0
 public ActionResult EditFeeHeading(NewFeeHeading objNewFeeHeading)
 {
     using (wisdomDBEntities db = new wisdomDBEntities())
     {
         ClassController _class   = new ClassController();
         NewFeeHeading   Existing = db.NewFeeHeadings.Find(objNewFeeHeading.FID);
         Existing.January   = objNewFeeHeading.January;
         Existing.February  = objNewFeeHeading.February;
         Existing.March     = objNewFeeHeading.March;
         Existing.April     = objNewFeeHeading.April;
         Existing.May       = objNewFeeHeading.May;
         Existing.June      = objNewFeeHeading.June;
         Existing.July      = objNewFeeHeading.July;
         Existing.August    = objNewFeeHeading.August;
         Existing.September = objNewFeeHeading.September;
         Existing.October   = objNewFeeHeading.October;
         Existing.November  = objNewFeeHeading.November;
         Existing.December  = objNewFeeHeading.December;
         Existing.Class     = Convert.ToString(_class.GetClassID(objNewFeeHeading.Class));
         Existing.Heading   = objNewFeeHeading.Heading;
         Existing.IsMonth   = objNewFeeHeading.IsMonth;
         db.SaveChanges();
         return(RedirectToAction("FeeHeadings"));
     }
 }
コード例 #4
0
 public ActionResult DeleteClass(int id)
 {
     using (wisdomDBEntities db = new wisdomDBEntities())
     {
         Class objDelete = db.Classes.Find(id);
         db.Classes.Remove(objDelete);
         db.SaveChanges();
         return(RedirectToAction("ClassList"));
     }
 }
コード例 #5
0
 //DeleteFeeHeading
 public ActionResult FeeHeadingDelete(int id)
 {
     using (wisdomDBEntities db = new wisdomDBEntities())
     {
         NewFeeHeading objDelete = db.NewFeeHeadings.Find(id);
         db.NewFeeHeadings.Remove(objDelete);
         db.SaveChanges();
         return(RedirectToAction("FeeHeadings"));
     }
 }
コード例 #6
0
 public ActionResult EditSession(Session objSession)
 {
     using (wisdomDBEntities db = new wisdomDBEntities())
     {
         Session Existing = db.Sessions.Find(objSession.Id);
         Existing.IsActive = objSession.IsActive;
         db.SaveChanges();
         return(View("Index"));
     }
 }
コード例 #7
0
 public ActionResult DeleteSchool(int id)
 {
     using (wisdomDBEntities db = new wisdomDBEntities())
     {
         School objSchool = db.Schools.Find(id);
         db.Schools.Remove(objSchool);
         db.SaveChanges();
         return(RedirectToAction("School"));
     }
 }
コード例 #8
0
        //insert student
        public HttpResponseMessage Post(AdmissionForm student)
        {
            HttpRequestMessage Request = new HttpRequestMessage();

            Request.Properties.Add(HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration());

            if (ModelState.IsValid)
            {
                SchoolDB.AdmissionForms.Add(student);
                SchoolDB.SaveChanges();
                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, student);
                //response.Headers.Location = new Uri(Url.Link("DefaultApi", new { AdmissionId = student.AdmissionId }));
                return(response);
            }
            else
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }
        }
コード例 #9
0
 public ActionResult EditClass(Class objClass)
 {
     using (wisdomDBEntities db = new wisdomDBEntities())
     {
         Class Existing = db.Classes.Find(objClass.CID);
         Existing.Class1    = objClass.Class1;
         Existing.Inc_Class = objClass.Inc_Class;
         db.SaveChanges();
         return(RedirectToAction("ClassList"));
     }
 }
コード例 #10
0
        public HttpResponseMessage Post(List <StAttendance> Attendance)
        {
            HttpRequestMessage Request = new HttpRequestMessage();

            Request.Properties.Add(HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration());
            if (ModelState.IsValid)
            {
                foreach (var item in Attendance)
                {
                    item.Session = SchoolSession;
                    SchoolDB.StAttendances.Add(item);
                    SchoolDB.SaveChanges();
                }

                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, Attendance);
                return(response);
            }
            else
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }
        }
コード例 #11
0
 public ActionResult EditSchool(School objSchool)
 {
     using (wisdomDBEntities db = new wisdomDBEntities())
     {
         School Existing = db.Schools.Find(objSchool.ID);
         Existing.SchoolName    = objSchool.SchoolName;
         Existing.schooladdress = objSchool.schooladdress;
         Existing.Phone         = objSchool.Phone;
         Existing.Date          = DateTime.Now;
         Existing.logo          = objSchool.logo;
         db.SaveChanges();
         return(RedirectToAction("School"));
     }
 }
コード例 #12
0
        public ActionResult DeleteFeeDetail(int id)
        {
            using (wisdomDBEntities db = new wisdomDBEntities())
            {
                StudentFeeDetail objDelete = db.StudentFeeDetails.Find(id);
                if (objDelete != null)
                {
                    db.StudentFeeDetails.Remove(objDelete);
                    db.SaveChanges();
                }

                return(RedirectToAction("StudentFeeDetailList"));
            }
        }
コード例 #13
0
        //insert stFeeDetail
        public HttpResponseMessage Post(StudentFeeDetail stFeeDetail)
        {
            HttpRequestMessage Request = new HttpRequestMessage();

            Request.Properties.Add(HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration());

            if (ModelState.IsValid)
            {
                stFeeDetail.Class = Convert.ToString(_class.GetClassID(stFeeDetail.Class));
                SchoolDB.StudentFeeDetails.Add(stFeeDetail);
                SchoolDB.SaveChanges();
                stFeeDetail.Class = Convert.ToString(_class.GetClassName(stFeeDetail.Class));
                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, stFeeDetail);
                return(response);
            }
            else
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
            }
        }
コード例 #14
0
 public void Save()
 {
     _context.SaveChanges();
 }