Пример #1
0
        private void frmComentarios_Load(object sender, EventArgs e)
        {
            this.Icon = ClasesSGUV.Propiedades.IconHalcoNET;

            try
            {
                DataTable tbl =
                    connection.GetDataTable("LOG",
                                            "su_Almacen",
                                            new string[] { },
                                            new string[] { "@TipoConsulta", "@ItemCode" },
                                            ref valuesOut, 31, txtItemCode.Text);

                dataGridView1.DataSource = tbl;

                dataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState.True;

                DataTable tblR =
                    connection.GetDataTable("SGUV",
                                            "PJ_IdealLinea",
                                            new string[] { },
                                            new string[] { "@TipoConsulta" },
                                            ref valuesOut, 8);

                comboBox1.DataSource    = tblR;
                comboBox1.DisplayMember = "Name";
                comboBox1.ValueMember   = "Code";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "HalcoNET", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #2
0
        private void frmSobreStock_Load(object sender, EventArgs e)
        {
            try
            {
                this.actualizarToolStripButton.Click -= new EventHandler(btnActualizar_Click);
                this.actualizarToolStripButton.Click += new EventHandler(btnActualizar_Click);

                ClasesSGUV.Form.ControlsForms.setDataSource(clbLinea, ClasesSGUV.DataSource.GetSource((int)ClasesSGUV.DataSource.TipoQry.LineasTodas, string.Empty, string.Empty), "ItmsGrpNam", "ItmsGrpCod", "--Todos--");
                ClasesSGUV.Form.ControlsForms.setDataSource(clbAlmacen, ClasesSGUV.DataSource.GetSource((int)ClasesSGUV.DataSource.TipoQry.AlmacenesTodos, string.Empty, string.Empty), "WhsName", "WhsCode", "--Todos--");

                clbLinea.Click -= new EventHandler(ClasesSGUV.Form.ControlsForms.clbBox_Click);
                clbLinea.Click += new EventHandler(ClasesSGUV.Form.ControlsForms.clbBox_Click);

                clbAlmacen.Click -= new EventHandler(ClasesSGUV.Form.ControlsForms.clbBox_Click);
                clbAlmacen.Click += new EventHandler(ClasesSGUV.Form.ControlsForms.clbBox_Click);

                cbLP.SelectedIndex = 1;

                DataTable tbl_Acciones = new DataTable();

                tbl_Acciones = connection.GetDataTable("SGUV",
                                                       "PJ_IdealLinea",
                                                       new string[] { },
                                                       new string[] { "@TipoConsulta" },
                                                       ref valuesOut, 7);

                udpAcciones.SetDataBinding(tbl_Acciones, null);
                udpAcciones.ValueMember   = "Name";
                udpAcciones.DisplayMember = "Name";
            }
            catch (Exception ex)
            {
                this.SetMensaje(ex.Message, 5000, Color.Red, Color.White);
            }
        }
Пример #3
0
        private void frmDesabasto_Load(object sender, EventArgs e)
        {
            try
            {
                nuevoToolStripButton.Enabled   = false;
                guardarToolStripButton.Enabled = false;

                dgvDatos.DataSource   = null;
                dgvDetalle.DataSource = null;

                actualizarToolStripButton.Click -= new EventHandler(btnActualizar_Click);
                actualizarToolStripButton.Click += new EventHandler(btnActualizar_Click);

                DataTable tbl =
                    connection.GetDataTable("LOG",
                                            "sp_Indicadores",
                                            new string[] { },
                                            new string[] { "@TipoConsulta", "@Comprador" },
                                            ref valuesOut, 2, string.Empty);

                dgvDatos.DataSource = tbl;

                this.dgvDatos.DisplayLayout.Override.RowSelectorHeaderStyle = Infragistics.Win.UltraWinGrid.RowSelectorHeaderStyle.ColumnChooserButton;
            }
            catch (Exception ex)
            {
                this.SetMensaje(ex.Message, 5000, Color.Red, Color.White);
            }
        }
Пример #4
0
        private void btnExaminar_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialof = new OpenFileDialog();

            System.IO.Stream myStream = null;
            if (dialof.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                try
                {
                    if ((myStream = dialof.OpenFile()) != null)
                    {
                        using (System.IO.StreamReader cargar = new System.IO.StreamReader(dialof.FileName))
                        {
                            string renglon = string.Empty;
                            int    index   = 0;
                            while (!string.IsNullOrEmpty(renglon = cargar.ReadLine()))
                            {
                                if (index > 0)
                                {
                                    string[] data = renglon.Split('\t');

                                    Datos.Connection conn = new Datos.Connection();

                                    int x = conn.Ejecutar("LOG",
                                                          "su_Almacen",
                                                          new string[] { },
                                                          new string[] { "@TipoConsulta", "@ItemCode", "@AlternativeItem" },
                                                          ref valuesOut, 25, data[0], data[2]);

                                    //System.Threading.Thread.Sleep(60);
                                }
                                index++;
                            }
                        }
                        DataTable tbl = connection.GetDataTable("LOG",
                                                                "su_Almacen",
                                                                new string[] { },
                                                                new string[] { "@TipoConsulta" },
                                                                ref valuesOut, 26);
                        dgvDatos.DataSource = tbl;
                    }
                }
                catch (Exception ex)
                {
                    this.SetMensaje(ex.Message, 5000, Color.Red, Color.White);
                }
            }
        }
Пример #5
0
        private void GetClientes()
        {
            DataTable tbl = connection.GetDataTable("LOG",
                                                    "up_Configuracion",
                                                    new string[] { },
                                                    new string[] { "@TipoConsulta" },
                                                    ref valuesOut, 3);

            dgvClientes.DataSource = tbl;
        }
Пример #6
0
        public frmTransaccionesFR(int DocEntry)
        {
            InitializeComponent();

            try
            {
                Object[]  valuesOut = new Object[] { };
                DataTable tbl       =
                    connection.GetDataTable("LOG",
                                            "sp_SDKDocuments",
                                            new string[] { },
                                            new string[] { "@TipoConsulta", "@DocEntry" },
                                            ref valuesOut, 6, DocEntry);

                textBox1.Text = tbl.Rows[0]["DocNum"].ToString();
            }
            catch (Exception ex)
            {
                this.SetMensaje(ex.Message, 5000, Color.Red, Color.White);
            }
        }
Пример #7
0
        private void IdealxLinea_Load(object sender, EventArgs e)
        {
            this.Icon = ClasesSGUV.Propiedades.IconHalcoNET;

            log = new ClasesSGUV.Logs(ClasesSGUV.Login.NombreUsuario, this.AccessibleDescription, 0);

            this.CargarLinea(clbLinea, "Todas");
            this.CargarProveedores(clbProveedor, "Todas");
            this.CargarCompradores(clbComprador, "Todos");

            DataTable tbl_almacenes = new DataTable();

            tbl_almacenes = ClasesSGUV.DataSource.GetSource((int)ClasesSGUV.DataSource.Tipos.AlmacenesVenta);

            DataRow row = tbl_almacenes.NewRow();

            row["WhsCode"] = "0";
            row["WhsName"] = "Todos";
            tbl_almacenes.Rows.InsertAt(row, 0);

            clbAlmacen.DataSource    = tbl_almacenes;
            clbAlmacen.DisplayMember = "WhsName";
            clbAlmacen.ValueMember   = "WhsCode";

            clbAlmacen.Click -= new EventHandler(ClasesSGUV.Forms.clb_Click);
            clbAlmacen.Click += new EventHandler(ClasesSGUV.Forms.clb_Click);

            cbLP.SelectedIndex            = 1;
            cbClasificacion.SelectedIndex = 0;

            DataTable tbl_Acciones = new DataTable();

            tbl_Acciones = connection.GetDataTable("SGUV",
                                                   "PJ_IdealLinea",
                                                   new string[] { },
                                                   new string[] { "@TipoConsulta" },
                                                   ref valuesOut, 7);

            udpAcciones.SetDataBinding(tbl_Acciones, null);
            udpAcciones.ValueMember   = "Name";
            udpAcciones.DisplayMember = "Name";
        }
Пример #8
0
        private void btnConsultar_Click(object sender, EventArgs e)
        {
            try
            {
                dgvDatos.DataSource = null;

                Object[]  valuesOut = new Object[] { };
                DataTable tbl       =
                    connection.GetDataTable("LOG",
                                            "sp_ListaPrecios",
                                            new string[] { },
                                            new string[] { "@TipoConsulta", "@ItmsGrpCod" },
                                            ref valuesOut, 9, cbLineas.SelectedValue);
                foreach (System.Data.DataColumn col in tbl.Columns)
                {
                    col.ReadOnly = false;
                }
                dgvDatos.DataSource = tbl;
            }
            catch (Exception ex)
            {
                this.SetMensaje(ex.Message, 5000, Color.Red, Color.White);
            }
        }
Пример #9
0
        private void btnConsultar_Click(object sender, EventArgs e)
        {
            try
            {
                dgvDatos.DataSource = null;

                string Almacenes = ClasesSGUV.Form.ControlsForms.getCadena(clbAlmacen, "'", false, "WhsCode");

                DataTable tbl =
                    connection.GetDataTable("LOG",
                                            "sp_Reportes",
                                            new string[] { },
                                            new string[] { "@TipoConsulta", "@Almacenes", "@Desde", "@Hasta" },
                                            ref valuesOut, 18, Almacenes, dtpDesde.Value, dtpHasta.Value);



                dgvDatos.DataSource = tbl;
            }
            catch (Exception ex)
            {
                this.SetMensaje(ex.Message, 5000, Color.Red, Color.White);
            }
        }
Пример #10
0
        private void frmAlertasConfig_Load(object sender, EventArgs e)
        {
            ClasesSGUV.Form.ControlsForms.setDataSource(cbLinea, ClasesSGUV.DataSource.GetSource((int)ClasesSGUV.DataSource.TipoQry.Lineas, null, string.Empty), "ItmsGrpNam", "ItmsGrpCod", "--Línea--");

            DataTable tbl_Articulos = ClasesSGUV.DataSource.GetSource((int)ClasesSGUV.DataSource.TipoQry.GetArticulos, string.Empty, string.Empty);

            ClasesSGUV.Form.ControlsForms.Autocomplete(txtArticulo, tbl_Articulos.Copy(), "ItemCode");

            DataTable tbl =
                connection.GetDataTable("LOG",
                                        "sp_ListaPrecios",
                                        new string[] { },
                                        new string[] { "@TipoConsulta" },
                                        ref valuesOut, 14);

            dgvDatos.DataSource = tbl;
            tblCanal            = new DataTable();
            tblTipos            = new DataTable();

            tblCanal.Columns.Add("Codigo", typeof(Int32));
            tblCanal.Columns.Add("Nombre", typeof(string));

            DataRow r0 = tblCanal.NewRow();

            r0[0] = 0;
            r0[1] = string.Empty;
            tblCanal.Rows.Add(r0);

            DataRow r1 = tblCanal.NewRow();

            r1[0] = 60;
            r1[1] = "Transporte";
            tblCanal.Rows.Add(r1);

            DataRow r2 = tblCanal.NewRow();

            r2[0] = 61;
            r2[1] = "Mayoreo";
            tblCanal.Rows.Add(r2);

            DataRow r3 = tblCanal.NewRow();

            r3[0] = 62;
            r3[1] = "Armadores";
            tblCanal.Rows.Add(r3);

            cbCanal.DataSource    = tblCanal;
            cbCanal.DisplayMember = "Nombre";
            cbCanal.ValueMember   = "Codigo";

            tblTipos.Columns.Add("Codigo", typeof(Int32));
            tblTipos.Columns.Add("Nombre", typeof(string));

            DataRow r_0 = tblTipos.NewRow();

            r_0[0] = 0;
            r_0[1] = string.Empty;
            tblTipos.Rows.Add(r_0);

            DataRow r_1 = tblTipos.NewRow();

            r_1[0] = 1;
            r_1[1] = "% Descuento";
            tblTipos.Rows.Add(r_1);

            DataRow r_2 = tblTipos.NewRow();

            r_2[0] = 2;
            r_2[1] = "Utilidad";
            tblTipos.Rows.Add(r_2);

            DataRow r_3 = tblTipos.NewRow();

            r_3[0] = 3;
            r_3[1] = "Precio Especial";
            tblTipos.Rows.Add(r_3);

            //DataRow r_4 = tblTipos.NewRow();
            //r_4[0] = 4;
            //r_4[1] = "Volumen";
            //tblTipos.Rows.Add(r_4);

            cbEvaluar.DataSource    = tblTipos;
            cbEvaluar.DisplayMember = "Nombre";
            cbEvaluar.ValueMember   = "Codigo";

            nuevoToolStripButton.Click -= new EventHandler(btnNuevo_Click);
            nuevoToolStripButton.Click += new EventHandler(btnNuevo_Click);
        }
Пример #11
0
        private void Consultar()
        {
            try
            {
                string itemcode = txtItemCode.Text;

                Object[]  valuesOut = new Object[] { };
                DataTable tbl       =
                    connection.GetDataTable("LOG",
                                            "su_Almacen",
                                            new string[] { },
                                            new string[] { "@TipoConsulta", "@ItemCode" },
                                            ref valuesOut, 22, itemcode);

                if (tbl.Rows.Count > 0)
                {
                    this.CleanScreen(this, true);

                    txtItemCode.Text      = Convert.ToString(tbl.Rows[0]["ItemCode"]);
                    txtItemName.Text      = Convert.ToString(tbl.Rows[0]["ItemName"]);
                    txtU_Subclas.Text     = Convert.ToString(tbl.Rows[0]["U_Subclas"]);
                    cbLinea.SelectedValue = Convert.ToInt32(tbl.Rows[0]["ItmsGrpCod"]);
                    txtActive.Text        = Convert.ToString(tbl.Rows[0]["Estado"]);

                    txtCardName.Text   = Convert.ToString(tbl.Rows[0]["CardName"]);
                    txtNumInBuy.Text   = Convert.ToDecimal(tbl.Rows[0]["NumInBuy"]).ToString("N2");
                    txtBuyUnitMsr.Text = Convert.ToString(tbl.Rows[0]["BuyUnitMsr"]);
                    txtPurPackUn.Text  = Convert.ToDecimal(tbl.Rows[0]["PurPackUn"]).ToString("N2");

                    txtBHeight1.Text = Convert.ToDecimal(tbl.Rows[0]["BHeight1"]).ToString("N2") + " cm";
                    txtBWidth1.Text  = Convert.ToDecimal(tbl.Rows[0]["BWidth1"]).ToString("N2") + " cm";
                    txtBLength1.Text = Convert.ToDecimal(tbl.Rows[0]["BLength1"]).ToString("N2") + " cm";
                    txtBVolume.Text  = Convert.ToDecimal(tbl.Rows[0]["BVolume"]).ToString("N2");
                    txtBWeight1.Text = Convert.ToDecimal(tbl.Rows[0]["BWeight1"]).ToString("N2") + " kg";

                    txtInvntryUom.Text = Convert.ToString(tbl.Rows[0]["InvntryUom"]);
                    txtU_VLGX_PLN.Text = Convert.ToString(tbl.Rows[0]["U_VLGX_PLN"]);
                    txtU_VLGX_LT.Text  = Convert.ToString(tbl.Rows[0]["U_VLGX_LT"]);
                    txtU_VLGX_OF.Text  = Convert.ToString(tbl.Rows[0]["U_VLGX_OF"]);

                    DataTable tblStock =
                        connection.GetDataTable("LOG",
                                                "su_Almacen",
                                                new string[] { },
                                                new string[] { "@TipoConsulta", "@ItemCode" },
                                                ref valuesOut, 23, itemcode);

                    dgvDatos.DataSource = tblStock;

                    cbLinea.Enabled = false;
                }
                else
                {
                    SDK.Documentos.frmListadoDocumentos formulario = new SDK.Documentos.frmListadoDocumentos(-4, txtItemCode.Text, txtItemName.Text, DateTime.Now, cbLinea.SelectedValue.ToString());
                    //formulario.MdiParent = this.MdiParent;
                    formulario.ShowDialog();
                    txtItemCode.Text = formulario.ItemCode;
                    if (!string.IsNullOrEmpty(txtItemCode.Text))
                    {
                        SendKeys.Send("{ENTER}");
                    }
                }
            }
            catch (Exception ex)
            {
                this.SetMensaje(ex.Message, 5000, Color.Red, Color.White);
            }
        }