private void LlenaLlave() { _llaveCfd = (llave_cfd)HttpContext.Current.Session["LlaveCFD"]; _comprobante = (Comprobante)HttpContext.Current.Session["comprobante"]; if (folio_fac.Text == "") { folio_fac.Text = "" + _llaveCfd.folio_factura; serie_fac.Text = "" + _llaveCfd.serie.Trim(); uuid.Text = "" + _llaveCfd.timbre_fiscal.uuid.Trim(); } }
private void CompruebaErrores(List <Errores> errores, llave_cfd llave, string emails) { if (errores.Count <= 0) { return; } lblErr.Text = ""; var msgUsr = from msg in errores where (msg.Interror == 1 && msg.Message != "") || (msg.Interror == 2 && msg.Message != "") select msg; var msgAdmin = from msg in errores where msg.Interror == 3 || msg.Interror == 2 select msg; var swMail = false; foreach (var err in msgUsr) { lblErr.Text = lblErr.Text + err.Message + Environment.NewLine; swMail = true; } if (swMail && msgAdmin.Count() != 0) { _factura.GenMailErrHtml(llave, "Error al recibir Factura Electrónica", msgAdmin.ToList(), emails, HttpContext.Current.Session["nomProveedor"].ToString()); } else { if (msgUsr.ToList().Any()) { _factura.GenMailErrHtml(llave, "Error al recibir Factura Electrónica", msgUsr.ToList(), emails, HttpContext.Current.Session["nomProveedor"].ToString()); } } var cadena = msgAdmin.Aggregate("", (current, err) => current + err.Message + Environment.NewLine); if (cadena == string.Empty) { return; } //_factura.GenMailErrHtml(llave, "Error al recibir Factura Electrónica", msgAdmin.ToList(), emails, HttpContext.Current.Session["nomProveedor"].ToString()); if (_factura.iErrorG > 0 & string.IsNullOrEmpty(lblErr.Text) & !string.IsNullOrEmpty(_factura.MensajeError)) { lblErr.Text = _factura.MensajeError; } }