Пример #1
0
 public fa_TipoNota_x_Empresa_x_Sucursal_Info get_info(int IdEmpresa, int IdTipoNota, int IdSucursal)
 {
     try
     {
         fa_TipoNota_x_Empresa_x_Sucursal_Info info;
         using (Entities_facturacion Context = new Entities_facturacion())
         {
             var Entity = Context.fa_TipoNota_x_Empresa_x_Sucursal.Where(q => q.IdEmpresa == IdEmpresa && q.IdTipoNota == IdTipoNota && q.IdSucursal == IdSucursal).FirstOrDefault();
             if (Entity == null)
             {
                 return(null);
             }
             info = new fa_TipoNota_x_Empresa_x_Sucursal_Info
             {
                 IdEmpresa  = Entity.IdEmpresa,
                 IdSucursal = Entity.IdSucursal,
                 IdTipoNota = Entity.IdTipoNota,
                 IdCtaCble  = Entity.IdCtaCble
             };
         }
         return(info);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #2
0
        public List <fa_TipoNota_x_Empresa_x_Sucursal_Info> Get_List_TipoNota_x_Empresa_x_Sucursal_x_TipoNota(int IdEmpresa, int idTipoNota)
        {
            try
            {
                List <fa_TipoNota_x_Empresa_x_Sucursal_Info> Lista = new List <fa_TipoNota_x_Empresa_x_Sucursal_Info>();
                EntitiesFacturacion fact = new EntitiesFacturacion();
                var select = from q in fact.fa_TipoNota_x_Empresa_x_Sucursal where q.IdEmpresa == IdEmpresa && q.IdTipoNota == idTipoNota select q;

                foreach (var item in select)
                {
                    fa_TipoNota_x_Empresa_x_Sucursal_Info info = new fa_TipoNota_x_Empresa_x_Sucursal_Info();
                    info.IdEmpresa  = item.IdEmpresa;
                    info.IdSucursal = item.IdSucursal;
                    info.IdTipoNota = item.IdTipoNota;
                    info.IdCtaCble  = Convert.ToString(item.IdCtaCble);
                    info.EstaEnBase = "S";
                    Lista.Add(info);
                }
                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);
                mensaje = ex.ToString();
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(ex.ToString());
            }
        }
Пример #3
0
        public void UpdateRow(fa_TipoNota_x_Empresa_x_Sucursal_Info info_det, decimal IdTransaccionSession)
        {
            fa_TipoNota_x_Empresa_x_Sucursal_Info edited_info = get_list(IdTransaccionSession).Where(m => m.IdTipoNota == info_det.IdTipoNota).First();

            info_det.IdEmpresa    = info_det.IdEmpresa;
            info_det.IdSucursal   = info_det.IdSucursal;
            edited_info.IdCtaCble = info_det.IdCtaCble;
        }
Пример #4
0
        public ActionResult Editing_Update([ModelBinder(typeof(DevExpressEditorsBinder))] fa_TipoNota_x_Empresa_x_Sucursal_Info info_det)
        {
            if (ModelState.IsValid)
            {
                List_fa_TipoNota_x_Empresa_x_Sucursal.UpdateRow(info_det, Convert.ToInt32(SessionFixed.IdTransaccionSessionActual));
            }
            var model = List_fa_TipoNota_x_Empresa_x_Sucursal.get_list(Convert.ToInt32(SessionFixed.IdTransaccionSessionActual));

            cargar_combos_det();
            return(PartialView("_GridViewPartial_tipo_nota_sucursal", model));
        }
Пример #5
0
        public void AddRow(fa_TipoNota_x_Empresa_x_Sucursal_Info info_det, decimal IdTransaccionSession)
        {
            List <fa_TipoNota_x_Empresa_x_Sucursal_Info> list = get_list(IdTransaccionSession);

            info_det.secuencia  = list.Count == 0 ? 1 : list.Max(q => q.secuencia) + 1;
            info_det.IdEmpresa  = info_det.IdEmpresa;
            info_det.IdSucursal = info_det.IdSucursal;
            info_det.IdTipoNota = info_det.IdTipoNota;
            info_det.IdCtaCble  = info_det.IdCtaCble;

            list.Add(info_det);
        }
Пример #6
0
 void LoadGrid()
 {
     try
     {
         var Sucursales = Sucursal_B.Get_List_Sucursal(param.IdEmpresa);
         foreach (var item in Sucursales)
         {
             fa_TipoNota_x_Empresa_x_Sucursal_Info Info = new fa_TipoNota_x_Empresa_x_Sucursal_Info();
             Info.IdSucursal = item.IdSucursal;
             Info.Sucursal   = item.Su_Descripcion;
             Info.IdEmpresa  = param.IdEmpresa;
             List_Det.Add(Info);
         }
     }
     catch (Exception ex)
     {
         string NameMetodo = System.Reflection.MethodBase.GetCurrentMethod().Name;
         NameMetodo = NameMetodo + " - " + ex.ToString();
         MessageBox.Show(NameMetodo + " " + param.Get_Mensaje_sys(enum_Mensajes_sys.Error_comunicarse_con_sistemas)
                         , param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error);
         Log_Error_bus.Log_Error(NameMetodo + " - " + ex.ToString());
     }
 }