コード例 #1
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         if (!txtIdOrigen.Text.Equals(""))
         {
             ORIGEN pedidoIdUser = new ORIGEN();
             pedidoIdUser.IDORIGEN = Convert.ToInt32(txtIdOrigen.Text.Trim());
             List <ORIGEN> lstPedidos = _02LogicadeNegocios.Logica.BuscarDatoA(pedidoIdUser);
             this.dataGrid.DataSource = lstPedidos;
             this.dataGrid.Refresh();
         }
         else if (!txtPais.Text.Equals(""))
         {
             ORIGEN pedidoIdUser = new ORIGEN();
             pedidoIdUser.PAIS = txtPais.Text.Trim();
             List <ORIGEN> lstPedidos = _02LogicadeNegocios.Logica.BuscarDatoB(pedidoIdUser);
             this.dataGrid.DataSource = lstPedidos;
             this.dataGrid.Refresh();
         }
         else if (txtIdOrigen.Text.Equals("") && txtPais.Text.Equals(""))
         {
             CargarOrigen();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error al Buscar Datos de Tabla Origen" + ex.Message);
     }
     Limpiar();
 }
コード例 #2
0
        public ORIGEN processoBase()
        {
            ORIGEN origen = new ORIGEN();

            origen.IDORIGEN = Convert.ToInt16(txtIdOrigen.Text.Trim());
            origen.PAIS     = txtPais.Text.Trim();
            origen.CIUDAD   = txtCiudad.Text.Trim();
            return(origen);
        }
コード例 #3
0
 private void btnGuardar_Click(object sender, EventArgs e)
 {
     try
     {
         ORIGEN origen = new ORIGEN();
         //origen.IDORIGEN = Convert.ToInt16(txtIdOrigen.Text.Trim());
         origen.PAIS   = txtPais.Text.Trim();
         origen.CIUDAD = txtCiudad.Text.Trim();
         _02LogicadeNegocios.Logica.GuardarDato(origen);
         MessageBox.Show("Origen Agregado");
         Limpiar(); this.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error al Guardar Datos en Tabla Origen" + ex.Message);
     }
 }
