protected void btn_terminarCarga_Click(object sender, EventArgs e) { SolicitudAndenesBC anden = new SolicitudAndenesBC(); anden.SOLI_ID = int.Parse(hf_idSolicitud.Value); anden.LUGA_ID = int.Parse(hf_idLugar.Value); anden.SOAN_ORDEN = int.Parse(hf_orden.Value); switch (hf_idEstado.Value) { case "Cargado": anden.FECHA_CARGA_FIN = DateTime.Parse(txt_fechaCarga.Text + " " + txt_horaCarga.Text); string resultado; bool ejecucion = anden.CompletarCarga(anden, usuario.ID, out resultado); if (ejecucion && resultado == "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "showAlert('CARGA COMPLETA, DISPONIBLE PARA PONER SELLO');", true); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar", "cerrarModal('modalCarga');", true); ObtenerSolicitudes(true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('" + resultado + "');", true); } break; case "Parcial": anden.FECHA_CARGA_FIN = DateTime.Parse(txt_fechaCarga.Text + " " + txt_horaCarga.Text); anden.PALLETS_CARGADOS = int.Parse(txt_palletsCargados.Text); string resultado1; bool ejecucion1 = anden.InterrumpirCarga(anden, usuario.ID, out resultado1); if (ejecucion1 && resultado1 == "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "showAlert('CARGA PARCIAL');", true); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "cerrar", "cerrarModal('modalCarga');", true); ObtenerSolicitudes(true); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('" + resultado1 + "');", true); } break; default: ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "modal", "alert('Se produjo un error');", true); break; } btn_buscarSolicitud_Click(null, null); }
protected void btn_cargaTerminar_Click(object sender, EventArgs e) { SolicitudAndenesBC anden = new SolicitudAndenesBC(); anden.SOLI_ID = Convert.ToInt32(this.hf_soliId.Value); anden.LUGA_ID = Convert.ToInt32(this.hf_lugaId.Value); anden.SOAN_ORDEN = Convert.ToInt32(this.hf_soanOrden.Value); anden.FECHA_CARGA_FIN = DateTime.Parse(string.Format("{0} {1}", this.txt_fechaCarga.Text, this.txt_horaCarga.Text)); string resultado; bool ejecucion = anden.CompletarCarga(anden, this.usuario.ID, out resultado); if (ejecucion && resultado == "") { utils.ShowMessage2(this, "cargaCompleta", "success"); utils.CerrarModal(this, "modalCarga"); this.ObtenerSolicitudes(true); } else { utils.ShowMessage(this, resultado, "error", false); } this.ObtenerSolicitudes(true); }