Пример #1
0
 private void UltraGrid_nota_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     try
     {
         nota_I = (ba_notasDebCre_masivo_Info)UltraGrid_nota.GetFocusedRow();
     }
     catch (Exception ex)
     {
         string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
         MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + ex.Message + " ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
         Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
     }
 }
Пример #2
0
 public Boolean GuardarDB(ba_notasDebCre_masivo_Info Info, ref decimal IdTransaccion)
 {
     try
     {
         return(data.GuardarDB(Info, ref IdTransaccion));
     }
     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("", "GuardarDB", ex.Message), ex)
               {
                   EntityType = typeof(ba_notasDebCre_masivo_Bus)
               };
     }
 }
        public void set(ba_notasDebCre_masivo_Info info, Cl_Enumeradores.eTipo_action _Accion)
        {
            try
            {
                switch (_Accion)
                {
                case Cl_Enumeradores.eTipo_action.consultar:
                    ucGe_Menu.Visible_btnGuardar         = false;
                    ucGe_Menu.Visible_bntGuardar_y_Salir = false;
                    listNotaMasiva.Clear();
                    txt_Memo.Text          = info.Observacion;
                    txt_idTransaccion.Text = Convert.ToString(info.IdTransaccion);
                    listNotaMasiva         = NotaMasi_B.Get_List_notasDebCre_masivo_(info.IdEmpresa, info.IdTransaccion);
                    List <vwba_notasDebCre_masivo_Info> listado = new List <vwba_notasDebCre_masivo_Info>();
                    listado = NotaMasi_B.Get_List_notasDebCre_masivo(info.IdEmpresa, info.IdTransaccion);

                    if (listado != null && listado.Count > 0)
                    {
                        var reg = listado.First();
                        //var c = listNotaMasiva.First();
                        if (info.Deb_Cred == "D")
                        {
                            rB_Debito.Checked = true;
                        }
                        else if (info.Deb_Cred == "C")
                        {
                            rB_Credito.Checked = true;
                        }
                        dt_fechaCbte.Value         = info.fecha;
                        ultraCmbCtaBanco.EditValue = reg.tm_IdBanco;

                        esConsu = "S";
                    }
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + ex.Message + " ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
            }
        }
Пример #4
0
        public Boolean GuardarDB(List <ba_notasDebCre_masivo_Info> Lis, ref decimal IdTran, int IdEmpresa)
        {
            try
            {
                IdTran = Id(IdEmpresa);

                using (EntitiesBanco Context = new EntitiesBanco())
                {
                    foreach (var item in Lis)
                    {
                        ba_notasDebCre_masivo_Info Info = new ba_notasDebCre_masivo_Info();
                        Info = item;

                        ba_notasDebCre_masivo Address = new ba_notasDebCre_masivo();

                        Address.IdEmpresa     = Info.IdEmpresa;
                        Address.IdTransaccion = IdTran;
                        Address.IdEmpresa_cb  = Info.IdEmpresa_cb;
                        Address.IdCbteCble_cb = Info.IdCbteCble_cb;
                        Address.IdTipocbte_cb = Info.IdTipocbte_cb;
                        Address.Observacion   = Info.Observacion;
                        Address.Deb_Cred      = Info.Deb_Cred;
                        Address.fecha         = Info.fecha;
                        Address.IdUsuario     = Info.IdUsuario;
                        Address.Fecha_Transac = Info.Fecha_Transac;
                        Address.nom_pc        = Info.nom_pc;
                        Address.ip            = Info.ip;

                        Context.ba_notasDebCre_masivo.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.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
Пример #5
0
 public List <ba_notasDebCre_masivo_Info> Get_List_ba_notasDebCre_masivo(int IdEmpresa, decimal IdTransaccion)
 {
     try
     {
         List <ba_notasDebCre_masivo_Info> Lst = new List <ba_notasDebCre_masivo_Info>();
         EntitiesBanco oEnti = new EntitiesBanco();
         var           Query = from q in oEnti.ba_notasDebCre_masivo
                               where q.IdEmpresa == IdEmpresa && q.IdTransaccion == IdTransaccion
                               select q;
         foreach (var item in Query)
         {
             ba_notasDebCre_masivo_Info Obj = new ba_notasDebCre_masivo_Info();
             Obj.IdEmpresa     = item.IdEmpresa;
             Obj.IdTransaccion = item.IdTransaccion;
             Obj.IdEmpresa_cb  = item.IdEmpresa_cb;
             Obj.IdCbteCble_cb = item.IdCbteCble_cb;
             Obj.IdTipocbte_cb = item.IdTipocbte_cb;
             Obj.Observacion   = item.Observacion;
             Obj.Deb_Cred      = item.Deb_Cred;
             Obj.fecha         = item.fecha;
             Obj.IdUsuario     = item.IdUsuario;
             Obj.Fecha_Transac = item.Fecha_Transac;
             Obj.nom_pc        = item.nom_pc;
             Obj.ip            = item.ip;
             Lst.Add(Obj);
         }
         return(Lst);
     }
     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.InnerException + " " + ex.Message;
         throw new Exception(ex.InnerException.ToString());
     }
 }
Пример #6
0
        public List <ba_notasDebCre_masivo_Info> Get_List_notasDebCre_masivo(int IdEmpresa)
        {
            try
            {
                List <ba_notasDebCre_masivo_Info> Lst = new List <ba_notasDebCre_masivo_Info>();
                using (EntitiesBanco ent = new EntitiesBanco())
                {
                    var select_ = from t in ent.vwba_notasDebCre_masivo_consul
                                  where t.IdEmpresa == IdEmpresa
                                  select t;


                    foreach (var item in select_)
                    {
                        ba_notasDebCre_masivo_Info Obj = new ba_notasDebCre_masivo_Info();
                        Obj.IdEmpresa          = item.IdEmpresa;
                        Obj.IdTransaccion      = item.IdTransaccion;
                        Obj.fecha              = item.tm_fecha;
                        Obj.Deb_Cred           = item.tm_tipo;
                        Obj.Observacion        = item.tm_observacion;
                        Obj.IdUsuario          = item.tm_IdUsuario;
                        Obj.TotalTransacciones = Convert.ToInt32(item.TotalTransacciones);
                        Lst.Add(Obj);
                    }
                    return(Lst);
                }
            }
            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.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
        public Boolean  Grabar()
        {
            try
            {
                Boolean res = false;
                try
                {
                    txt_Memo.Focus();
                    string           msg  = "";
                    ba_Cbte_Ban_Info info = new ba_Cbte_Ban_Info();


                    if (valida())
                    {
                        for (int i = 0; i < gridView_CbteBan.RowCount; i++)
                        {
                            if (info != null)
                            {
                                if (CbteCble_B.GrabarDB(get_CbteCble(info.cb_Valor, info.cb_Observacion, Convert.ToInt32(info.IdTipoNota), info.cb_Fecha), ref IdCbteCble, ref msg))
                                {
                                    if (CbteBan_B.GrabarDB(get_CbteBan(info.cb_Valor, info.cb_Observacion, Convert.ToInt32(info.IdTipoNota), info.cb_Fecha), ref MensajeError))
                                    {
                                        ba_notasDebCre_masivo_Info infoNota = new ba_notasDebCre_masivo_Info();

                                        infoNota.IdEmpresa     = param.IdEmpresa;
                                        infoNota.IdCbteCble_cb = IdCbteCble;
                                        infoNota.IdEmpresa_cb  = param.IdEmpresa;
                                        infoNota.IdTipocbte_cb = IdTipoCbte;
                                        infoNota.Observacion   = txt_Memo.Text.Trim();
                                        infoNota.fecha         = Convert.ToDateTime(dt_fechaCbte.Value.ToShortDateString());
                                        infoNota.Fecha_Transac = param.Fecha_Transac;
                                        infoNota.Deb_Cred      = rB_Credito.Checked == true ? "C" : "D";
                                        infoNota.IdUsuario     = param.IdUsuario;
                                        infoNota.ip            = param.ip;
                                        infoNota.nom_pc        = param.nom_pc;

                                        listNotaMasiva.Add(infoNota);
                                    }
                                    else
                                    {
                                        MessageBox.Show(msg); return(false);
                                    }
                                }
                                else
                                {
                                    return(false);
                                }
                            }
                        }
                        decimal IdTransaccion = 0;
                        if (NotaMasi_B.GuardarDB(listNotaMasiva, ref IdTransaccion, param.IdEmpresa))
                        {
                            string smensaje = string.Format(Core.Erp.Recursos.Properties.Resources.msgDespues_Grabar, "La Transacción de Notas Masivas ", IdTransaccion);
                            MessageBox.Show(smensaje, param.Nombre_sistema);
                            //MessageBox.Show("Se Guardo correctamente Transacción de Notas Masivas #" + IdTransaccion, param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Information);
                            ucGe_Menu.Visible_btnGuardar         = false;
                            ucGe_Menu.Enabled_bntLimpiar         = false;
                            ucGe_Menu.Visible_bntGuardar_y_Salir = false;
                            secuencial = 1;
                            LstBin_CbteBan.ToList().ForEach(q => q.cb_secuencia = secuencial++);
                            gridControl_CbteBan.DataSource = LstBin_CbteBan;
                        }
                        else
                        {
                            MessageBox.Show(Core.Erp.Recursos.Properties.Resources.msgError_Grabar, param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            return(false);
                        }

                        txt_idTransaccion.Text = IdTransaccion.ToString();
                    }

                    res = true;
                }
                catch (Exception ex)
                {
                    Log_Error_bus.Log_Error(ex.ToString());
                }
                return(res);
            }
            catch (Exception ex)
            {
                string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
                MessageBox.Show(param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas) + ex.Message + " ", param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
                return(false);
            }
        }