private InsertarTap Insertar_TapNewInfo(InsertarTap NewInfo) { try { string url = "http://201.236.222.217:5154/API/etp_app/taps/InsertarInfo/"; int idTap = Convert.ToInt32(NewInfo.IdTap.ToString()); string Tap = NewInfo.Tipo.ToString(); string SubTipoAC = NewInfo.SubTipoAC.ToString(); string SubtipoNEW = NewInfo.SubtipoNEW.ToString(); int CodFAC = Convert.ToInt16(NewInfo.CodFAC.ToString()); int CodFNEW = Convert.ToInt16(NewInfo.CodFNEW.ToString()); string MACT = NewInfo.MACT.ToString(); string MNEW = NewInfo.MNEW.ToString(); string usuario = NewInfo.usuario.ToString(); string urlinsert = (url + "?IdTap=" + idTap + "&Tipo=" + Tap + "&SubTipoAC=" + SubTipoAC + "&SubtipoNEW=" + SubtipoNEW + "&CodFAC=" + CodFAC + "&CodFNEW=" + CodFNEW + "&MACT=" + MACT + "&MNEW=" + MNEW + "&usuario=" + usuario); var result = urlinsert.GetRequest<InsertarTap>(); if (result == null) { AlertDialog.Builder alertDiag = new AlertDialog.Builder(this); alertDiag.SetTitle("ERROR"); alertDiag.SetMessage("Error al Enviar Informacion"); alertDiag.SetNegativeButton("OK", (senderAlert, args) => { //StartActivity(typeof(ActualizarTap)); //SetContentView(Resource.Layout.Fragment_Actualizar); }); Dialog diag = alertDiag.Create(); diag.Show(); } } catch (Exception ex) { //ex.Message; return null; } return NewInfo; }
private void DataToSend() { mProgress = new ProgressDialog(this); mProgress.SetCancelable(true); mProgress.SetMessage("Enviando Informacion....."); mProgress.SetProgressStyle(ProgressDialogStyle.Spinner); mProgress.Progress = 0; mProgress.Max = 100; mProgress.Show(); insertarTaps = new InsertarTap(); insertarTaps.IdTap = IdTapConsulta; insertarTaps.Tipo = "TAP"; if (ItemPositionTipo == 0) { insertarTaps.SubTipoAC = Tipo1; insertarTaps.SubtipoNEW = Tipo1; } else { insertarTaps.SubTipoAC = Tipo1; insertarTaps.SubtipoNEW = Tipo2; } if (ItemPositionFab == 0) { insertarTaps.CodFAC = CodFabricacion1; insertarTaps.CodFNEW = CodFabricacion1; } else { insertarTaps.CodFAC = CodFabricacion1; insertarTaps.CodFNEW = CodFabNew; } if (ItemPositionMod == 0) { insertarTaps.MACT = Modelo1; insertarTaps.MNEW = Modelo1; } else { insertarTaps.MACT = Modelo1; insertarTaps.MNEW = Modelo2; } insertarTaps.usuario = LogUsuario; var Insertado = Insertar_TapNewInfo(insertarTaps); if (Insertado != null) { AlertDialog.Builder alertDiag = new AlertDialog.Builder(this); alertDiag.SetTitle("INVIO DE DATOS"); alertDiag.SetMessage("DATOS ENVIADOS CON EXITO"); alertDiag.SetPositiveButton("OK", (senderAlert, args) => { var intent = new Intent(this, typeof(ConsultarTap)); intent.PutExtra("x", x); intent.PutExtra("y", y); intent.PutExtra("reference", reference); StartActivity(intent); Toast.MakeText(this, "OK", ToastLength.Long).Show(); }); Dialog diag = alertDiag.Create(); diag.Show(); } else { AlertDialog.Builder alertDiag = new AlertDialog.Builder(this); alertDiag.SetTitle("INVIO DE DATOS"); alertDiag.SetMessage("FALLO AL ENVIAR DATOS"); alertDiag.SetPositiveButton("OK", (senderAlert, args) => { Toast.MakeText(this, "ERROR", ToastLength.Long).Show(); }); Dialog diag = alertDiag.Create(); diag.Show(); } mProgress.Dismiss(); }