Esempio n. 1
0
        private void FgPro_CellButtonClick(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
        {
            if (FgPro.Col == 1)
            {
                DataTable dtResult = new DataTable();
                string    c_dato   = "";
                objItems.mysConec = mysConec;
                dtResult          = objItems.BuscarItem("", "n_id", dtPro, 0);
                if (dtResult != null)
                {
                    if (dtResult.Rows.Count != 0)
                    {
                        c_dato = dtResult.Rows[0]["c_despro"].ToString();
                        FgPro.SetData(FgPro.Row, 1, c_dato);

                        c_dato = dtResult.Rows[0]["n_id"].ToString();
                        FgPro.SetData(FgPro.Row, 2, c_dato);

                        if (funFunciones.NulosC(FgPro.GetData(FgPro.Rows.Count - 1, 1)) != "")
                        {
                            FgPro.Rows.Count = FgPro.Rows.Count + 1;
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        string CadenaIN()
        {
            string c_cadin = "";
            int    n_row   = 1;
            string c_cad   = "";

            for (n_row = 1; n_row <= FgPro.Rows.Count - 1; n_row++)
            {
                c_cad = funFunciones.NulosC(FgPro.GetData(n_row, 2));

                if (c_cad != "")
                {
                    if (n_row == 1)
                    {
                        if (c_cad != "")
                        {
                            c_cadin = c_cadin + c_cad;
                        }
                    }
                    else
                    {
                        if (c_cad != "")
                        {
                            c_cadin = c_cadin + ", " + c_cad;
                        }
                    }
                }
            }
            return(c_cadin);
        }
Esempio n. 3
0
 private void CmdAddPro_Click(object sender, EventArgs e)
 {
     if (funFunciones.NulosC(FgPro.GetData(FgPro.Rows.Count - 1, 1)) == "")
     {
         MessageBox.Show("¡ No ha especificado un proveedor en la ultima fila !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
         FgPro.Focus();
         return;
     }
     FgPro.Rows.Count = FgPro.Rows.Count + 1;
 }
Esempio n. 4
0
        private void FgPro_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode.ToString("") == "Delete")
            {
                FgPro.RemoveItem(FgPro.Row);
            }

            if (e.KeyCode.ToString("") == "Insert")
            {
                if (funFunciones.NulosC(FgPro.GetData(FgPro.Row, 1)).ToString() != "")
                {
                    FgPro.Rows.Count = FgPro.Rows.Count + 1;
                }
            }
        }
Esempio n. 5
0
        string HallarCadINPro()
        {
            string c_cad = "(";
            int    n_row = 0;

            for (n_row = 1; n_row <= FgPro.Rows.Count - 1; n_row++)
            {
                if (funFunciones.NulosC(FgPro.GetData(n_row, 2)) != "")
                {
                    if (n_row == 1)
                    {
                        c_cad = c_cad + FgPro.GetData(n_row, 2).ToString();
                    }
                    else
                    {
                        c_cad = c_cad + ", " + FgPro.GetData(n_row, 2).ToString();
                    }
                }
            }
            c_cad = c_cad + ")";
            return(c_cad);
        }