Subversion Repositories SmartDukaan

Rev

Rev 7263 | Rev 7285 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7263 Rev 7267
Line 4764... Line 4764...
4764
    session.commit()
4764
    session.commit()
4765
 
4765
 
4766
    return rechargeTransaction
4766
    return rechargeTransaction
4767
 
4767
 
4768
def get_frcs(circleId, operatorId):
4768
def get_frcs(circleId, operatorId):
-
 
4769
    query = FRC.query.filter(FRC.circleId == circleId)
-
 
4770
    if(operatorId > 0):
4769
    frcs = FRC.query.filter(FRC.circleId == circleId).filter(FRC.operatorId == operatorId).all()
4771
        query = query.filter(FRC.operatorId == operatorId)
-
 
4772
        
-
 
4773
    frcs = query.all()
-
 
4774
    
4770
    if frcs is None:
4775
    if frcs is None:
4771
        return []
4776
        return []
4772
    return frcs
4777
    return frcs
4773
 
4778
 
4774
def get_recharge_transaction(rechargeId):
4779
def get_recharge_transaction(rechargeId):
Line 4969... Line 4974...
4969
    detail = SourceDetail.get_by(id=source)
4974
    detail = SourceDetail.get_by(id=source)
4970
    if not detail:
4975
    if not detail:
4971
        raise TransactionServiceException(108, "no such source")
4976
        raise TransactionServiceException(108, "no such source")
4972
    return detail
4977
    return detail
4973
 
4978
 
-
 
4979
def get_all_circles():
-
 
4980
    circles = TelecomCircle.query.all();
-
 
4981
    if not circles:
-
 
4982
        circles = []
-
 
4983
    return circles 
-
 
4984
 
-
 
4985
def delete_frcs(frcIdsToDelete):
-
 
4986
    toReturn = False
-
 
4987
    if frcIdsToDelete:
-
 
4988
        for frcId in frcIdsToDelete:
-
 
4989
            frc = FRC.get_by(id = frcId)
-
 
4990
            if frc:
-
 
4991
                frc.delete()
-
 
4992
                toReturn = True
-
 
4993
        session.commit()
-
 
4994
        return toReturn
-
 
4995
    else:
-
 
4996
        return toReturn
-
 
4997
 
-
 
4998
 
4974
if __name__ == '__main__':
4999
if __name__ == '__main__':
4975
    print 'helllo'
5000
    print 'helllo'
4976
5001