Ejemplo n.º 1
0
        public List <com_cotizacion_compra_Info> Get_List_cotizacion_compra(int IdEmpresa)
        {
            try
            {
                List <com_cotizacion_compra_Info> lm = new List <com_cotizacion_compra_Info>();
                EntitiesCompras OEEtapa   = new EntitiesCompras();
                var             registros = from A in OEEtapa.vwcom_cotizacion_compra
                                            where A.IdEmpresa == IdEmpresa
                                            orderby A.IdEmpresa
                                            select A;
                foreach (var item in registros)
                {
                    com_cotizacion_compra_Info info = new com_cotizacion_compra_Info();

                    info.IdEmpresa    = item.IdEmpresa;
                    info.IdSucursal   = Convert.ToInt32(item.IdSucursal);
                    info.IdCotizacion = item.IdCotizacion;
                    info.Observacion  = item.Observacion;
                    info.nom_sucursal = item.nom_sucursal;
                    info.estado       = item.Estado;
                    info.IdProveedor  = Convert.ToInt32(item.IdProveedor);
                    lm.Add(info);
                }
                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);
                mensaje = ex.InnerException + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(ex.ToString());
            }
        }
Ejemplo n.º 2
0
        void ucGe_Menu_Mantenimiento_x_usuario1_event_btnAnular_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                InfoCotiza = (com_cotizacion_compra_Info)gridViewcotizacion.GetFocusedRow();
                if (InfoCotiza == null)
                {
                    MessageBox.Show("Selecciones una fila", "sistemas", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                else
                {
                    FrmPrd_CotizacionCompra_Mantenimiento frm = new FrmPrd_CotizacionCompra_Mantenimiento();
                    frm.set_Acccion(Cl_Enumeradores.eTipo_action.Anular);
                    frm.set_InfoCotiza(InfoCotiza);
                    frm.Text = frm.Text + " ***ANULAR REGISTRO***"; frm.MdiParent = this.MdiParent;
                    frm.Show();

                    frm.event_FrmPrd_CotizacionCompra_Mantenimiento_FormClosing += frm_event_FrmPrd_CotizacionCompra_Mantenimiento_FormClosing;
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.InnerException.ToString());
            }
        }
Ejemplo n.º 3
0
 private void gridViewcotizacion_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     try
     {
         InfoCotiza = GetSelectedRow((DevExpress.XtraGrid.Views.Grid.GridView)sender);
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
     }
 }
Ejemplo n.º 4
0
 public Boolean ModificarDB(com_cotizacion_compra_Info info, ref string msg)
 {
     try
     {
         return(data.ModificarDB(info, ref msg));
     }
     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("", "ModificarDB", ex.Message), ex)
               {
                   EntityType = typeof(com_cotizacion_compra_Bus)
               };
     }
 }
Ejemplo n.º 5
0
 public bool AnularDB(com_cotizacion_compra_Info Info)
 {
     try
     {
         return(data.AnularDB(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("", "AnularDB", ex.Message), ex)
               {
                   EntityType = typeof(com_cotizacion_compra_Bus)
               };
     }
 }
Ejemplo n.º 6
0
        public Boolean ModificarDB(com_cotizacion_compra_Info info, ref string msg)
        {
            try
            {
                using (EntitiesCompras Context = new EntitiesCompras())
                {
                    var contact = Context.com_cotizacion_compra.FirstOrDefault(A => A.IdEmpresa == info.IdEmpresa && A.IdCotizacion == info.IdCotizacion);

                    if (contact != null)
                    {
                        contact.Observacion     = info.Observacion;
                        contact.Fecha_UltMod    = DateTime.Now;
                        contact.IdProveedor     = info.IdProveedor;
                        contact.IdUsuarioUltAnu = info.IdUsuarioUltMod;
                        Context.SaveChanges();

                        //Eliminar detalle
                        com_cotizacion_compra_det_Data odata = new com_cotizacion_compra_det_Data();
                        if (odata.EliminarDB(Convert.ToInt32(info.IdEmpresa), Convert.ToDecimal(info.IdCotizacion), ref msg))
                        {
                            //grabo nuevo detalle

                            foreach (var item in info.Detalle)
                            {
                                item.IdEmpresa    = info.IdEmpresa;
                                item.IdCotizacion = info.IdCotizacion;
                            }

                            if (odata.GuardarDB(info.Detalle, ref msg))
                            {
                                msg = "Actualización exitosa..";
                            }
                        }
                    }
                }
                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);
                msg = ex.InnerException + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref msg);
                throw new Exception(ex.ToString());
            }
        }
        public void set_InfoCotiza(com_cotizacion_compra_Info _SetInfo)
        {
            try
            {
                txtnumcotizaion.Text = Convert.ToString(_SetInfo.IdCotizacion);
                txtobservacion.Text  = _SetInfo.Observacion;
                ucGe_Sucursal_combo1.set_SucursalInfo(_SetInfo.IdSucursal);
                ucCp_Proveedor1.set_ProveedorInfo(_SetInfo.IdProveedor);

                gridControlcotizamant.DataSource = Busllenagrid.Get_list_Cotizacion_detalle(param.IdEmpresa, _SetInfo.IdCotizacion, _SetInfo.IdSucursal);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
                MessageBox.Show(ex.InnerException.ToString());
            }
        }
