public bool PickCustomerLocation(PickCustomerLocation customerLocation) { try { if (!String.IsNullOrEmpty(customerLocation.ContractId)) { Entity entity = GlobalCode.Service.Retrieve(CrmEntityName, new Guid(customerLocation.ContractId), new ColumnSet("new_contracttype")); if (!String.IsNullOrEmpty(customerLocation.Latitude)) { entity["new_latitude"] = customerLocation.Latitude; entity["new_longitude"] = customerLocation.Longitude; entity["new_mapurl"] = "http://maps.google.com/maps?q=" + customerLocation.Latitude + "," + customerLocation.Longitude + "&z=15"; GlobalCode.Service.Update(entity); return(true); } } } catch (Exception ex) { return(false); } return(false); }
public HttpResponseMessage Post(PickCustomerLocation CustomerLocation) { var result = Manager.PickCustomerLocation(CustomerLocation); return(OkResponse <bool>(result)); }