public async Task <int> ShipmentAlerts_Add_New(Shipment_Alert obj) { using (var con = DbHelper.GetSqlConnection()) { return(await con.ExecuteAsync(ShipmentAlerts_Add_NewSP, new { obj.Address, obj.Channel, obj.Client_Id, obj.Comments, obj.Date, obj.Latitude, obj.Longitude, obj.Reason, obj.Scheduling_Status_Code, obj.Scheduling_Status_Name, obj.Status, obj.Status_Code, obj.Status_Name, obj.Timeslot, obj.Tracking_Id }, commandType : CommandType.StoredProcedure)); } }
public async Task <JsonResult> Shipment_Call_Back([FromBody] Shipment_Alert obj) { var result = await _shop_repo.ShipmentAlerts_Add_New(obj); var shipment = new Shipment_Notification(); shipment.Shipment_Alert = obj; shipment.Cart = await _shop_repo.Shopping_Cart_Items_Get_By_Shipment_Id(obj.Tracking_Id); var cart = await _shop_repo.Shopping_Cart_Tracking_Get_By_Id(shipment.Cart.Tracking_Id); var addr = await _addr_repo.Get_By_Id(cart.Shipping_Address_Id); await _sms_sender.SendSmsAsync(string.Format("{0}{1}", addr.ISDCode, addr.PhoneNumber), string.Format("Dear {0}, Your shipment for order #{1} is now {2}. ", cart.Name, cart.Id, obj.Status)); return(Json(result)); }