Exemplo n.º 1
0
 public ClassFee ClassFee(Guid classfeeId)
 {
     try
     {
         var classfee = _feeDataAccess.ClassFeeById(classfeeId);
         if (classfee != null)
         {
             var classFee = new ClassFee
             {
                 Id             = classfee.Id,
                 FeeAmount      = classfee.FeeAmount,
                 FineAmount     = classfee.FineAmount,
                 DiscountAmount = classfee.DiscountAmount,
                 FeeDueDate     = classfee.FeeDueDate,
                 ClassId        = classfee.ClassId,
                 Class          = classfee.Class.Name,
                 FeeTypeId      = classfee.FeeTypeId,
                 FeeType        = classfee.FeeType.Name,
                 StatusId       = classfee.StatusId,
                 Status         = classfee.Status.Name,
                 Description    = classfee.Description
             };
             return(classFee);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 2
0
 public bool AddClassFee(ClassFee classFee)
 {
     try
     {
         var classFees = new DataModel.ClassFee
         {
             Id             = Guid.NewGuid(),
             ClassId        = classFee.ClassId,
             FeeTypeId      = classFee.FeeTypeId,
             FeeAmount      = classFee.FeeAmount,
             FineAmount     = classFee.FineAmount,
             DiscountAmount = classFee.DiscountAmount,
             FeeDueDate     = _schoolFeeDueDate,
             Description    = classFee.Description,
             StatusId       = classFee.StatusId,
             CreatedBy      = _username,
             CreatedDate    = DateTime.UtcNow
         };
         var result      = _feeDataAccess.AddClassFee(classFees);
         var returnValue = result > 0 ? true : false;
         return(returnValue);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 3
0
 public bool EditClassFee(ClassFee classFee)
 {
     try
     {
         DataModel.ClassFee classfee = _feeDataAccess.ClassFeeById(classFee.Id);
         if (classfee != null)
         {
             classfee.ClassId        = classFee.ClassId;
             classfee.FeeTypeId      = classFee.FeeTypeId;
             classfee.FeeAmount      = classFee.FeeAmount;
             classfee.FineAmount     = classFee.FineAmount;
             classfee.DiscountAmount = classFee.DiscountAmount;
             classfee.FeeDueDate     = _schoolFeeDueDate;
             classfee.Description    = classFee.Description;
             classfee.StatusId       = classFee.StatusId;
             classfee.ModifiedBy     = _username;
             classfee.ModifiedDate   = DateTime.UtcNow;
         }
         var result      = _feeDataAccess.EditClassFee(classfee);
         var returnValue = result > 0 ? true : false;
         return(returnValue);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 4
0
        public ActionResult DeleteConfirmed(int id)
        {
            ClassFee classFee = db.ClassFee.Find(id);

            db.ClassFee.Remove(classFee);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 5
0
 public List <ClassFee> ClassFee(Guid?feetypeId, Guid?classId)
 {
     try
     {
         var returnValue = new List <ClassFee>();
         IEnumerable <DataModel.ClassFee> classfee = new List <DataModel.ClassFee>();
         if (feetypeId.HasValue && feetypeId != Guid.Empty)
         {
             classfee = _feeDataAccess.SearchTypeByFeeTypeId(feetypeId.Value);
         }
         else if (classId.HasValue)
         {
             classfee = _feeDataAccess.SearchTypeByClassId(classId.Value);
         }
         else
         {
             classfee = _feeDataAccess.ClassFee();
         }
         if (classfee != null)
         {
             foreach (var item in classfee)
             {
                 var classFee = new ClassFee
                 {
                     Id             = item.Id,
                     FeeAmount      = item.FeeAmount,
                     FineAmount     = item.FineAmount,
                     DiscountAmount = item.DiscountAmount,
                     FeeDueDate     = item.FeeDueDate,
                     ClassId        = item.ClassId,
                     Class          = item.Class.Name,
                     FeeTypeId      = item.FeeTypeId,
                     FeeType        = item.FeeType.Name,
                     StatusId       = item.StatusId,
                     Status         = item.Status.Name,
                     Description    = item.Description,
                     FeePeriodName  = item.FeeType.FeePeriod.Name,
                     FeeOccurence   = item.FeeType.FeePeriod.Occurence
                 };
                 returnValue.Add(classFee);
             }
         }
         if (returnValue.Count > 0)
         {
             return(returnValue);
         }
         else
         {
             return(null);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 6
0
 public ActionResult Edit([Bind(Include = "Id,AdmissionFee,ClassNameId")] ClassFee classFee)
 {
     if (ModelState.IsValid)
     {
         db.Entry(classFee).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ClassNameId = new SelectList(db.ClassName, "ID", "Name", classFee.ClassNameId);
     return(View(classFee));
 }
Exemplo n.º 7
0
        // POST: odata/ClassFees
        public async Task <IHttpActionResult> Post(ClassFee classFee)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.ClassFees.Add(classFee);
            await db.SaveChangesAsync();

            return(Created(classFee));
        }
Exemplo n.º 8
0
 public void add(ClassFee obj)
 {
     try
     {
         _service.Add(obj);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         throw;
     }
 }
 public int AddClassFee(ClassFee classFees)
 {
     try
     {
         _dbContext.ClassFee.Add(classFees);
         return(_dbContext.SaveChanges());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public IActionResult DeleteClassFee([FromBody] ClassFee classFee)
 {
     try
     {
         var result = _feeBusiness.DeleteClassFee(classFee.Id);
         return(Ok(result));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex));
     }
 }
 public int EditClassFee(ClassFee classfee)
 {
     try
     {
         _dbContext.ClassFee.Add(classfee);
         _dbContext.Entry(classfee).State = EntityState.Modified;
         return(_dbContext.SaveChanges());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 12
0
        // DELETE: odata/ClassFees(5)
        public async Task <IHttpActionResult> Delete([FromODataUri] short key)
        {
            ClassFee classFee = await db.ClassFees.FindAsync(key);

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

            db.ClassFees.Remove(classFee);
            await db.SaveChangesAsync();

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemplo n.º 13
0
        // GET: ClassFees/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ClassFee classFee = db.ClassFee.Find(id);

            if (classFee == null)
            {
                return(HttpNotFound());
            }
            return(View(classFee));
        }
Exemplo n.º 14
0
        // GET: ClassFees/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ClassFee classFee = db.ClassFee.Find(id);

            if (classFee == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ClassNameId = new SelectList(db.ClassName, "ID", "Name", classFee.ClassNameId);
            return(View(classFee));
        }
Exemplo n.º 15
0
        // PUT: odata/ClassFees(5)
        public async Task <IHttpActionResult> Put([FromODataUri] short key, Delta <ClassFee> patch)
        {
            Validate(patch.GetEntity());

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

            ClassFee classFee = await db.ClassFees.FindAsync(key);

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

            patch.Put(classFee);

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

            return(Updated(classFee));
        }
Exemplo n.º 16
0
        public void Add(ClassFee obj)
        {
            var result = _interface.Add(obj);

            _interface.SaveChanges();
        }