private void CargarSectoresDestino(int _dep) { try { BLL.Tables.STKSECTOR _sec = new BLL.Tables.STKSECTOR(); _sec.OrderByParameter.Add(DAL.Tables.STKSECTOR.ColumnEnum.descripcion); _sec.ItemList(_dep); Entities.Tables.STKSECTOR _itemSeleccion = new Entities.Tables.STKSECTOR(); //Limpia el combo this.comboBoxSectorDelPedido.SuspendLayout(); this.comboBoxSectorDelPedido.DataSource = null; this.comboBoxSectorDelPedido.Items.Clear(); //Carga el item de Seleccion _itemSeleccion.DESCRIPCION = "<Seleccione un Sector del Pedido"; _itemSeleccion.SECTOR_ID = 0; _sec.Result.Insert(0, _itemSeleccion); //Carga el combo this.comboBoxSectorDelPedido.DisplayMember = BLL.Tables.STKSECTOR.ColumnNames.DESCRIPCION; this.comboBoxSectorDelPedido.ValueMember = BLL.Tables.STKSECTOR.ColumnNames.SECTOR_ID; this.comboBoxSectorDelPedido.DataSource = _sec.Result.ToArray(); this.comboBoxSectorDelPedido.ResumeLayout(); this.comboBoxSectorDelPedido.SelectedIndex = 0; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void toolStripButtonSave_Click(object sender, EventArgs e) { try { Entities.Tables.STKSECTOR _item = new Entities.Tables.STKSECTOR(); BLL.Tables.STKSECTOR _sector = new BLL.Tables.STKSECTOR(); _item.CODEMP = Clases.Usuario.EmpresaLogeada.EmpresaIngresada; _item.DEPOSITO_ID = Convert.ToInt32(this.comboBoxN_Deposito.SelectedValue); _item.SECTOR_ID = _idSector; _item.DESCRIPCION = this.textBoxDescrip.Text.Trim(); //verifico si la variable es distinta de cero if (_idSector != 0) { //ESTOY ACTUALIZANDO UN TIPO if (this.textBoxDescrip.Text.Trim() != string.Empty) { _sector.Update(_item); _idSector = 0; this.textBoxDescrip.Text = string.Empty; MessageBox.Show("La Operación se realizó correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Debe ingresar una descripción", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); this.textBoxDescrip.Focus(); } } else { //ES UN NUEVO INGRESO if (this.textBoxDescrip.Text.Trim() != string.Empty) { _sector.Add(_item); _idSector = 0; this.textBoxDescrip.Text = string.Empty; MessageBox.Show("La Operación se realizó correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Debe ingresar una descripción", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); this.textBoxDescrip.Focus(); } } CargarDepositos(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//FIN PERMISOS private void CargarSectores(int _deposito) { try { BLL.Tables.STKSECTOR _sector = new BLL.Tables.STKSECTOR(); _sector.WhereParameter.Add(DAL.Tables.STKSECTOR.ColumnEnum.deposito_id, DAL.SqlEnums.OperandEnum.Equal, _deposito); _sector.OrderByParameter.Add(DAL.Tables.STKSECTOR.ColumnEnum.descripcion); this.bindingSourceStkSector.DataSource = _sector.ItemList(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void CargarSectoresDeposito(int _dep) { try { BLL.Tables.STKSECTOR _sec = new BLL.Tables.STKSECTOR(); _sec.OrderByParameter.Add(DAL.Tables.STKSECTOR.ColumnEnum.descripcion); _sec.ItemList(_dep); Entities.Tables.STKSECTOR _itemSeleccion = new Entities.Tables.STKSECTOR(); //Limpia el combo this.comboBoxSector.SuspendLayout(); this.comboBoxSector.DataSource = null; this.comboBoxSector.Items.Clear(); //Carga el item de Seleccion _itemSeleccion.DESCRIPCION = "<Seleccione un Sector>"; _itemSeleccion.SECTOR_ID = 0; _sec.Result.Insert(0, _itemSeleccion); //Carga el combo this.comboBoxSector.DisplayMember = BLL.Tables.STKSECTOR.ColumnNames.DESCRIPCION; this.comboBoxSector.ValueMember = BLL.Tables.STKSECTOR.ColumnNames.SECTOR_ID; this.comboBoxSector.DataSource = _sec.Result.ToArray(); this.comboBoxSector.ResumeLayout(); //SETEO EL DEPOSITO SEGUN LA EMPRESA //// //if (Clases.Usuario.UsuarioLogeado.usuario_Logeado.ToUpper().ToString().Trim() == "DEPOSITO") //{ // this.comboBoxSector.SelectedValue = (Clases.Usuario.EmpresaLogeada.EmpresaIngresada.Trim() == "EGES") ? 1 : 2; //} } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }