Subversion Repositories SmartDukaan

Rev

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

Rev 5530 Rev 5591
Line 418... Line 418...
418
            invoiceObj.supplierId = invoice.supplierId
418
            invoiceObj.supplierId = invoice.supplierId
419
            session.commit()
419
            session.commit()
420
        finally:
420
        finally:
421
            self.close_session()        
421
            self.close_session()        
422
 
422
 
-
 
423
    def addSupplier(self, supplier):
-
 
424
        """
-
 
425
        Creates a supplier
-
 
426
    
-
 
427
        Parameters:
-
 
428
         - supplier
-
 
429
        """
-
 
430
        try:
-
 
431
            supplierObj = Supplier()
-
 
432
            supplierObj.communicationAddress = supplier.communicationAddress
-
 
433
            supplierObj.contactEmail = supplier.contactEmail
-
 
434
            supplierObj.contactFax = supplier.contactFax
-
 
435
            supplierObj.contactName = supplier.contactName
-
 
436
            supplierObj.contactPhone = supplier.contactPhone
-
 
437
            supplierObj.fax = supplier.fax
-
 
438
            supplierObj.headDesignation = supplier.headDesignation
-
 
439
            supplierObj.headEmail = supplier.headEmail
-
 
440
            supplierObj.headName = supplier.headName
-
 
441
            supplierObj.name = supplier.name
-
 
442
            supplierObj.pan = supplier.pan
-
 
443
            supplierObj.phone = supplier.phone
-
 
444
            supplierObj.registeredAddress = supplier.registeredAddress
-
 
445
            supplierObj.tin = supplier.tin
-
 
446
            session.commit()
-
 
447
            return self.getSupplier(supplierObj.id)
-
 
448
        finally:
-
 
449
            self.close_session()
-
 
450
 
-
 
451
    def updateSupplier(self, supplier):
-
 
452
        """
-
 
453
        Updates a supplier
-
 
454
    
-
 
455
        Parameters:
-
 
456
         - supplier
-
 
457
        """
-
 
458
        try:
-
 
459
            supplierObj = Supplier.get(supplier.id)
-
 
460
            supplierObj.communicationAddress = supplier.communicationAddress
-
 
461
            supplierObj.contactEmail = supplier.contactEmail
-
 
462
            supplierObj.contactFax = supplier.contactFax
-
 
463
            supplierObj.contactName = supplier.contactName
-
 
464
            supplierObj.contactPhone = supplier.contactPhone
-
 
465
            supplierObj.fax = supplier.fax
-
 
466
            supplierObj.headDesignation = supplier.headDesignation
-
 
467
            supplierObj.headEmail = supplier.headEmail
-
 
468
            supplierObj.headName = supplier.headName
-
 
469
            supplierObj.name = supplier.name
-
 
470
            supplierObj.pan = supplier.pan
-
 
471
            supplierObj.phone = supplier.phone
-
 
472
            supplierObj.registeredAddress = supplier.registeredAddress
-
 
473
            supplierObj.tin = supplier.tin
-
 
474
            session.commit()
-
 
475
        finally:
-
 
476
            self.close_session()
-
 
477
 
423
    def isAlive(self, ):
478
    def isAlive(self, ):
424
        """
479
        """
425
        For checking weather service is active alive or not. It also checks connectivity with database
480
        For checking weather service is active alive or not. It also checks connectivity with database
426
        """
481
        """
427
        try:
482
        try: