public Boolean AnularDB(pre_PedidoXPresupuesto_Info info)
 {
     try
     {
         using (EntitiesPresupuesto context = new EntitiesPresupuesto())
         {
             var contact = context.pre_PedidoXPresupuesto.FirstOrDefault(minfo => minfo.IdEmpresa == info.IdEmpresa && minfo.IdPedidoXPre == info.IdPedidoXPre);
             if (contact != null)
             {
                 contact.Estado          = "I";
                 contact.Fecha_UltAnu    = info.Fecha_UltAnu;
                 contact.IdUsuarioUltAnu = info.IdUsuarioUltAnu;
                 contact.MotivoAnulacion = info.MotivoAnulacion;
                 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());
     }
 }
 private void UltraGrid_pedidoXpresupuesto_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     try
     {
         PedidoPre_I = (pre_PedidoXPresupuesto_Info)UltraGrid_pedidoXpresupuesto.GetFocusedRow();
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
     }
 }
 public Boolean AnularDB(pre_PedidoXPresupuesto_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(pre_PedidoXPresupuesto_Bus)
               };
     }
 }
 public Boolean GrabarDB(pre_PedidoXPresupuesto_Info Info, ref decimal IdPedidoXPre)
 {
     try
     {
         return(data.GrabarDB(Info, ref IdPedidoXPre));
     }
     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("", "GrabarDB", ex.Message), ex)
               {
                   EntityType = typeof(pre_PedidoXPresupuesto_Bus)
               };
     }
 }
        public List <pre_PedidoXPresupuesto_Info> ObtenerList(int IdEmpresa)
        {
            try
            {
                List <pre_PedidoXPresupuesto_Info> Lst = new List <pre_PedidoXPresupuesto_Info>();
                EntitiesPresupuesto oEnti = new EntitiesPresupuesto();
                var Query = from q in oEnti.pre_PedidoXPresupuesto
                            where q.IdEmpresa == IdEmpresa
                            select q;
                foreach (var item in Query)
                {
                    pre_PedidoXPresupuesto_Info Obj = new pre_PedidoXPresupuesto_Info();
                    Obj.IdEmpresa       = item.IdEmpresa;
                    Obj.IdPedidoXPre    = item.IdPedidoXPre;
                    Obj.IdDepartamento  = item.IdDepartamento;
                    Obj.Fecha           = item.Fecha;
                    Obj.Observacion     = item.Observacion;
                    Obj.IdProveedor1    = item.IdProveedor1;
                    Obj.IdProveedor2    = item.IdProveedor2;
                    Obj.IdProveedor3    = item.IdProveedor3;
                    Obj.IdUsuario       = item.IdUsuario;
                    Obj.Fecha_Transac   = item.Fecha_Transac;
                    Obj.IdUsuarioUltMod = item.IdUsuarioUltMod;
                    Obj.Fecha_UltMod    = item.Fecha_UltMod;
                    Obj.IdUsuarioUltAnu = item.IdUsuarioUltAnu;
                    Obj.Fecha_UltAnu    = item.Fecha_UltAnu;
                    Obj.nom_pc          = item.nom_pc;
                    Obj.ip     = item.ip;
                    Obj.Estado = item.Estado;


                    Lst.Add(Obj);
                }
                return(Lst);
            }
            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());
            }
        }
        private void llamaFrmMant(Cl_Enumeradores.eTipo_action Accion, pre_PedidoXPresupuesto_Info Info)
        {
            try
            {
                frm = new frmpre_pedidoProducto();
                frm.event_frmpre_pedidoProducto_FormClosing += new frmpre_pedidoProducto.delegate_frmpre_pedidoProducto_FormClosing(frm_event_frmpre_pedidoProducto_FormClosing);
                frm.MdiParent = this.MdiParent;
                frm.set_accion(Accion);

                frm.Show();
                if (!(Accion == Cl_Enumeradores.eTipo_action.grabar))
                {
                    frm.set_pedido(Info);
                }
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }
示例#7
0
        public void set_pedido(pre_PedidoXPresupuesto_Info info)
        {
            try
            {
                txt_NPedido.Text = info.IdPedidoXPre.ToString();
                searchLookUpEdit_Depart.EditValue = info.IdDepartamento;
                dtp_fecha.Value      = info.Fecha;
                txt_observacion.Text = info.Observacion;
                searchLookUpEdit_Prove1.EditValue = info.IdProveedor1;
                searchLookUpEdit_Prove2.EditValue = info.IdProveedor2;
                searchLookUpEdit_Prove3.EditValue = info.IdProveedor3;
                txt_usuario.Text   = info.IdUsuario;
                lblanulado.Visible = (info.Estado == "I")?true : false;

                set_pedido_det(info.IdPedidoXPre);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }
 public Boolean GrabarDB(pre_PedidoXPresupuesto_Info Info, ref decimal IdPedidoXPre)
 {
     try
     {
         List <pre_PedidoXPresupuesto_Info> Lst = new List <pre_PedidoXPresupuesto_Info>();
         using (EntitiesPresupuesto Context = new EntitiesPresupuesto())
         {
             var Address = new pre_PedidoXPresupuesto();
             IdPedidoXPre           = getIdPedidoXPre(Info.IdEmpresa);
             Address.IdEmpresa      = Info.IdEmpresa;
             Address.IdPedidoXPre   = IdPedidoXPre;
             Address.IdDepartamento = Info.IdDepartamento;
             Address.Fecha          = Convert.ToDateTime(Info.Fecha.ToShortDateString());
             Address.Observacion    = Info.Observacion;
             Address.IdProveedor1   = Info.IdProveedor1;
             Address.IdProveedor2   = Info.IdProveedor2;
             Address.IdProveedor3   = Info.IdProveedor3;
             Address.IdUsuario      = Info.IdUsuario;
             Address.Fecha_Transac  = Info.Fecha_Transac;
             Address.nom_pc         = Info.nom_pc;
             Address.ip             = Info.ip;
             Address.Estado         = Info.Estado;
             Context.pre_PedidoXPresupuesto.Add(Address);
             Context.SaveChanges();
             //guardar detalle
             dat_det.GrabarLista(Info.Lst_PedidoXPre_D, IdPedidoXPre);
         }
         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 Boolean ModificarDB(pre_PedidoXPresupuesto_Info info)
        {
            try
            {
                using (EntitiesPresupuesto context = new EntitiesPresupuesto())
                {
                    var contact = context.pre_PedidoXPresupuesto.FirstOrDefault(minfo => minfo.IdEmpresa == info.IdEmpresa && minfo.IdPedidoXPre == info.IdPedidoXPre);
                    if (contact != null)
                    {
                        contact.IdDepartamento  = info.IdDepartamento;
                        contact.Fecha           = Convert.ToDateTime(info.Fecha.ToShortDateString());
                        contact.Observacion     = info.Observacion;
                        contact.IdProveedor1    = info.IdProveedor1;
                        contact.IdProveedor2    = info.IdProveedor2;
                        contact.IdProveedor3    = info.IdProveedor3;
                        contact.Estado          = info.Estado;
                        contact.Fecha_UltMod    = info.Fecha_UltMod;
                        contact.IdUsuarioUltMod = info.IdUsuarioUltMod;

                        dat_det.ModificarDB(info.Lst_PedidoXPre_D, info.IdEmpresa, info.IdPedidoXPre);

                        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());
            }
        }