/// <summary> /// This method is used to delete particular farmer detail /// </summary> /// <param name="AssetId">Unique id of asset</param> /// <returns>Response</returns> public object DeleteFeeCollectionDetail(FeeCollectionCustomModel objModel) { object objClassResult = new object(); using (response = new Response()) { using (dbcontext = new SchoolManagementEntities()) { try { var rs = dbcontext.tblFeeCollections.FirstOrDefault(x => x.FeeCollectionId == objModel.FeeCollectionId); if (rs != null) { dbcontext.Delete_Fee_Collection(objModel.FeeCollectionId, objModel.ModifiedBy); //rs.IsDeleted = true; //rs.ModifiedDate = DateTime.Now; //rs.ModifiedBy = objModel.ModifiedBy; //dbcontext.SaveChanges(); objClassResult = true; } else { objClassResult = false; } } catch (Exception ex) { dbcontext.Dispose(); objClassResult = null; throw ex; } } return(objClassResult); } }