Exemple #1
0
        private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
        {
            if (ValAdd == false)
            {
                ValAdd = true;
                //***************
                if (Permiso != 3)
                {
                    ValAdd = true;
                    AccionesNavigator(1);
                    ClsKit cont = (ClsKit)ClsBindingKit.Current;
                    ClsBindingKit.ResetBindings(false);

                    textBox2.Enabled = false;
                }
                else
                {
                    MessageBox.Show("No Tiene los privilegios que le \n Permitan Agregar Registros", "AVISO", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                    AccionCancelar();

                    //Llenamos de nuevo el Grid de Articulos que contiene el Kit
                    ListKit = ClsKit.ListArtKit();
                    ultraGrid2.DataSource = ListKit;
                }
                //*****************
            }
        }
Exemple #2
0
        private void ultraGrid2_AfterCellUpdate(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
        {
            int    col     = 0;
            string Columna = "";

//            e.Cell.Row.Cells.GetItem(0);

            //char.IsNumber


            //int x=0;
            //for ( x=0;x<e.Cell.Value.ToString().Length;x++ )
            // //e.Cell.Value.ToString()
            //{
            //    char.IsNumber(e.Cell.Value.ToString().Substring(x, 1));

            //}


            if (e.Cell.Column.Key.ToString().ToUpper() == "CANTIDAD")
            {
                if (Entra > 0)
                {
                    //e.Cell.Value = "";
                    e.Cell.Value = "";
                    MessageBox.Show("No puede actualizar los datos...");
                    return;
                }
            }

            Columna = e.Cell.Column.Key.ToString().ToUpper();


            foreach (Infragistics.Win.UltraWinGrid.UltraGridRow Rn in ultraGrid2.Rows)
            {
                if (Rn.Cells[0].Value.ToString() != "" && Rn.Cells[1].Value.ToString() != "" && Rn.Cells[2].Value.ToString() != "" && Rn.Cells[3].Value.ToString() != "" && Rn.Cells[4].Value.ToString() != "")
                {
                    ClsKit.AddNewRowArtKitMan(1, Convert.ToInt32(Rn.Cells[0].Value), Convert.ToString(Rn.Cells[1].Value).ToUpper(), Convert.ToString(Rn.Cells[2].Value).ToUpper(), Convert.ToInt32(Rn.Cells[3].Value), Convert.ToDouble(Rn.Cells[4].Value));
                }
            }

            if (Columna == "PRECIOU")
            {
                ClsKit.AddNewRowArtKitMan(3, 0, "", "", 0, 0);
                ListKit = ClsKit.ListArtKit();
                ultraGrid2.DataSource = ListKit;
                int rows = 0;
                rows = ultraGrid2.Rows.Count;
                ultraGrid2.Rows[rows - 1].Cells[1].Activated = true;
                //e.Cell.Activated = true;
            }
        }
Exemple #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            ClsKit CK = new ClsKit();

            CK.IdArticulo = 0;

            //Borro el grid.
            ClsKit.DeleteartKit(CK);


            //Cargo de nuevo el grid.
            ListKit = ClsKit.ListArtKit();
            ultraGrid2.DataSource = ListKit;

            //Cierro la forma.
            this.Close();
        }
Exemple #4
0
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            ClsKit CK = new ClsKit();

            try
            {
                if (ultraGrid1.Rows.Count == 0)
                {
                    MessageBox.Show("Debe seleccionar articulos para agregar...", "MENSAJE DEL SISTEMA", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                foreach (Infragistics.Win.UltraWinGrid.UltraGridRow Rn in ultraGrid1.Rows)
                {
                    if (Rn.Cells[9].Value != "" && Rn.Cells[9].Value != null && Rn.Cells[9].Text != "")
                    {
                        //table.Rows.Add(Rn.Cells[0].Value, Rn.Cells[1].Value, Rn.Cells[2].Value, Rn.Cells[3].Value, Rn.Cells[9].Value);
                        //ClsBindingArti.DataSource = table;

                        CK.IdArticulo  = Convert.ToInt32(Rn.Cells[0].Value);
                        CK.Articulo    = Convert.ToString(Rn.Cells[1].Value);
                        CK.Descripcion = Convert.ToString(Rn.Cells[2].Value);
                        CK.Cantidad    = Convert.ToDouble(Rn.Cells[9].Value);
                        CK.PrecioU     = Convert.ToDouble(Rn.Cells[3].Value);

                        ClsKit.AddArtKit(CK, 1, 0);
                    }
                }

                ListKit = ClsKit.ListArtKit();
                ultraGrid2.DataSource = ListKit;
            }
            catch (Exception EX)
            {
                MessageBox.Show(EX.Message, "AVISO");
            }
        }
Exemple #5
0
        private void ultraGrid2_DoubleClickRow(object sender, Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs e)
        {
            try
            {
                ClsKit CK = new ClsKit();

                int    Ren;
                string Articulo = "";

                Ren      = Convert.ToInt32(e.Row.Cells[0].Text);
                Articulo = Convert.ToString(e.Row.Cells[1].Text);

                if (e.Row.Cells[7].Activated == true)
                {
                    CK.IdArticulo = Ren;
                    CK.Articulo   = Articulo;

                    DialogResult dr =
                        MessageBox.Show("Estas seguro de borrar el Articulo: " + CK.Articulo,
                                        "AVISO", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

                    if (dr == DialogResult.Yes)
                    {
                        //Borro el articulo seleccionado
                        ClsKit.DeleteartKit(CK);

                        //Llenamos de nuevo el Grid de Articulos que contiene el Kit
                        ListKit = ClsKit.ListArtKit();
                        ultraGrid2.DataSource = ListKit;
                    }
                }
            }
            catch (Exception EX)
            {
                MessageBox.Show(EX.Message);
            }
        }
Exemple #6
0
 private void btnMas_Click(object sender, EventArgs e)
 {
     ClsKit.AddNewRowArtKitMan(3, 0, "", "", 0, 0);
     ListKit = ClsKit.ListArtKit();
     ultraGrid2.DataSource = ListKit;
 }