Exemplo n.º 1
0
 public Boolean Anular(prod_CompraChatarra_CusTalme_Info Info, ref string Mensaje)
 {
     try
     {
         using (EntitiesProduccion oEnt = new EntitiesProduccion())
         {
             var Contact = oEnt.prod_CompraChatarra_CusTalme.FirstOrDefault(var => var.IdEmpresa == Info.IdEmpresa && var.IdLiquidacion == Info.IdLiquidacion);
             if (Contact != null)
             {
                 Contact.Estado       = "I";
                 Contact.Fecha_UltAnu = Info.Fecha_UltAnu;
                 Contact.IdUsuario    = Info.IdUsuario;
                 Contact.ip           = Info.ip;
                 Contact.nom_pc       = Info.nom_pc;
                 oEnt.SaveChanges();
                 Mensaje = "Se Ha procedido Anular Con exito La Transaccion # " + Info.IdLiquidacion;
             }
         }
         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);
         mensaje = ex.ToString() + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         throw new Exception(ex.ToString());
     }
 }
Exemplo n.º 2
0
 void Get()
 {
     try
     {
         _Info = new prod_CompraChatarra_CusTalme_Info();
         _Info.Beneficiario      = cmbBeneficiario.Text.Trim();
         _Info.Descuento         = Convert.ToDouble(txtDesct.EditValue);
         _Info.Fecha             = Convert.ToDateTime(Convert.ToDateTime(dtpFecha.EditValue).ToShortDateString());
         _Info.IdEmpresa         = param.IdEmpresa;
         _Info.IdLiquidacion     = Convert.ToDecimal(txtIdLiquidacion.EditValue);
         _Info.IdProveedor       = Convert.ToDecimal(cmbProveedor.EditValue);
         _Info.IdProveedor_Presu = Convert.ToDecimal(cmbPresupuesto.EditValue);
         _Info.IdTipoChatarra    = Convert.ToInt32(cmbChatarraTipo.EditValue);
         _Info.Placa             = txtPlaca.Text;
         _Info.PrecioChatarra    = Convert.ToDouble(txtPrecio.EditValue);
         _Info.Subtotal          = Convert.ToDouble(txtSubtotsl.EditValue);
         _Info.TLlenoKg          = Convert.ToDouble(txtLleno.EditValue);
         _Info.TMermaKg          = Convert.ToDouble(txtMerma.EditValue);
         _Info.Total             = Convert.ToDouble(txtTotal.EditValue);
         _Info.TVacionKg         = Convert.ToDouble(txtVacio.EditValue);
         _Info.TNetokg           = Convert.ToDouble(txtNeto.EditValue);
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
     }
 }
 private void gridView_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     try
     {
         _Info = (prod_CompraChatarra_CusTalme_Info)gridView.GetFocusedRow();
     }
     catch (Exception ex)
     {
         Log_Error_bus.Log_Error(ex.ToString());
     }
 }
Exemplo n.º 4
0
        public Boolean GuardarDB(prod_CompraChatarra_CusTalme_Info Info, ref decimal IdLiquidacion, ref string Mensaje)
        {
            try
            {
                List <prod_CompraChatarra_CusTalme_Info> Lst = new List <prod_CompraChatarra_CusTalme_Info>();
                using (EntitiesProduccion Context = new EntitiesProduccion())
                {
                    var Address = new prod_CompraChatarra_CusTalme();

                    Address.IdEmpresa         = Info.IdEmpresa;
                    Address.IdLiquidacion     = IdLiquidacion = GetId(Info.IdEmpresa);
                    Address.IdProveedor_Presu = Info.IdProveedor_Presu;
                    Address.IdProveedor       = Info.IdProveedor;
                    Address.Fecha             = Info.Fecha;
                    Address.Beneficiario      = Info.Beneficiario;
                    Address.Placa             = Info.Placa;
                    Address.IdTipoChatarra    = Info.IdTipoChatarra;
                    Address.PrecioChatarra    = Info.PrecioChatarra;
                    Address.TLlenoKg          = Info.TLlenoKg;
                    Address.TVacionKg         = Info.TVacionKg;
                    Address.TMermaKg          = Info.TMermaKg;
                    Address.TNetokg           = Info.TNetokg;
                    Address.Subtotal          = Info.Subtotal;
                    Address.Descuento         = Info.Descuento;
                    Address.Total             = Info.Total;
                    Address.IdUsuario         = Info.IdUsuario;
                    Address.IdUsuarioUltMod   = Info.IdUsuario;
                    Address.Fecha_Transa      = Info.Fecha_Transaccion;
                    Address.Fecha_UltMod      = Info.Fecha_UltMod;
                    Address.ip     = Info.ip;
                    Info.nom_pc    = Info.nom_pc;
                    Address.Estado = "A";

                    Context.prod_CompraChatarra_CusTalme.Add(Address);
                    Context.SaveChanges();

                    Mensaje = "Registro # " + IdLiquidacion + " Ingresado Correctamente";
                }
                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);
                mensaje = ex.ToString() + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                throw new Exception(ex.ToString());
            }
        }
 public Boolean Anular(prod_CompraChatarra_CusTalme_Info Info, ref string Mensaje)
 {
     try
     {
         Info.Fecha_UltAnu = param.Fecha_Transac;
         Info.IdUsuario    = param.IdUsuario;
         Info.ip           = param.ip;
         Info.nom_pc       = param.nom_pc;
         return(Data.Anular(Info, ref Mensaje));
     }
     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("", "Anular", ex.Message), ex)
               {
                   EntityType = typeof(prod_CompraChatarra_CusTalme_Bus)
               };
     }
 }
 public Boolean GuardarDB(prod_CompraChatarra_CusTalme_Info Info, ref decimal IdLiquidacion, ref string Mensaje)
 {
     try
     {
         Info.IdUsuario         = param.IdUsuario;
         Info.IdUsuarioUltModi  = param.IdUsuario;
         Info.Fecha_Transaccion = param.Fecha_Transac;
         Info.Fecha_UltMod      = param.Fecha_Transac;
         Info.ip     = param.ip;
         Info.nom_pc = param.nom_pc;
         return(Data.GuardarDB(Info, ref IdLiquidacion, ref Mensaje));
     }
     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("", "GuardarDB", ex.Message), ex)
               {
                   EntityType = typeof(prod_CompraChatarra_CusTalme_Bus)
               };
     }
 }