コード例 #4
0
        public List <ORIGEN> Obtener_Origen(SQLSentencia objsentencia)
        {
            List <ORIGEN> lstOrigen = new List <ORIGEN>();

            System.Data.DataTable dt = new System.Data.DataTable();
            try
            {
                SqlCommand cmd = new SqlCommand();

                cmd.CommandText = objsentencia.PETICION;
                cmd.Connection  = objConexion;
                cmd.CommandType = System.Data.CommandType.Text;

                SqlDataAdapter objcarga = new SqlDataAdapter(cmd);
                objcarga.Fill(dt);

                foreach (System.Data.DataRow item in dt.Rows)
                {
                    ORIGEN objOrigen = new ORIGEN();
                    objOrigen.IDORIGEN = Convert.ToInt16(item.ItemArray[0].ToString());
                    objOrigen.PAIS     = item.ItemArray[1].ToString();
                    objOrigen.CIUDAD   = item.ItemArray[2].ToString();
                    lstOrigen.Add(objOrigen);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                this.CERRAR();
            }

            return(lstOrigen);
        }
コード例 #5
0
ファイル: HelperNavigator.cs プロジェクト: skiwheelr/KarveCar
        public void NewOriginView(Uri uri)
        {
            var e = new ORIGEN();

            NewHelperView <ORIGEN, OrigenViewObject>(e, "Nuevo Origin", uri);
        }
コード例 #6
0
        private string ObtenerDatos()
        {
            string sResul = "";

            try
            {
                StringBuilder strBuilder = new StringBuilder();
                int           i          = 0;

                strBuilder.Append("<table id='tblDatos' class='texto' style='width: 396px;'>");
                strBuilder.Append("<colgroup><col style='width:396px;' /></colgroup>");
                if (hdnOpcion.Text == "Area")
                {
                    dr = Areas.Listado(int.Parse(Session["IDFICEPI"].ToString()), Session["ADMIN"].ToString());
                }
                else if (hdnOpcion.Text == "Tipo")
                {
                    dr = TIPO.Catalogo(null, short.Parse(hdnIDArea.Text), "", null, 4, 0);
                }
                else if (hdnOpcion.Text == "Entrada")
                {
                    dr = ENTRADA.Catalogo(null, short.Parse(hdnIDArea.Text), "", null, 4, 0);
                }
                else if (hdnOpcion.Text == "Alcance")
                {
                    dr = ALCANCE.Catalogo(null, short.Parse(hdnIDArea.Text), "", null, 4, 0);
                }
                else if (hdnOpcion.Text == "Proceso")
                {
                    dr = PROCESO.Catalogo(null, short.Parse(hdnIDArea.Text), "", null, 4, 0);
                }
                else if (hdnOpcion.Text == "Producto")
                {
                    dr = PRODUCTO.Catalogo(null, short.Parse(hdnIDArea.Text), "", null, 4, 0);
                }
                else if (hdnOpcion.Text == "Requisito")
                {
                    dr = REQUISITO.Catalogo(null, short.Parse(hdnIDArea.Text), "", null, 4, 0);
                }
                else if (hdnOpcion.Text == "CR")
                {
                    dr = CR.Catalogo();
                }
                else if (hdnOpcion.Text == "CR_TEXTO")
                {
                    dr = CR.Catalogo(short.Parse(hdnIDArea.Text));
                }
                else if (hdnOpcion.Text == "Cliente")
                {
                    dr = Cliente.Catalogo(short.Parse(hdnIDArea.Text));
                }
                else if (hdnOpcion.Text == "Proveedor")
                {
                    dr = Proveedor.Catalogo(short.Parse(hdnIDArea.Text));
                }
                else if (hdnOpcion.Text == "Causa")
                {
                    dr = CAUSA.Catalogo(null, short.Parse(hdnIDArea.Text), "", null, 4, 0);
                }
                else if (hdnOpcion.Text == "Origen")
                {
                    dr = ORIGEN.Catalogo(null, short.Parse(hdnIDArea.Text), "", null, 4, 0);
                }
                else if (hdnOpcion.Text == "Coordinadores")
                {
                    dr = Areas.CoordinadoresArea(int.Parse(hdnIDArea.Text));
                }
                else if (hdnOpcion.Text == "Solicitantes")
                {
                    dr = Areas.SolicitantesArea(int.Parse(hdnIDArea.Text));
                }
                else if (hdnOpcion.Text == "Especialistas")
                {
                    dr = Areas.LeerTecnicosArea(int.Parse(hdnIDArea.Text));
                }
                else if (hdnOpcion.Text == "Deficiencias")
                {
                    dr = Areas.DeficienciasArea(int.Parse(hdnIDArea.Text));
                }

                while (dr.Read())
                {
                    //if (i % 2 == 0) strBuilder.Append("<tr class=FA ");
                    //else strBuilder.Append("<tr class=FB ");
                    i++;
                    strBuilder.Append("<tr ");
                    if (hdnOpcion.Text == "Cliente" || hdnOpcion.Text == "Proveedor" || hdnOpcion.Text == "CR_TEXTO")
                    {
                        strBuilder.Append("id='" + i.ToString() + "'");
                    }
                    else
                    {
                        strBuilder.Append("id='" + dr["ID"].ToString() + "'");
                    }
                    strBuilder.Append(" onclick='ms(this)' ondblclick='aceptarClick(this);' onmousemove='TTip(event);' style='cursor:pointer;height:16px'>");
                    //strBuilder.Append("<td width='15%'>" + (int.Parse(dr["ID"].ToString())).ToString("#,###,##0") + "</td>");

                    if (hdnOpcion.Text == "Cliente" || hdnOpcion.Text == "Proveedor" || hdnOpcion.Text == "CR_TEXTO")
                    {
                        strBuilder.Append("<td style='padding-left:5px'><label class=texto id='lbl" + i.ToString() + "' style='width:315px;text-overflow:ellipsis;overflow:hidden'");
                    }
                    else
                    {
                        strBuilder.Append("<td style='padding-left:5px'><label class=texto id='lbl" + dr["ID"].ToString() + "' style='width:315px;text-overflow:ellipsis;overflow:hidden'");
                    }
                    if (dr["DESCRIPCION"].ToString().Length > 80)
                    {
                        strBuilder.Append(" title='" + dr["DESCRIPCION"].ToString() + "'");
                    }
                    strBuilder.Append("><nobr class='NBR W395'>" + dr["DESCRIPCION"] + "</nobr></label></td></tr>");
                }

                dr.Close();
                dr.Dispose();

                strBuilder.Append("</table>");

                sResul = "OK@@" + strBuilder.ToString();
            }
            catch (Exception ex)
            {
                sResul = "Error@@" + Errores.mostrarError("Error al obtener los datos", ex);
            }
            return(sResul);
        }