public Dictionary <string, string> obtenerInformacionCatacion(string codCatacion) { Dictionary <string, string> catas = new Dictionary <string, string>(); CATACION catacion = consultarCatacion(codCatacion); PANEL panel = consultarPanel(catacion.CODPANEL); EVENTO evento = consultarEvento(panel.CODEVENTO); CAFE cafe = consultarCafe(catacion.CODCAFE); string atributosCafe = obtenerAtributosCafes(panel.TIPOCAFE.ToString()); string valoresDefectoCafe = obtenerValoresDefectoCafes(panel.TIPOCAFE.ToString()); if (catacion != null && panel != null && evento != null && cafe != null) { string hora = panel.HORA.ToString(); string fecha = evento.FECHA.ToShortDateString(); string tipoCafe = panel.TIPOCAFE; string CodCafe = cafe.CODCAFE; string cantVez = catacion.CANTIDAD.ToString(); catas.Add("hora", hora); catas.Add("fecha", fecha); catas.Add("tipoCafe", tipoCafe); catas.Add("CodCafe", CodCafe); catas.Add("cantVez", cantVez); catas.Add("atributos", atributosCafe); catas.Add("valoresDefecto", valoresDefectoCafe); } return(catas); }
private string generarCodigo(string encabezado) { string ultimo = "0"; switch (encabezado) { case "EV": try { EVENTO ev = this.db.EVENTO.ToList().Last(); string[] cod = ev.CODEVENTO.Split('-'); ultimo = (int.Parse(cod[1]) + 1).ToString(); } catch (Exception) { ultimo = "1"; } break; case "CT": try { CATACION ev = this.db.CATACION.ToList().Last(); string[] cod = ev.CODCATACION.Split('-'); ultimo = (int.Parse(cod[1]) + 1).ToString(); } catch (Exception) { ultimo = "1"; } break; case "PA": try { PANEL pa = this.db.PANEL.ToList().Last(); string[] cod = pa.CODPANEL.Split('-'); ultimo = (int.Parse(cod[1]) + 1).ToString(); } catch (Exception) { ultimo = "1"; } break; case "CF": try { CAFE ca = this.db.CAFE.ToList().Last(); string[] cod = ca.CODCAFE.Split('-'); ultimo = (int.Parse(cod[1]) + 1).ToString(); } catch (Exception) { ultimo = "1"; } break; case "CAT": int cantidad = this.db.CATACION.ToList().Count() + 1; ultimo = cantidad.ToString(); break; } return(encabezado + '-' + ultimo); }