Пример #1
0
        public bool GuardarDB(fa_grupo_x_sub_centro_costo_det_Info Info, ref string mensaje)
        {
            try
            {
                using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ())
                {
                    fa_grupo_x_sub_centro_costo_det contact = new fa_grupo_x_sub_centro_costo_det();

                    contact.IdEmpresa     = Info.IdEmpresa;
                    contact.IdGrupo       = Info.IdGrupo;
                    contact.Secuencia     = Info.Secuencia;
                    contact.IdCentroCosto = Info.IdCentroCosto;
                    contact.IdCentroCosto_sub_centro_costo = Info.IdCentroCosto_sub_centro_costo;

                    Context.fa_grupo_x_sub_centro_costo_det.Add(contact);
                    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();
                throw new Exception(ex.ToString());
            }
        }
Пример #2
0
        public List <fa_grupo_x_sub_centro_costo_det_Info> Get_List_Grup_Sub_Det(int IdEmpresa, string IdCentroCosto, Decimal IdGrupo, ref string mensaje)
        {
            try
            {
                List <fa_grupo_x_sub_centro_costo_det_Info> Lista = new List <fa_grupo_x_sub_centro_costo_det_Info>();

                using (Entity_Facturacion_FJ Context = new Entity_Facturacion_FJ())
                {
                    var contact = from q in Context.vwfa_grupo_x_sub_centro_costo_det_scc_sin_grupo
                                  where q.IdEmpresa == IdEmpresa &&
                                  q.IdCentroCosto == IdCentroCosto
                                  select q;

                    var contact1 = from q in Context.vwfa_grupo_x_sub_centro_costo_det
                                   where q.IdEmpresa == IdEmpresa &&
                                   q.IdCentroCosto == IdCentroCosto &&
                                   q.IdGrupo == IdGrupo
                                   select q;

                    foreach (var item in contact)
                    {
                        fa_grupo_x_sub_centro_costo_det_Info Info = new fa_grupo_x_sub_centro_costo_det_Info();
                        Info.IdEmpresa = item.IdEmpresa;
                        Info.IdCentroCosto_sub_centro_costo = item.IdCentroCosto_sub_centro_costo;
                        Info.IdCentroCosto      = item.IdCentroCosto;
                        Info.cod_subcentroCosto = item.cod_subcentroCosto;
                        Info.Centro_costo       = item.Centro_costo;
                        Info.pc_Estado          = item.pc_Estado;
                        Info.IdCtaCble          = item.IdCtaCble;
                        Lista.Add(Info);
                    }

                    foreach (var item in contact1)
                    {
                        fa_grupo_x_sub_centro_costo_det_Info Info = new fa_grupo_x_sub_centro_costo_det_Info();
                        Info.IdEmpresa = item.IdEmpresa;
                        Info.IdCentroCosto_sub_centro_costo = item.IdCentroCosto_sub_centro_costo;
                        Info.IdCentroCosto      = item.IdCentroCosto;
                        Info.cod_subcentroCosto = item.cod_subcentroCosto;
                        Info.Centro_costo       = item.Centro_costo;
                        Info.pc_Estado          = item.pc_Estado;
                        Info.IdCtaCble          = item.IdCtaCble;
                        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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
Пример #3
0
 public bool GuardarDB(fa_grupo_x_sub_centro_costo_det_Info Info, ref string mensaje)
 {
     try
     {
         return(oData.GuardarDB(Info, ref mensaje));
     }
     catch (Exception ex)
     {
         mensaje = ex.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(), "", mensaje, "", "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         throw new Exception(mensaje);
     }
 }