public List <cp_orden_giro_x_com_ordencompra_local_Info> Get_List_orden_giro_x_com_ordencompra_local(int IdEmpresa_Ogiro)
        {
            try
            {
                List <cp_orden_giro_x_com_ordencompra_local_Info> lM = new List <cp_orden_giro_x_com_ordencompra_local_Info>();
                EntitiesCuentasxPagar db = new EntitiesCuentasxPagar();

                var select_ = from T in db.cp_orden_giro_x_com_ordencompra_local
                              where T.og_IdEmpresa == IdEmpresa_Ogiro
                              select T;

                foreach (var item in select_)
                {
                    cp_orden_giro_x_com_ordencompra_local_Info dat = new cp_orden_giro_x_com_ordencompra_local_Info();
                    dat.com_IdEmpresa          = item.com_IdEmpresa;
                    dat.com_IdOrdenCompraLocal = item.com_IdOrdenCompraLocal;
                    dat.com_IdSucursal         = item.com_IdSucursal;
                    dat.og_IdCbteCble          = item.og_IdCbteCble;
                    dat.og_IdEmpresa           = item.og_IdEmpresa;
                    dat.og_IdTipoCbte          = item.og_IdTipoCbte;

                    lM.Add(dat);
                }
                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());
            }
        }
 public Boolean EliminarDB(cp_orden_giro_x_com_ordencompra_local_Info info)
 {
     try
     {
         using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
         {
             var contact = context.cp_orden_giro_x_com_ordencompra_local.FirstOrDefault(minfo => minfo.com_IdEmpresa == info.com_IdEmpresa && minfo.com_IdOrdenCompraLocal == info.com_IdOrdenCompraLocal && minfo.com_IdSucursal == info.com_IdSucursal && minfo.og_IdCbteCble == info.og_IdCbteCble && minfo.og_IdEmpresa == info.og_IdEmpresa && minfo.og_IdTipoCbte == info.og_IdTipoCbte);
             if (contact != null)
             {
                 context.cp_orden_giro_x_com_ordencompra_local.Remove(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() + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
Ejemplo n.º 3
0
 public Boolean EliminarDB(cp_orden_giro_x_com_ordencompra_local_Info info)
 {
     try
     {
         return(data.EliminarDB(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("", "EliminarDB", ex.Message), ex)
               {
                   EntityType = typeof(cp_orden_giro_x_com_ordencompra_local_Bus)
               };
     }
 }
        public Boolean GrabarDB(cp_orden_giro_x_com_ordencompra_local_Info info)
        {
            try
            {
                using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
                {
                    EntitiesCuentasxPagar EDB = new EntitiesCuentasxPagar();

                    //var contact = cp_orden_giro_x_com_ordencompra_local.Createcp_orden_giro_x_com_ordencompra_local(0, 0, 0, 0, 0, 0);
                    var address = new cp_orden_giro_x_com_ordencompra_local();

                    address.com_IdEmpresa          = info.com_IdEmpresa;
                    address.com_IdOrdenCompraLocal = info.com_IdOrdenCompraLocal;
                    address.com_IdSucursal         = info.com_IdSucursal;
                    address.og_IdCbteCble          = info.og_IdCbteCble;
                    address.og_IdEmpresa           = info.og_IdEmpresa;
                    address.og_IdTipoCbte          = info.og_IdTipoCbte;
                    address.og_Observacion         = info.og_Observacion;

                    //contact = address;

                    context.cp_orden_giro_x_com_ordencompra_local.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.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }