protected void btnAnular_Click(object sender, EventArgs e) { string idlogin = Session["rpta"].ToString().ToUpper(); //actualizar guiacabecera GuiaCabeceraN objEstadoGuia = new GuiaCabeceraN(); GuiaCabeceraEn objGuiaEn = new GuiaCabeceraEn(); objGuiaEn.IdGuia = xidGuia; objGuiaEn.IdLoginAnulado = int.Parse(idlogin); objGuiaEn.FechaAnulacion = DateTime.Parse(txtFecha.Text); objGuiaEn.IdEstado = int.Parse(txtEstado.Text); objGuiaEn.ip = Request.UserHostAddress; string cod = objEstadoGuia.ActualizarEstadoGuia(objGuiaEn); //string mensaje = ("<script language ='JavaScript'>window.confirm('Va a salir de la aplicación ¿Desea salir realmente?'); </script>"); //if (mensaje == "Ok") //{ // this.Page.Response.Write("<script language ='JavaScript'>window.alert('Gracias por visitarnos'); </script>"); //} //var mensaj = (this.Page.Response.Write("<script language ='JavaScript'>window.confirm('Va a salir de la aplicación ¿Desea salir realmente?'); </script>")); this.Page.Response.Write("<script language ='JavaScript'>window.alert('Se Anulo la Guia del Activo'); </script>"); btnRecepcion.Enabled = false; btnReparacion.Enabled = false; btnImprimir.Enabled = false; btnAnular.Enabled = false; }
protected void btnBuscar_Click(object sender, EventArgs e) { GuiaCabeceraEn objGuia = new GuiaCabeceraEn(); GuiaCabeceraEn objGuia2 = new GuiaCabeceraEn(); LogisticaEn objCodigo = new LogisticaEn(); //GuiaCabeceraEn IdGuia = new GuiaCabeceraEn(); SedeEn objSede = new SedeEn(); SedeEn objSede2 = new SedeEn(); objGuia.IdMotivoTraslado = int.Parse(ddlTraslado.SelectedValue); objGuia.Activos = int.Parse(cboTipoGuia.SelectedValue); objSede.IdSede = int.Parse(ddlSedePatida.SelectedValue); objGuia2.IdEstado = int.Parse(ddlEstado.SelectedValue); //IdGuia.IdGuia = int.Parse(txtNumeroGuia.Text); objSede2.IdSede = int.Parse(ddlSedeLlegada.SelectedValue); DateTime vfechaini = Convert.ToDateTime(txtFechaDesde.Text); DateTime vfechafin = Convert.ToDateTime(txtFechaHasta.Text); string vGuia = txtNumeroGuia.Text; objCodigo.Codigo = txtCodigo.Text; ReportesN obj = new ReportesN(); DataTable dtGuia = new DataTable(); dtGuia = obj.ReporteGuia(objGuia, objSede, objSede2, vfechaini, vfechafin, objGuia2, vGuia, objCodigo); dtDatos.Rows.Clear(); string detalle = ""; foreach (DataRow row in dtGuia.Rows) { detalle = obj.fun_GuiaDetalle_mostrarUno(Convert.ToInt32(row["idGuia"]), Convert.ToInt16(row["Activos"])); detalle = objFun.fun_RemplazarLetras(detalle); dtDatos.Rows.Add(row["idGuia"], row["Usuario"], row["Fecha_Envio"], row["Transportista"], row["Punto_Partida"], row["Punto_Llegada"], row["Motivo_Traslado"], row["Activos"], row["Usuario_Recepciona"], row["Usuario_Anulacion"], row["Fecha_Recepcion"], row["Fecha_Anulacion"], row["estado"], detalle); } ViewState.Add("dtDatos", dtDatos); gvGuia.DataSource = dtDatos; gvGuia.DataBind(); }
public void pr_registrar_auditoria_guia(GuiaCabeceraEn ObjG) { try { objguia.registrar_auditoria_guia(ObjG); } catch (Exception ex) { throw new Exception(ex.Message); } }
public string InsertarGuiaCabecera(GuiaCabeceraEn ObjG) { int rpta = 0; { using (SqlConnection cn = new SqlConnection(cad_cn)) { // try cn.Open(); SqlCommand cmd = new SqlCommand("uspInsertarGuiaCabecera", cn); cmd.CommandType = CommandType.StoredProcedure; // cmd.Parameters.AddWithValue("@IdGuia", ObjG.IdGuia); cmd.Parameters.AddWithValue("@IdLogin", ObjG.IdLogin); cmd.Parameters.AddWithValue("@SedePartida", ObjG.SedePartida); cmd.Parameters.AddWithValue("@SedeLlegada", ObjG.SedeLlegada); cmd.Parameters.AddWithValue("@OrigenDestinoExterno", ObjG.OrigenDestinoExterno); cmd.Parameters.AddWithValue("@Fecha", ObjG.Fecha); cmd.Parameters.AddWithValue("@Transportista", ObjG.Transportista); cmd.Parameters.AddWithValue("@IdMotivoTraslado", ObjG.IdMotivoTraslado); cmd.Parameters.AddWithValue("@Activos", ObjG.Activos); cmd.Parameters.AddWithValue("@IdEstado", ObjG.IdEstado); cmd.Parameters.AddWithValue("@observ", ObjG.observ); //adicionar campos detalle //cmd.Parameters.AddWithValue("@IdUnidadMedida", ObjD.IdUnidadMedida); //cmd.Parameters.AddWithValue("@IdLogistica", ObjD.IdLogistica); SqlParameter retval = new SqlParameter("@IdGuia", 0); retval.Direction = ParameterDirection.Output; cmd.Parameters.Add(retval); cmd.ExecuteNonQuery(); rpta = Int32.Parse((cmd.Parameters["@IdGuia"].Value.ToString())); //if (rpta == 0) //{ cmd.Dispose(); return(Convert.ToString(rpta)); //} // rpta = "Se Guardó Correctamente"; cmd.ExecuteNonQuery(); //catch //return rpta; } } }
public GuiaCabeceraEn fun_Traer_datos_guia(int idGuia) { try { DataTable dt = new DataTable(); GuiaCabeceraEn guia = new GuiaCabeceraEn(); dt = objguia.Traer_datos_guia(idGuia); guia.Fecha = Convert.ToDateTime(dt.Rows[0]["fecha"]); guia.Transportista = dt.Rows[0]["Transportista"].ToString(); return(guia); } catch (Exception ex) { throw new Exception(ex.Message); } }
private void CargarDatos() { GuiaCabeceraEn guia = new GuiaCabeceraEn(); ReportesN objGuiaDetalle = new ReportesN(); guia = objGuia.fun_Traer_datos_guia(xidGuia); DateTime fecha = DateTime.Now; txtFechaFin.Text = (fecha.ToString("yyyy-MM-dd")); txtFechaEnvio.Text = guia.Fecha.ToString("yyyy-MM-dd"); txtProveedor.Text = guia.Transportista; DataTable DTDetalleGuia = objGuiaDetalle.ReporteGuiaDetalle(xidGuia, 1); gvRepara.DataSource = DTDetalleGuia; gvRepara.DataBind(); }
public string ActualizarGuiaCabecera(GuiaCabeceraEn ObjG) { { string rpta = ""; using (SqlConnection cn = new SqlConnection(cad_cn)) { // try cn.Open(); SqlCommand cmd = new SqlCommand("uspActualizarGuiaCabecera", cn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@IdGuia", ObjG.IdGuia); cmd.Parameters.AddWithValue("@IdLoginRecibido", ObjG.IdLoginRecibido); cmd.Parameters.AddWithValue("@FechaRecepcion", ObjG.FechaRecepcion); cmd.Parameters.AddWithValue("@ip", ObjG.ip); rpta = "Se Actualizó Correctamente"; cmd.ExecuteNonQuery(); } return(rpta); } }
public void registrar_auditoria_guia(GuiaCabeceraEn ObjG) { try { using (SqlConnection cn = new SqlConnection(cad_cn)) { cn.Open(); SqlCommand cmd = new SqlCommand("uspGuiaAuditoria", cn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@activos", ObjG.Activos); cmd.Parameters.AddWithValue("@codGuia", ObjG.IdGuia); cmd.Parameters.AddWithValue("@idLogin", ObjG.IdLogin); cmd.Parameters.AddWithValue("@ip", ObjG.ip); cmd.ExecuteNonQuery(); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public DataTable ReporteGuia(GuiaCabeceraEn objGC, SedeEn objSede, SedeEn objSede2, DateTime dfechaini, DateTime dfechafin, GuiaCabeceraEn objEstado, string IdGuia, LogisticaEn objCodigo) { DataTable tb = new DataTable(); using (SqlDataAdapter adap = new SqlDataAdapter("uspReporterGuia", cad_cn)) { adap.SelectCommand.CommandType = CommandType.StoredProcedure; adap.SelectCommand.Parameters.AddWithValue("@MotivoTraslado", objGC.IdMotivoTraslado); adap.SelectCommand.Parameters.AddWithValue("@SedePartida", objSede.IdSede); adap.SelectCommand.Parameters.AddWithValue("@SedeLlegada", objSede2.IdSede); adap.SelectCommand.Parameters.AddWithValue("@FechaIni", dfechaini); adap.SelectCommand.Parameters.AddWithValue("@FechaFin", dfechafin); adap.SelectCommand.Parameters.AddWithValue("@Estado", objEstado.IdEstado); adap.SelectCommand.Parameters.AddWithValue("@Idguia", IdGuia); adap.SelectCommand.Parameters.AddWithValue("@codigo", objCodigo.Codigo); adap.SelectCommand.Parameters.AddWithValue("@tipo", objGC.Activos); adap.Fill(tb); } return(tb); }
protected void btnGuardar_Click(object sender, EventArgs e) { if (gvDetalle.Rows.Count == 0) { this.Page.Response.Write("<script language ='JavaScript'>window.alert('No existen activos agregados en la lista de la guía. Verifique por favor.');</script>"); return; } if (String.IsNullOrEmpty(Transportista.Text)) { this.Page.Response.Write("<script language ='JavaScript'>window.alert('Ingrese Transportista.');</script>"); Transportista.Focus(); return; } if (ddlMotivoTrasldo.SelectedIndex == 0) { this.Page.Response.Write("<script language ='JavaScript'>window.alert('Seleccione Motivo de Traslado.');</script>"); ddlMotivoTrasldo.Focus(); return; } if (ddlPuntoPartida.SelectedIndex == 0) { this.Page.Response.Write("<script language ='JavaScript'>window.alert('Seleccione Punto de Partida.');</script>"); ddlPuntoPartida.Focus(); return; } if (ddlPuntoLlegada.SelectedIndex == 0) { this.Page.Response.Write("<script language ='JavaScript'>window.alert('Seleccione Punto de Llegada.');</script>"); ddlPuntoLlegada.Focus(); return; } if (ddlPuntoLlegada.SelectedItem.ToString() == "Otros") { if (txtllegada.Text == "") { this.Page.Response.Write("<script language ='JavaScript'>window.alert('Especifique Punto de Llegada.');</script>"); txtllegada.Focus(); return; } } GuiaCabeceraEn ObjInsertGuia = new GuiaCabeceraEn(); GuiaDetalleActivosEn ObjInsertDet = new GuiaDetalleActivosEn(); ObjInsertGuia.IdLogin = int.Parse(Session["rpta"].ToString().ToUpper()); ObjInsertGuia.SedePartida = ddlPuntoPartida.SelectedValue; ObjInsertGuia.SedeLlegada = ddlPuntoLlegada.SelectedValue; ObjInsertGuia.OrigenDestinoExterno = txtllegada.Text; ObjInsertGuia.Fecha = DateTime.Now; //DateTime.Parse(TxtFecha.Text); ObjInsertGuia.Transportista = Transportista.Text; ObjInsertGuia.IdMotivoTraslado = int.Parse(ddlMotivoTrasldo.SelectedValue); ObjInsertGuia.Activos = 1; ObjInsertGuia.IdEstado = int.Parse(txtEstado.Text); ObjInsertGuia.observ = txtObserv.Text.Trim(); ObjInsertGuia.ip = Request.UserHostAddress; GuiaCabeceraN objGC = new GuiaCabeceraN(); string rpta = ""; rpta = objGC.InsertarGuiaCabecera(ObjInsertGuia); hdnIdGuia.Value = rpta; //Session["rpta"]=rpta; GuiaDetalleActivoN objDetalle = new GuiaDetalleActivoN(); FacturaEn ObjInsertFactura = new FacturaEn();//**// FacturaN ObjFacGuia = new FacturaN(); //adicionar temporal activos ObjInsertDet.IdGuia = int.Parse(rpta); // ObjInsertDet.IdUnidadMedida = int.Parse(ddlUnidadMedida.SelectedValue); int cant = 0; cant = gvDetalle.Rows.Count; for (int i = 0; i < cant; i += 1) { ObjInsertFactura.IdLogistica = int.Parse(gvDetalle.Rows[i].Cells[0].Text);//**// ObjInsertFactura.Ruc = txtRuc.Text.Trim(); ObjInsertFactura.Proveedor = Transportista.Text.Trim(); ObjInsertFactura.Direccion = txtDireccion.Text.Trim(); ObjFacGuia.pr_registrar_factura_guia(ObjInsertFactura);//**// ObjInsertDet.IdLogistica = int.Parse(gvDetalle.Rows[i].Cells[0].Text); //gvEmpleados.DataKeys[e.NewSelectedIndex].Values // int id = Convertir .ToInt32 (GridView1.DataKeys [e.Row.RowIndex] .values [0]); // int id = Convert.ToInt32(gvDetalle.DataKeys[i].Values[0]); ObjInsertDet.IdUnidadMedida = Convert.ToInt32(gvDetalle.DataKeys[i].Values[0]); objDetalle.InsertarGuiaDetalleActivos(ObjInsertDet); } ObjInsertGuia.IdGuia = int.Parse(rpta); objGC.pr_registrar_auditoria_guia(ObjInsertGuia); this.Page.Response.Write("<script language ='JavaScript'>window.alert('Guia registrada correctamente.');</script>"); //vaciar tabla temporal // GuiaTemporalN guia = new GuiaTemporalN(); // gvDetalle.DataSource = guia.EliminarGuiaTemporal(); // limpiar(); //rpta captura el id de la guia //prueba de consulta hdIdGuia.Value = rpta; gvconsulta.DataSource = objDetalle.BuscarGuiaActivos(rpta); //string login = gvconsulta.Rows[0].Cells[2].Text; hdusuario.Value = Session["Usuario"].ToString().ToUpper(); gvconsulta.DataBind(); btnNuevo.Enabled = true; btnGuardar.Enabled = false; btnImprimir.Enabled = true; Bloquear(); }
public DataTable ReporteGuia(GuiaCabeceraEn objGC, SedeEn objSede, SedeEn objSede2, DateTime dfechaini, DateTime dfechafin, GuiaCabeceraEn ObjEstado, string IdGuia, LogisticaEn objCodigo) { return(objdatos.ReporteGuia(objGC, objSede, objSede2, dfechaini, dfechafin, ObjEstado, IdGuia, objCodigo)); }
protected void btnGuardar_Click(object sender, EventArgs e) { if (gvBienes.Rows.Count == 0) { this.Page.Response.Write("<script language ='JavaScript'>window.alert('No existen registros agregados en la lista de la guía. Verifique por favor.');</script>"); return; } if (String.IsNullOrEmpty(txtTransportista.Text)) { this.Page.Response.Write("<script language ='JavaScript'>window.alert('Ingrese Transportista.');</script>"); txtTransportista.Focus(); return; } if (ddlMotivoTrasldo.SelectedIndex == 0) { this.Page.Response.Write("<script language ='JavaScript'>window.alert('Seleccione Motivo de Traslado.');</script>"); ddlMotivoTrasldo.Focus(); return; } if (ddlPuntoPartida.SelectedIndex == 0) { this.Page.Response.Write("<script language ='JavaScript'>window.alert('Seleccione Punto de Partida.');</script>"); ddlPuntoPartida.Focus(); return; } if (ddlPuntoLlegada.SelectedIndex == 0) { this.Page.Response.Write("<script language ='JavaScript'>window.alert('Seleccione Punto de Llegada.');</script>"); ddlPuntoLlegada.Focus(); return; } if (ddlPuntoLlegada.SelectedItem.ToString() == "Otros") { if (txtllegada.Text == "") { this.Page.Response.Write("<script language ='JavaScript'>window.alert('Especifique Punto de Llegada.');</script>"); txtllegada.Focus(); return; } } GuiaCabeceraEn ObjInsertGuia = new GuiaCabeceraEn(); GuiaDetalleActivosEn ObjInsertDet = new GuiaDetalleActivosEn(); ObjInsertGuia.IdLogin = int.Parse(Session["rpta"].ToString().ToUpper()); ObjInsertGuia.SedePartida = ddlPuntoPartida.SelectedValue; ObjInsertGuia.SedeLlegada = ddlPuntoLlegada.SelectedValue; ObjInsertGuia.OrigenDestinoExterno = txtllegada.Text; ObjInsertGuia.Fecha = DateTime.Now; //DateTime.Parse(TxtFecha.Text); ObjInsertGuia.Transportista = txtTransportista.Text; ObjInsertGuia.IdMotivoTraslado = int.Parse(ddlMotivoTrasldo.SelectedValue); ObjInsertGuia.Activos = 0; ObjInsertGuia.IdEstado = int.Parse(txtEstado.Text); ObjInsertGuia.observ = txtObserv.Text.Trim(); ObjInsertGuia.ip = Request.UserHostAddress; GuiaCabeceraN objGC = new GuiaCabeceraN(); string rpta = ""; rpta = objGC.InsertarGuiaCabecera(ObjInsertGuia); hdnIdGuia.Value = rpta; //Session["rpta"]=rpta; GuiaDetalleActivoN objDetalle = new GuiaDetalleActivoN(); //adicionar detalle bienes GuiaDetalleBienesEn objInsertarBienes = new GuiaDetalleBienesEn(); GuiaDetalleBienesN objBienes = new GuiaDetalleBienesN(); objInsertarBienes.IdGuia = int.Parse(rpta); int tot = 0; tot = gvBienes.Rows.Count; for (int i = 0; i < tot; i += 1) { objInsertarBienes.Cant = int.Parse(gvBienes.Rows[i].Cells[0].Text); objInsertarBienes.Descripcion = gvBienes.Rows[i].Cells[1].Text; // objInsertarBienes.IdUnidadMedida = int.Parse(gvBienes.Rows[i].Cells[2].Text); objInsertarBienes.IdUnidadMedida = Convert.ToInt32(gvBienes.DataKeys[i].Values[0]); objBienes.InsertarGuiaDetalleBienes(objInsertarBienes); } ObjInsertGuia.IdGuia = int.Parse(rpta); objGC.pr_registrar_auditoria_guia(ObjInsertGuia); this.Page.Response.Write("<script language ='JavaScript'>window.alert('Guia registrada correctamente.');</script>"); // limpiar(); hdusuario.Value = Session["Usuario"].ToString().ToUpper(); btnNuevo.Enabled = true; btnGuardar.Enabled = false; btnImprimir.Enabled = true; hdIdGuia.Value = rpta; Bloquear(); }
public bool fun_registrar_reparacion(ReparacionEn rep, List <ReparacionDetEn> det, GuiaCabeceraEn guia) { try { bool b = false; using (TransactionScope ProcesoTransaccional = new TransactionScope()) { ReparacionesDAO objRep = new ReparacionesDAO(); GuiaCabeceraN objGuia = new GuiaCabeceraN(); int idReparacion = objRep.registrar_reparacion_cab(rep); for (int i = 0; i < det.Count; i++) { det[i].idReparacion = idReparacion; objRep.registrar_reparacion_det(det[i]); } objGuia.ActualizarGuiaCabecera(guia); ProcesoTransaccional.Complete(); b = true; } return(b); } catch (Exception ex) { throw new Exception(ex.Message); } }
//protected void btnRuc_Click(object sender, ImageClickEventArgs e) //{ // FacturaN objFac = new FacturaN(); // try // { // btnRuc.Enabled = false; // txtProveedor.Text = ""; // //txtDireccion.Text = ""; // txtProveedor.Attributes.Add("readonly", "true"); // // txtDireccion.Attributes.Add("readonly", "true"); // string ruc = txtRuc.Text.Trim(); // if (ruc == "") // { // throw new Exception("Por favor ingrese el RUC a consultar"); // } // else // { // if (ruc.Length != 11) throw new Exception("El RUC ingresado no es válido. Debe ser de 11 dígitos"); // } // // verificar si existe en la tabla tbSunat // FacturaEn empresa = new FacturaEn(); // empresa = objFac.fun_buscar_proveedor_xRuc(ruc); // if (empresa.razonSocial != null) // { // txtProveedor.Text = empresa.razonSocial; // //txtDireccion.Text = empresa.direccion; // // if (empresa.direccion == "" || empresa.direccion == "-") txtDireccion.Attributes.Remove("readonly"); // } // else // { // //Mi api token personal sunat Jholy // string token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6IjRhMjc5YzM1YWIzN2FiYjUyYjVkZWIyYTcwYmY3ZjAyODZkMTRiYzVhZjNjNWI2Mzk2YmFlN2Y5NWQ4ZGE5ODBjN2Q1NzYzNzAxMDliN2ZlIn0.eyJhdWQiOiIxIiwianRpIjoiNGEyNzljMzVhYjM3YWJiNTJiNWRlYjJhNzBiZjdmMDI4NmQxNGJjNWFmM2M1YjYzOTZiYWU3Zjk1ZDhkYTk4MGM3ZDU3NjM3MDEwOWI3ZmUiLCJpYXQiOjE1NTM1MzE5ODQsIm5iZiI6MTU1MzUzMTk4NCwiZXhwIjoxNTg1MTU0Mzg0LCJzdWIiOiIyNzA1Iiwic2NvcGVzIjpbInVzZS1zdW5hdCJdfQ.dfvZ-onl8Hn6m-LjnQ8qVwFBe0Ii8k1w8qdKgq7vbL4UdGyziMyL5bWVgZ7anXEeyxlJEV1-Q6m_kRA7SJSD2S0j2VBtTyyAdSDuNefEi-CnS-b5aqbmRDp1bBBlsfQdav5EZyHDUkP1xVgeX_0bjgQhCWB72nOmqG7FUZqGJWvpPE1E2g8rY4leLcZeQC4ULsKNVZUuOTIq_wvJUOHu9FxHEM5p2R3dXWTOHDJCV4GRCFhyMrenA7SV40BcfmZiT_3hAf4FEKf8M-FXWxWa-p4Ry5BBYCBuoy4VdO7ADpoTvV-_TEdgV4giREjuTzDBvx6mANy2Rc-MHfElrr4ApgvdeYTgK2dUOSr1hmQ5O1MMgCVHla8QhV2LDwwE9zML-KVXHUkSmmCzKMC8dBXex271nhLrN9cZ55Kf8OZ3p78iwpsiLt-B-a8IWszOyIbi27TkbUCPDL8OygAo3rsS-ST2Os8bsmcPxBQDEuzXMs0myTEKAkO-LFP40V1JK-CRp-6d5AoCgbWj1aSOiBx6ECKrd4T0TeTBdrFRQnL37DZNgcm6puMb5l2YVyKoRYEYJL3c8U8HAMU99XYitKQEQHaQ03bPMbrhwmnFLWuWGpZN9ujm3EDmJjrlEZHBHg5NoX8-dMhYxlqgAUTEbq_EkJ29ZPnR9Tx5Gh-vfhar4Xk"; // System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; // var client = new RestClient("https://consulta.pe/"); // var request = new RestRequest("api/sunat/query/ruc ", Method.POST); // request.AddParameter("ruc", ruc); // // agregando Headers // request.AddHeader("Accept", "application/json"); // request.AddHeader("Authorization", "Bearer " + token); // // ejecutando el request // IRestResponse response = client.Execute(request); // var content = response.Content; // raw content as string // Tecactus.Api.Sunat.Company emp = new Tecactus.Api.Sunat.Company(); // try // { // emp = JsonConvert.DeserializeObject<Tecactus.Api.Sunat.Company>(content); // } // catch (Exception) // { // string error = JsonConvert.DeserializeObject<string>(content); // txtProveedor.Attributes.Remove("readonly"); // //txtDireccion.Attributes.Remove("readonly"); // throw new Exception(error); // } // if (emp.estado_contribuyente != "ACTIVO") // { // throw new Exception("El estado del contribuyente es inactivo ante la SUNAT"); // } // txtProveedor.Text = emp.razon_social; // //if (emp.direccion == "" || emp.direccion == "-") // // txtDireccion.Attributes.Remove("readonly"); // //else // // txtDireccion.Text = emp.direccion; // // registrar empresa en la tabla tbSunat y la consulta en la tabla auditoria // empresa.ruc = ruc; // empresa.razonSocial = emp.razon_social; // //empresa.direccion = txtDireccion.Text.Trim(); // empresa.usuReg = Session["usuario"].ToString(); // empresa.pc = Request.UserHostAddress; // objFac.pr_registrar_empresa_api(empresa); // //objFac.pr_registrar_consulta_api(sede, Session["usuario"].ToString(), "ListarLogistica.aspx", ruc, Session["ip"].ToString()); // } // txtRuc.Enabled = false; // btnRuc.Enabled = true; // dvError.Visible = false; // } // catch (Exception ex) // { // btnRuc.Enabled = true; // //objFac.pr_registrar_consulta_api(sede, Session["usuario"].ToString(), "ListarLogistica.aspx", txtRuc.Text, Session["ip"].ToString()); // mostrarError(ex); // dvError.InnerHtml = ex.Message; // dvError.Visible = true; // } //} protected void BtnRegistrar_Click(object sender, EventArgs e) { try { validarFechas(txtFecReparacion); validar_campos(); transacciones objTrans = new transacciones(); ReparacionEn rep = new ReparacionEn(); List <ReparacionDetEn> detalle = new List <ReparacionDetEn>(); int x = 0; double total = 0.00; foreach (GridViewRow row in gvRepara.Rows) { ReparacionDetEn det = new ReparacionDetEn(); TextBox txtCosto, txtMotivo, txtTrabajo = new TextBox(); txtCosto = (TextBox)gvRepara.Rows[x].FindControl("txtCosto"); txtMotivo = (TextBox)gvRepara.Rows[x].FindControl("txtMotivo"); txtTrabajo = (TextBox)gvRepara.Rows[x].FindControl("txtTrabajo"); // validar if (String.IsNullOrWhiteSpace(txtCosto.Text)) { throw new Exception("Ingrese Costo"); } if (String.IsNullOrWhiteSpace(txtMotivo.Text)) { throw new Exception("Ingrese Motivo"); } if (String.IsNullOrWhiteSpace(txtTrabajo.Text)) { throw new Exception("Ingrese Trabajo Realizado"); } // ----------------------------------------------------- det.codigo = row.Cells[0].Text; det.nroFactura = txtNroFactura.Text; det.fecReparacion = DateTime.Parse(txtFecReparacion.Text); det.tiempoGar = int.Parse(txtTiempo.Text); det.fecFinGar = DateTime.Parse(txtFechaFin.Text); det.transportista = txtProveedor.Text; det.costo = double.Parse(txtCosto.Text); det.motivo = txtMotivo.Text; det.trabRealizado = txtTrabajo.Text; detalle.Add(det); total += det.costo; x++; } // cabecera txtTotal.Text = total.ToString(); rep.idGuia = xidGuia; rep.total = total; rep.observ = txtObservacion.Text.Trim(); // datos guia GuiaCabeceraEn guia = new GuiaCabeceraEn(); guia.IdGuia = xidGuia; guia.IdLoginRecibido = int.Parse(Session["rpta"].ToString()); guia.FechaRecepcion = DateTime.Parse(txtFecha.Text); guia.ip = Request.UserHostAddress; if (objTrans.fun_registrar_reparacion(rep, detalle, guia)) { //Response.Write("listo"); this.Page.Response.Write("<script language ='JavaScript'>window.alert('Se registró la Recepción del Activo'); </script>"); BtnRegistrar.Enabled = false; BtnImprimir.Enabled = true; } } catch (Exception ex) { Response.Write("<script language ='JavaScript'>window.alert('" + ex.Message + "');</script>"); } }
public string ActualizarEstadoGuia(GuiaCabeceraEn ObjG) { return(objguia.ActualizarEstadoGuia(ObjG)); }
public string InsertarGuiaCabecera(GuiaCabeceraEn objE) { return(objguia.InsertarGuiaCabecera(objE)); }