Exemple #1
0
 private void gridViewForma_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     try
     {
         //  borrarChekgridForma();
         //   gridViewForma.SetFocusedRowCellValue(colCheckForma, true);
         //gridViewForma.SetRowCellValue(e.FocusedRowHandle, colCheckForma, true);
         cp_orden_pago_formapago_Info data = (cp_orden_pago_formapago_Info)gridViewForma.GetRow(e.FocusedRowHandle);
         if (e.FocusedRowHandle != BindingList_orden_pago_formapago.Count - 1)
         {
             colIdFormaPago.OptionsColumn.AllowEdit = false;
             var info = BindingList_orden_pago_formapago.Last();
             if ((info.IdFormaPago == null || info.descripcion == null))
             {
                 BindingList_orden_pago_formapago.Remove(info); bandForma = 0;
             }
         }
         else
         {
             if (BindingList_orden_pago_formapago.Last().IdFormaPago == null || BindingList_orden_pago_formapago.Last().IdFormaPago == "")
             {
                 colIdFormaPago.OptionsColumn.AllowEdit = true;
             }
         }
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
        public Boolean ModificarDB(cp_orden_pago_formapago_Info Info)
        {
            try
            {
                EntitiesCuentasxPagar ECXP = new EntitiesCuentasxPagar();

                var FormaPago = ECXP.cp_orden_pago_formapago.FirstOrDefault(var => var.IdFormaPago == Info.IdFormaPago);
                if (FormaPago != null)
                {
                    FormaPago.descripcion       = Info.descripcion;
                    FormaPago.IdTipoTransaccion = Info.IdTipoTransaccion;
                    FormaPago.CodModulo         = Info.CodModulo;
                    FormaPago.IdTipoMovi_caj    = Info.IdTipoMovi_caj;
                    ECXP.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());
            }
        }
        public List <cp_orden_pago_formapago_Info> Get_List_orden_pago_formapago()
        {
            try
            {
                List <cp_orden_pago_formapago_Info> lM = new List <cp_orden_pago_formapago_Info>();
                EntitiesCuentasxPagar ECXP             = new EntitiesCuentasxPagar();

                var FormaPago = from selec in ECXP.cp_orden_pago_formapago

                                select selec;

                foreach (var item in FormaPago)
                {
                    cp_orden_pago_formapago_Info info = new cp_orden_pago_formapago_Info();
                    info.IdFormaPago       = item.IdFormaPago;
                    info.descripcion       = item.descripcion;
                    info.IdTipoTransaccion = item.IdTipoTransaccion;
                    info.CodModulo         = item.CodModulo;
                    info.IdTipoMovi_caj    = item.IdTipoMovi_caj;

                    lM.Add(info);
                }
                return(lM);
            }
            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());
            }
        }
Exemple #4
0
 public Boolean ModificarDB(cp_orden_pago_formapago_Info Info)
 {
     try
     {
         return(odata.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_formapago_Bus)
               };
     }
 }
Exemple #5
0
        private void btnNuevoForma_Click(object sender, EventArgs e)
        {
            try
            {
                if (BindingList_orden_pago_formapago.Count > 0)
                {
                    var temp = (cp_orden_pago_formapago_Info)gridViewForma.GetRow(gridViewForma.RowCount - 1);
                    if (temp.IdFormaPago != "" && temp.descripcion != "" && temp.IdFormaPago != null && temp.descripcion != null)
                    {
                        bandForma = 1;

                        Info_FormaPago = new cp_orden_pago_formapago_Info();
                        BindingList_orden_pago_formapago.Add(Info_FormaPago);
                        gridControlForma.Refresh();
                    }
                }
                else
                {
                    colIdFormaPago.OptionsColumn.AllowEdit = true;
                    gridViewForma.AddNewRow();
                    BindingList_orden_pago_formapago = new BindingList <cp_orden_pago_formapago_Info>();
                    bandForma = 1;
                    Info_FormaPago.IdFormaPago       = "";
                    Info_FormaPago.descripcion       = "";
                    Info_FormaPago.IdTipoTransaccion = "";
                    Info_FormaPago.CodModulo         = "";
                    Info_FormaPago.IdTipoMovi_caj    = 0;
                    BindingList_orden_pago_formapago.Add(Info_FormaPago);
                    gridControlForma.Refresh();
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());

                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }