private void Get_Search() { MessageBoxIcon msgIcon = MessageBoxIcon.Warning; try { var obj = new BEStockValued() { COD_COMP = SESSION_COMP, COD_ALMA = (ccbCOD_ALMA.Properties.GetCheckedItems() == null) ? null : ccbCOD_ALMA.Properties.GetCheckedItems().ToString() }; if (string.IsNullOrWhiteSpace(obj.COD_ALMA)) obj.COD_ALMA = null; var obr = new BRStockInventory(); var olst = obr.Get_PSCP_SPLS_SVMD_ALMA_INVE_VALO(obj); gdcReport.DataSource = olst; gdvReport.BestFitColumns(); } catch (Exception ex) { XtraMessageBox.Show(ex.Message, WhMessage.MsgInsCaption, MessageBoxButtons.OK, msgIcon); } }
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); } }
private void Get_Refresh() { var obr = new BRStockInventory(); ostin = obr.Get_PSGN_SPLS_SVMD_ALMA_INVE(SESSION_COMP); var alma = ostin.Select(item => item.ALF_ALMA).Distinct().ToList(); alma.ForEach(item => { ostin.Where(obj => string.IsNullOrWhiteSpace(obj.ALF_ALMA)) .ToList() .ForEach(row => { row.ALF_ALMA = item; }); }); pgcStock.DataSource = ostin; pgcStock.BestFit(); }