Esempio n. 1
0
 /// <summary>
 /// Retorna los artículos del kardex.
 /// </summary>
 public List<BEKardexInventory> Get_PSCP_SPLS_SVMD_ALMA_KARD(BEKardexInventory obj)
 {
     using (var odr = oda.Get_PSCP_SPLS_SVMD_ALMA_KARD(obj))
     {
         var olst = new List<BEKardexInventory>();
         ((IList)olst).LoadFromReader<BEKardexInventory>(odr);
         Dispose(false);
         return (olst);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Retorna los artículos del kardex.
 /// </summary>
 public IDataReader Get_PSCP_SPLS_SVMD_ALMA_KARD(BEKardexInventory obj)
 {
     try
     {
         if (ocn.State == ConnectionState.Closed) ocn.Open();
         var ocmd = odb.GetStoredProcCommand("PSCP_SPLS_SVMD_ALMA_KARD", obj.COD_ALMA, obj.FEC_OPER_INIC, obj.FEC_OPER_FINA, obj.COD_COMP);
         ocmd.CommandTimeout = 2000;
         var odr = odb.ExecuteReader(ocmd);
         Dispose(false);
         return (odr);
     }
     finally
     {
         ocn.Close();
     }
 }
Esempio n. 3
0
        private void Get_Search()
        {
            MessageBoxIcon msgIcon = MessageBoxIcon.Warning;
            try
            {
                var obj = new BEKardexInventory() { COD_COMP = SESSION_COMP };
                obj.COD_ALMA = (ccbCOD_ALMA.Properties.GetCheckedItems() == null) ? string.Empty : ccbCOD_ALMA.Properties.GetCheckedItems().ToString();
                if (!string.IsNullOrWhiteSpace(dteFEC_OPER_INIC.Text))
                {
                    obj.FEC_OPER_INIC = dteFEC_OPER_INIC.DateTime;
                    obj.FEC_OPER_FINA = dteFEC_OPER_FINA.DateTime;
                }

                var context = new ValidationContext(obj, null, null);
                var errors = new List<ValidationResult>();
                if (!Validator.TryValidateObject(obj, context, errors, true))
                {
                    foreach (ValidationResult result in errors)
                    {
                        msgIcon = MessageBoxIcon.Warning;
                        throw new ArgumentException(result.ErrorMessage);
                    }
                }

                var obr = new BRStockInventory();
                var olst = obr.Get_PSCP_SPLS_SVMD_ALMA_KARD(obj);
                gdcKardex.DataSource = olst;
                gdvKardex.BestFitColumns();
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message,
                                    WhMessage.MsgInsCaption,
                                    MessageBoxButtons.OK,
                                    msgIcon);
            }
        }