public async void Assign(string idOrder, string idDriver) { bool isDriverAssign = _sqlEntityFramworke.CheckDriverOnShipping(idOrder); string tokenShope = null; if (isDriverAssign) { tokenShope = _sqlEntityFramworke.GerShopTokenForShipping(idOrder); } List <VehiclwInformation> vehiclwInformations = await _sqlEntityFramworke.AddDriversInOrder(idOrder, idDriver); Task.Run(() => { ManagerNotifyWeb managerNotify = new ManagerNotifyWeb(); string tokenShope1 = _sqlEntityFramworke.GerShopTokenForShipping(idOrder); if (!isDriverAssign) { managerNotify.SendNotyfyAssign(idOrder, tokenShope1, vehiclwInformations); } else { managerNotify.SendNotyfyAssign(idOrder, tokenShope1, vehiclwInformations); managerNotify.SendNotyfyUnassign(idOrder, tokenShope, vehiclwInformations); } }); }
public async void Unassign(string idOrder) { ManagerNotifyWeb managerNotify = new ManagerNotifyWeb(); string tokenShope = _sqlEntityFramworke.GerShopTokenForShipping(idOrder); List <VehiclwInformation> vehiclwInformations = await _sqlEntityFramworke.RemoveDriversInOrder(idOrder); Task.Run(() => { managerNotify.SendNotyfyUnassign(idOrder, tokenShope, vehiclwInformations); }); }