コード例 #1
0
 private void btnAsignar_Click(object sender, EventArgs e)
 {
     try
     {
         if (AyudaEntidadDepTmp.Value == null)
         {
             Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeInformacion(Presenter.Title, "Debe seleccionar un depósito temporal");
         }
         else
         {
             DataTable _dt = new DataTable("DepTemporales");
             _dt.Columns.Add("Codigo", typeof(Int32));
             _dt.Columns.Add("DepTemporal", typeof(Int32));
             _dt.Columns.Add("Usuario", typeof(String));
             for (int i = 0; i < this.grdItems.RowCount; i++)
             {
                 if (grdItems.Rows[i].Cells["Actualiza"].Value != null)
                 {
                     DataRow _dr = _dt.NewRow();
                     _dr["Codigo"]      = grdItems.Rows[i].Cells["CDIR_Codigo"].Value;
                     _dr["DepTemporal"] = AyudaEntidadDepTmp.Value.ENTC_Codigo;
                     _dr["Usuario"]     = Presenter.Session.UserName;
                     _dt.Rows.Add(_dr);
                 }
             }
             if (_dt.Rows.Count > 0)
             {
                 Presenter.ActualizarDepTemporal(_dt);
                 btnBuscar_Click(sender, e);
             }
         }
     }
     catch (Exception ex)
     { Infrastructure.WinForms.Controls.Dialogos.MostrarMensajeError(Presenter.Title, "Ha ocurrido una error al asignar el depósito temporal", ex); }
 }