コード例 #1
0
 public Shipping_AvgJobCard_List(Telerik.WinControls.UI.RadDropDownList YYYYxxx
                                 , Telerik.WinControls.UI.RadDropDownList MMxxx
                                 , Telerik.WinControls.UI.RadTextBox CodeNoxxx
                                 )
 {
     InitializeComponent();
     MM_tt     = MMxxx;
     CodeNo_tt = CodeNoxxx;
     YYYYY_tt  = YYYYxxx;
     screen    = 1;
 }
コード例 #2
0
        private void resetTxtBox()
        {
            foreach (Control item in gb_Objeto.Controls)
            {
                if (item.GetType() == typeof(Telerik.WinControls.UI.RadTextBox))
                {
                    item.Text = "";
                }
                if (item.GetType() == typeof(Telerik.WinControls.UI.RadDropDownList))
                {
                    Telerik.WinControls.UI.RadDropDownList _item = (Telerik.WinControls.UI.RadDropDownList)item;
                    _item.SelectedIndex = 0;
                }
                if (item.GetType() == typeof(System.Windows.Forms.DateTimePicker))
                {
                    System.Windows.Forms.DateTimePicker _item = (System.Windows.Forms.DateTimePicker)item;
                    _item.Value = DateTime.Now.Date;
                }

                txt_Costo.Text         = "";
                lbl_FechaActCosto.Text = "";
            }
        }
コード例 #3
0
        private void dgw_CellClick(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
        {
            if (Accion != "Agregar")
            {
                if (e.RowIndex >= 0)
                {
                    idObjetoActual = int.Parse(dgw.Rows[e.RowIndex].Cells[0].Value.ToString());

                    foreach (Control item in this.gb_Objeto.Controls)
                    {
                        if (item is Telerik.WinControls.UI.RadTextBox)
                        {
                            Telerik.WinControls.UI.RadTextBox _item = (Telerik.WinControls.UI.RadTextBox)item;
                            try
                            {
                                _item.Text = dgw.Rows[e.RowIndex].Cells[_item.Name.Substring(4)].Value.ToString();;
                            }
                            catch (Exception)
                            {
                                _item.Text = "Error al cargar";
                            }
                        }
                        if (item is Telerik.WinControls.UI.RadDropDownList)
                        {
                            Telerik.WinControls.UI.RadDropDownList _item = (Telerik.WinControls.UI.RadDropDownList)item;
                            try
                            {
                                _item.SelectedValue = int.Parse(dgw.Rows[e.RowIndex].Cells[_item.Name.Substring(6)].Value.ToString());
                            }
                            catch (Exception)
                            {
                                _item.Text = "Error al cargar";
                            }
                        }
                        if (item is System.Windows.Forms.DateTimePicker)
                        {
                            System.Windows.Forms.DateTimePicker _item = (System.Windows.Forms.DateTimePicker)item;
                            try
                            {
                                _item.Text = dgw.Rows[e.RowIndex].Cells[_item.Name.Substring(5)].Value.ToString();
                            }
                            catch (Exception)
                            {
                                _item.Text = "Error al cargar";
                            }
                        }
                    }

                    //Codigo especial por fecha pedido stock
                    if (dgw.Rows[e.RowIndex].Cells["FechaPedidoStock"].Value.ToString() == "" || dgw.Rows[e.RowIndex].Cells["FechaPedidoStock"].Value.ToString() == "01/01/1900 0:00:00")
                    {
                        rb_HayStock.ToggleState = Telerik.WinControls.Enumerations.ToggleState.On;
                    }
                    else
                    {
                        rb_FechaPedido.ToggleState = Telerik.WinControls.Enumerations.ToggleState.On;
                        date_FechaPedidoStock.Text = dgw.Rows[e.RowIndex].Cells["FechaPedidoStock"].Value.ToString();
                    }

                    //Codigo especial para costo
                    if (dgw.Rows[e.RowIndex].Cells["Costo"].Value.ToString() != "")
                    {
                        txt_Costo.Text         = dgw.Rows[e.RowIndex].Cells["Costo"].Value.ToString();
                        lbl_FechaActCosto.Text = dgw.Rows[e.RowIndex].Cells["FechaActCosto"].Value.ToString().Substring(0, 10);
                    }
                    else
                    {
                        txt_Costo.Text         = "";
                        lbl_FechaActCosto.Text = "";
                    }
                }
            }
        }
コード例 #4
0
        private void dgw_CellClick(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                idObjetoActual = int.Parse(dgw.Rows[e.RowIndex].Cells[1].Value.ToString());

                foreach (Control item in this.gb_Objeto.Controls)
                {
                    if (item is Telerik.WinControls.UI.RadTextBox)
                    {
                        Telerik.WinControls.UI.RadTextBox _item = (Telerik.WinControls.UI.RadTextBox)item;
                        try
                        {
                            _item.Text = dgw.Rows[e.RowIndex].Cells[_item.Name.Substring(4)].Value.ToString();;
                        }
                        catch (Exception)
                        {
                            _item.Text = "Error al cargar";
                        }
                    }
                    if (item is Telerik.WinControls.UI.RadDropDownList)
                    {
                        Telerik.WinControls.UI.RadDropDownList _item = (Telerik.WinControls.UI.RadDropDownList)item;
                        try
                        {
                            _item.SelectedValue = int.Parse(dgw.Rows[e.RowIndex].Cells[_item.Name.Substring(6)].Value.ToString());
                        }
                        catch (Exception)
                        {
                            _item.Text = "Error al cargar";
                        }
                    }
                    if (item is System.Windows.Forms.DateTimePicker)
                    {
                        System.Windows.Forms.DateTimePicker _item = (System.Windows.Forms.DateTimePicker)item;
                        try
                        {
                            _item.Text = dgw.Rows[e.RowIndex].Cells[_item.Name.Substring(5)].Value.ToString();
                        }
                        catch (Exception)
                        {
                            _item.Text = "Error al cargar";
                        }
                    }
                }

                //Codigo especial para costo
                if (dgw.Rows[e.RowIndex].Cells["Costo"].Value.ToString() != "")
                {
                    txt_Costo.Text         = dgw.Rows[e.RowIndex].Cells["Costo"].Value.ToString();
                    lbl_FechaActCosto.Text = dgw.Rows[e.RowIndex].Cells["FechaActCosto"].Value.ToString().Substring(0, 10);
                }
                else
                {
                    txt_Costo.Text         = "";
                    lbl_FechaActCosto.Text = "";
                }

                //Agregar cuando se selecciona una fragancia
                if (e.ColumnIndex == 0)
                {
                    if (this.dgw.Rows[e.RowIndex].Cells["Seleccionar"].Value != DBNull.Value)
                    {
                        if (Convert.ToBoolean(this.dgw.Rows[e.RowIndex].Cells["Seleccionar"].Value))
                        {
                            Fragancia _newFrag = new Fragancia();
                            _newFrag.idEstado   = int.Parse(dgw.Rows[e.RowIndex].Cells["idFragancia"].Value.ToString());
                            _newFrag.NombreReal = dgw.Rows[e.RowIndex].Cells["NombreReal"].Value.ToString();

                            _listFraganciasSeleccionadas.Add(_newFrag);
                        }
                        dgw_Seleccionados.DataSource = _listFraganciasSeleccionadas;
                    }
                }
            }
        }