public Boolean GuardarDB(in_movi_inve_x_ct_cbteCble_Info Info)
        {
            try
            {
                using (EntitiesInventario entity = new EntitiesInventario())
                {
                    in_movi_inve_x_ct_cbteCble item = new in_movi_inve_x_ct_cbteCble();
                    item.IdEmpresa         = Info.IdEmpresa;
                    item.IdSucursal        = Info.IdSucursal;
                    item.IdBodega          = Info.IdBodega;
                    item.IdMovi_inven_tipo = Info.IdMovi_inven_tipo;
                    item.IdNumMovi         = Info.IdNumMovi;

                    item.IdEmpresa_ct = Info.IdEmpresa_ct;
                    item.IdTipoCbte   = Info.IdTipoCbte;
                    item.IdCbteCble   = Info.IdCbteCble;
                    item.Observacion  = (Info.Observacion == null) ? "" : Info.Observacion;
                    entity.in_movi_inve_x_ct_cbteCble.Add(item);
                    entity.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 in_movi_inve_x_ct_cbteCble_Info Anular_reversar_Diario_x_Movi_Inven
            (int IdEmpresa, int idsucursal, int idbodega, int idmovi_inven_tipo, decimal idNum_Movi, int IdTipoCbteCble_x_anulacion
            , ref decimal IdCbteCble_Reverso)
        {
            try
            {
                EntitiesInventario entity = new EntitiesInventario();
                in_movi_inve_x_ct_cbteCble_Info Info_Movi = new in_movi_inve_x_ct_cbteCble_Info();

                var Select = from q in entity.in_movi_inve_x_ct_cbteCble
                             where q.IdEmpresa_ct == IdEmpresa && q.IdSucursal == idsucursal &&
                             q.IdBodega == idbodega && q.IdMovi_inven_tipo == idmovi_inven_tipo &&
                             q.IdNumMovi == idNum_Movi
                             select q;


                foreach (var item in Select)
                {
                    Info_Movi.IdEmpresa         = item.IdEmpresa;
                    Info_Movi.IdSucursal        = item.IdSucursal;
                    Info_Movi.IdBodega          = item.IdBodega;
                    Info_Movi.IdMovi_inven_tipo = item.IdMovi_inven_tipo;
                    Info_Movi.IdNumMovi         = item.IdNumMovi;

                    Info_Movi.IdEmpresa_ct = item.IdEmpresa_ct;
                    Info_Movi.IdTipoCbte   = item.IdTipoCbte;
                    Info_Movi.IdCbteCble   = item.IdCbteCble;
                    Info_Movi.Observacion  = item.Observacion;
                }

                string mensaje = "";

                ct_Cbtecble_Data Cbte_Data = new ct_Cbtecble_Data();
                Cbte_Data.ReversoCbteCble(Info_Movi.IdEmpresa_ct, Info_Movi.IdCbteCble, Info_Movi.IdTipoCbte
                                          , IdTipoCbteCble_x_anulacion, ref IdCbteCble_Reverso, ref mensaje, "sys");



                return(Info_Movi);
            }
            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());
            }
        }
Ejemplo n.º 3
0
 public Boolean GuardarDB(in_movi_inve_x_ct_cbteCble_Info Info)
 {
     try
     {
         return(Data.GuardarDB(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("", "Guardar", ex.Message), ex)
               {
                   EntityType = typeof(in_movi_inve_x_in_ordencompra_local_Bus)
               };
     }
 }
Ejemplo n.º 4
0
        private void cargar_cbtecble()
        {
            try
            {
                ucCon_GridDiarioContable_.setAccion(Cl_Enumeradores.eTipo_action.consultar);

                in_movi_inve_x_ct_cbteCble_Bus  MoviInven_Cbtcble_BUS  = new in_movi_inve_x_ct_cbteCble_Bus();
                in_movi_inve_x_ct_cbteCble_Info MoviInven_Cbtcble_info = new in_movi_inve_x_ct_cbteCble_Info();


                MoviInven_Cbtcble_info = MoviInven_Cbtcble_BUS.Obtener_x_Movi_Inven(_movi_inve_Info.IdEmpresa,
                                                                                    _movi_inve_Info.IdSucursal, _movi_inve_Info.IdBodega, _movi_inve_Info.IdMovi_inven_tipo, _movi_inve_Info.IdNumMovi);


                this.ucCon_GridDiarioContable_.setInfo(MoviInven_Cbtcble_info.IdEmpresa, MoviInven_Cbtcble_info.IdTipoCbte, MoviInven_Cbtcble_info.IdCbteCble);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }