| Line 936... |
Line 936... |
| 936 |
class AddAddressToRetailer():
|
936 |
class AddAddressToRetailer():
|
| 937 |
def on_post(self,req,resp, agentId):
|
937 |
def on_post(self,req,resp, agentId):
|
| 938 |
agentId = int(agentId)
|
938 |
agentId = int(agentId)
|
| 939 |
jsonReq = json.loads(req.stream.read(), encoding='utf-8')
|
939 |
jsonReq = json.loads(req.stream.read(), encoding='utf-8')
|
| 940 |
retailerId = int(jsonReq.get("retailerid"))
|
940 |
retailerId = int(jsonReq.get("retailerid"))
|
| 941 |
address = jsonReq.get("address")
|
941 |
address = str(jsonReq.get("address"))
|
| 942 |
storeName = jsonReq.get("storename")
|
942 |
storeName = str(jsonReq.get("storename"))
|
| 943 |
pin = jsonReq.get("pin")
|
943 |
pin = str(jsonReq.get("pin"))
|
| 944 |
city = jsonReq.get("city")
|
944 |
city = str(jsonReq.get("city"))
|
| 945 |
state = jsonReq.get("state")
|
945 |
state = str(jsonReq.get("state"))
|
| 946 |
updateType = jsonReq.get("updatetype")
|
946 |
updateType = str(jsonReq.get("updatetype"))
|
| 947 |
addAddressToRetailer(agentId, retailerId, address, storeName, pin, city,state, updateType)
|
947 |
addAddressToRetailer(agentId, retailerId, address, storeName, pin, city,state, updateType)
|
| 948 |
|
948 |
|
| 949 |
def addContactToRetailer(agentId, retailerId, mobile, callType, contactType):
|
949 |
def addContactToRetailer(agentId, retailerId, mobile, callType, contactType):
|
| 950 |
retailerContact = session.query(RetailerContacts).filter_by(retailer_id=retailerId).filter_by(mobile_number=mobile).first()
|
950 |
retailerContact = session.query(RetailerContacts).filter_by(retailer_id=retailerId).filter_by(mobile_number=mobile).first()
|
| 951 |
if retailerContact is None:
|
951 |
if retailerContact is None:
|