Ejemplo n.º 1
0
        // GET: Feetransaction/Details/5
        public ActionResult Details(string id)
        {
            StudentFeePayment feePayment = new StudentFeePayment();

            feePayment.Student = db.t_student.Find(id);
            var feeTran = (from f in db.t_feetransaction
                           where f.stud_id == id
                           select f).OrderByDescending(x => x.created_on);

            feePayment.Transaction = feeTran.ToList();
            return(View(feePayment));
        }
Ejemplo n.º 2
0
        // GET: Feetransaction
        public ActionResult Index(string id)
        {
            StudentFeePayment feePayment = new StudentFeePayment();

            feePayment.Student = db.t_student.Find(id);
            var feeTran = from f in db.t_feetransaction
                          where f.stud_id == id
                          select f;

            feePayment.Transaction = feeTran.ToList();
            return(View(feePayment));
        }
        // POST: odata/StudentFeePayments
        public async Task <IHttpActionResult> Post(StudentFeePayment studentFeePayment)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.StudentFeePayments.Add(studentFeePayment);
            await db.SaveChangesAsync();

            return(Created(studentFeePayment));
        }
        // DELETE: odata/StudentFeePayments(5)
        public async Task <IHttpActionResult> Delete([FromODataUri] int key)
        {
            StudentFeePayment studentFeePayment = await db.StudentFeePayments.FindAsync(key);

            if (studentFeePayment == null)
            {
                return(NotFound());
            }

            db.StudentFeePayments.Remove(studentFeePayment);
            await db.SaveChangesAsync();

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 5
0
        // GET: Feetransaction/AddPayment
        public ActionResult AddPayment(string id)
        {
            StudentFeePayment feePayment = new StudentFeePayment();

            feePayment.Student = db.t_student.Find(id);
            // feePayment.Transaction

            var listTransaction         = new List <t_feetransaction>();
            t_feetransaction defaultFee = new t_feetransaction();

            defaultFee.stud_id     = feePayment.Student.stud_id;
            defaultFee.paid_amount = feePayment.Student.monthly_fee;
            listTransaction.Add(defaultFee);
            feePayment.Transaction = listTransaction;
            //var feeTran = from f in db.t_feetransaction
            //              where f.stud_id == id
            //              select f;
            //feePayment.Transaction = feeTran.ToList();
            return(View(feePayment));
        }
Ejemplo n.º 6
0
        // GET: Feetransaction/Edit/5
        public ActionResult Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            t_feetransaction feetransaction = db.t_feetransaction.Find(id);

            if (feetransaction == null)
            {
                return(HttpNotFound());
            }

            StudentFeePayment feePayment = new StudentFeePayment();

            feePayment.Student = db.t_student.Find(feetransaction.stud_id);
            var listTransaction = new List <t_feetransaction>();

            listTransaction.Add(feetransaction);
            feePayment.Transaction = listTransaction;
            return(View(feePayment));
        }
        // PUT: odata/StudentFeePayments(5)
        public async Task <IHttpActionResult> Put([FromODataUri] int key, Delta <StudentFeePayment> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            StudentFeePayment studentFeePayment = await db.StudentFeePayments.FindAsync(key);

            if (studentFeePayment == null)
            {
                return(NotFound());
            }

            patch.Put(studentFeePayment);

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!StudentFeePaymentExists(key))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Updated(studentFeePayment));
        }