Ejemplo n.º 8
0
        public Boolean GuardarDB(com_cotizacion_compra_Info info, ref string msg)
        {
            try
            {
                decimal idcotiza = 0;
                using (EntitiesCompras Context = new EntitiesCompras())
                {
                    var Address = new com_cotizacion_compra();

                    Address.IdEmpresa     = info.IdEmpresa;
                    Address.IdCotizacion  = idcotiza = GetId(info.IdEmpresa);
                    Address.Fecha         = DateTime.Now;
                    Address.IdSucursal    = info.IdSucursal;
                    Address.Observacion   = info.Observacion;
                    Address.Estado        = Convert.ToString(info.estado);
                    Address.IdProveedor   = info.IdProveedor;
                    Address.Fecha_Transac = info.Fecha_Transac;
                    Context.com_cotizacion_compra.Add(Address);

                    Context.SaveChanges();

                    //grabar detalle
                    com_cotizacion_compra_det_Data odata = new com_cotizacion_compra_det_Data();

                    if (odata.GuardarDB(info.Detalle, ref msg))
                    {
                        msg = "Grabación exitosa..";
                    }
                }

                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);
                msg = ex.InnerException + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref msg);
                throw new Exception(ex.ToString());
            }
        }
 public void get_Cotiza()
 {
     try
     {
         infoCotiza              = new com_cotizacion_compra_Info();
         infoCotiza.IdEmpresa    = param.IdEmpresa;
         infoCotiza.IdCotizacion = txtnumcotizaion.Text == "" ? 0 : Convert.ToDecimal(txtnumcotizaion.Text);
         infoCotiza.Observacion  = txtobservacion.Text.ToString();
         infoCotiza.IdSucursal   = ucGe_Sucursal_combo1.get_SucursalInfo().IdSucursal;
         infoCotiza.estado       = "A";
         infoCotiza.IdProveedor  = Convert.ToInt32(ucCp_Proveedor1.get_ProveedorInfo().IdProveedor);
         GetDetalle();
         infoCotiza.Detalle       = Listdet;
         infoCotiza.Fecha_Transac = dtpFechareg.Value;
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
         MessageBox.Show(ex.InnerException.ToString());
     }
 }
Ejemplo n.º 10
0
 public bool AnularDB(com_cotizacion_compra_Info Info)
 {
     try
     {
         using (EntitiesCompras Context = new EntitiesCompras())
         {
             var contact = Context.com_cotizacion_compra.First(A => A.IdEmpresa == Info.IdEmpresa && A.IdCotizacion == Info.IdCotizacion);
             contact.FechaHoraAnul   = Info.Fecha_Transac;
             contact.IdUsuarioUltAnu = Info.idUsuario;
             contact.MotivoAnulacion = Info.motiAnulacion;
             contact.Estado          = "I";
             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);
         throw new Exception(ex.ToString());
     }
 }