Exemplo n.º 1
0
 private void btnNuevoEstado_Click(object sender, EventArgs e)
 {
     try
     {
         if (BindingList_orden_pago_estado_aprob.Count > 0)
         {
             var temp = (cp_orden_pago_estado_aprob_Info)gridViewEstado.GetRow(gridViewEstado.RowCount - 1);
             if (temp.IdEstadoAprobacion != "" && temp.Descripcion != "" && temp.IdEstadoAprobacion != null && temp.Descripcion != null)
             {
                 bandEstado  = 1;
                 Info_Estado = new cp_orden_pago_estado_aprob_Info();
                 BindingList_orden_pago_estado_aprob.Add(Info_Estado);
                 gridControlEstado.Refresh();
             }
         }
         else
         {
             colIdEstadoAprobacion.OptionsColumn.AllowEdit = true;
             gridViewEstado.AddNewRow();
             BindingList_orden_pago_estado_aprob = new BindingList <cp_orden_pago_estado_aprob_Info>();
             Info_Estado.IdEstadoAprobacion      = "";
             Info_Estado.Descripcion             = "";
             BindingList_orden_pago_estado_aprob.Add(Info_Estado);
             bandEstado = 1;
             gridControlEstado.Refresh();
         }
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Exemplo n.º 2
0
        public List <cp_orden_pago_estado_aprob_Info> Get_List_orden_pago_estado_aprob()
        {
            try
            {
                List <cp_orden_pago_estado_aprob_Info> lista = new List <cp_orden_pago_estado_aprob_Info>();
                lista = new List <cp_orden_pago_estado_aprob_Info>();


                EntitiesCuentasxPagar ORol = new EntitiesCuentasxPagar();

                var sresult = from A in ORol.cp_orden_pago_estado_aprob
                              select A;

                foreach (var item in sresult)
                {
                    cp_orden_pago_estado_aprob_Info Reg = new cp_orden_pago_estado_aprob_Info();

                    Reg.IdEstadoAprobacion = item.IdEstadoAprobacion;
                    Reg.Descripcion        = item.Descripcion;

                    lista.Add(Reg);
                }
                return(lista);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
Exemplo n.º 3
0
 public Boolean ModificarDB(cp_orden_pago_estado_aprob_Info Info)
 {
     try
     {
         return(data.ModificarDB(Info));
     }
     catch (Exception ex)
     {
         Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
         throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "ModificarDB", ex.Message), ex)
               {
                   EntityType = typeof(cp_orden_pago_estado_aprob_Bus)
               };
     }
 }
Exemplo n.º 4
0
        private void gridViewEstado_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            try
            {
                // borrarChekgridEstado();

                //gridViewEstado.SetRowCellValue(e.FocusedRowHandle, colchekEstado, true);
                //  gridViewEstado.SetFocusedRowCellValue(colchekEstado, true);
                cp_orden_pago_estado_aprob_Info data = (cp_orden_pago_estado_aprob_Info)gridViewEstado.GetRow(e.FocusedRowHandle);

                if (e.FocusedRowHandle != BindingList_orden_pago_estado_aprob.Count - 1)
                {
                    colIdEstadoAprobacion.OptionsColumn.AllowEdit = false;
                    var info = BindingList_orden_pago_estado_aprob.Last();
                    if (info.IdEstadoAprobacion == "" || info.Descripcion == "" || info.IdEstadoAprobacion == null || info.Descripcion == null)
                    {
                        BindingList_orden_pago_estado_aprob.Remove(info); bandEstado = 0;
                    }
                }
                else
                {
                    if (BindingList_orden_pago_estado_aprob.Last().IdEstadoAprobacion == "" || BindingList_orden_pago_estado_aprob.Last().IdEstadoAprobacion == null)
                    {
                        colIdEstadoAprobacion.OptionsColumn.AllowEdit = true;
                        gridViewEstado.FocusedColumn = gridViewTipoOrden_x_Empresa.VisibleColumns[0];
                        gridViewEstado.ShowEditor();
                        gridViewEstado.GetShowEditorMode();
                    }
                }

                gridControlEstado.Update();
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 5
0
        public Boolean GuardarDB(cp_orden_pago_estado_aprob_Info Info)
        {
            try
            {
                EntitiesCuentasxPagar context = new EntitiesCuentasxPagar();
                var address = new cp_orden_pago_estado_aprob();
                address.IdEstadoAprobacion = Info.IdEstadoAprobacion;
                address.Descripcion        = Info.Descripcion;

                context.cp_orden_pago_estado_aprob.Add(address);
                context.SaveChanges();
                return(true);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }