public Nacao adicionarObjetivo(Nacao nacao) { Objetivo objetivo = new Objetivo(); objetivo.setRecurso(sortearRecurso()); objetivo.setMeta(2000); nacao.setObjetivo(objetivo); return nacao; }
/* ---Objetivos--- * 1: Mover para outro alvo * 2: Derrotar um inimigo * 3: Localizar Projeto Hoop * 4: Resgatar Projeto Hoop * 5: Escapar da base * 6: Derrotar todos os inimigos */ public void Start() { objetivos = new Objetivo[6]; objetivos[0] = new Objetivo("Mover unidade", "Selecione sua unidade e mova-a para um outro destino."); objetivos[1] = new Objetivo("Derrote um inimigo", "Mova sua unidade para um destino pertencente a um inimigo e derrote-o."); objetivos[2] = new Objetivo("Localizar Projeto Hoop", "Acesse o computador da primeira construçao e localize onde o Projeto Hoop esta escondido."); objetivos[3] = new Objetivo("Resgatar Projeto Hoop", "Acesse o computador que armazena o Projeto Hoop e resgate-o."); objetivos[4] = new Objetivo("Escape da instalaçao", "Escape da instaçao com pelo menos 1 membro da unidade vivo."); objetivos[5] = new Objetivo("Derrote todos os inimigos!", "Derrote todas as unidades inimigas na instalaçao!", false); }
private void FrmAltTreino_Activated(object sender, EventArgs e) { #region Carrega os Alunos try { Alunos aluno = new Alunos(); ArrayList array = aluno.selectArray("order by nome"); comboAluno.DataSource = array; comboAluno.DisplayMember = "nome"; comboAluno.ValueMember = "id"; } catch { } #endregion #region Carrega os Treinadores try { Treinadores treinador = new Treinadores(); ArrayList array = treinador.selectArray("order by nome"); comboTreinador.DataSource = array; comboTreinador.DisplayMember = "nome"; comboTreinador.ValueMember = "id"; } catch { } #endregion #region Carrega os Objetivos try { Objetivo objetivo = new Objetivo(); ArrayList array = objetivo.selectArray("order by nome"); comboObjetivo.DataSource = array; comboObjetivo.DisplayMember = "nome"; comboObjetivo.ValueMember = "id"; } catch { } #endregion #region Carrega os Grupos Musculares try { GrupoMuscular grupo = new GrupoMuscular(); ArrayList array = grupo.selectArray("order by nome"); comboGrupoMuscular.DataSource = array; comboGrupoMuscular.DisplayMember = "nome"; comboGrupoMuscular.ValueMember = "id"; } catch { } #endregion comboAluno.SelectedValue = idAluno; comboTreinador.SelectedValue = idTreinador; comboObjetivo.SelectedValue = idObjetivo; }
internal bool ModificarDelete(Curso oCursoSelected, Objetivo oObjetivo) { return(oCursoDao.ModificarEliminado(oCursoSelected, oObjetivo)); }
private void cargarCampos(Objetivo o) { txtNombreLargo.Text = o.Nombre_largo; txtIdObjetivo.Text = o.Id_objetivo.ToString(); txtNombreAbrev.Text = o.Nombre_corto; }
public void Post([FromForm] Guid id, Objetivo objetivo) { _objetivoRepository.Adicionar(objetivo); }
public ActionResult Inactivate(int objetivoId, int companyId, int applicationUserId) { return(Objetivo.Inactivate(objetivoId, companyId, applicationUserId)); }
public ActionResult Anulate(int objetivoId, int companyId, int applicationUserId, string reason, DateTime date, int responsible) { return(Objetivo.Anulate(objetivoId, companyId, applicationUserId, reason, date, responsible)); }
public static ActionResult PDF( int companyId, DateTime?from, DateTime?to, int status, string listOrder, string filterText) { var res = ActionResult.NoAction; var user = HttpContext.Current.Session["User"] as ApplicationUser; dictionary = HttpContext.Current.Session["Dictionary"] as Dictionary <string, string>; var company = new Company(companyId); string path = HttpContext.Current.Request.PhysicalApplicationPath; if (!path.EndsWith(@"\", StringComparison.OrdinalIgnoreCase)) { path = string.Format(CultureInfo.InvariantCulture, @"{0}\", path); } var formatedDescription = ToolsPdf.NormalizeFileName(company.Name); string fileName = string.Format( CultureInfo.InvariantCulture, @"{0}_{1}_{2:yyyyMMddhhmmss}.pdf", dictionary["Item_Objetivo_List"], formatedDescription, DateTime.Now); // FONTS string pathFonts = HttpContext.Current.Request.PhysicalApplicationPath; if (!path.EndsWith(@"\", StringComparison.OrdinalIgnoreCase)) { pathFonts = string.Format(CultureInfo.InstalledUICulture, @"{0}\", pathFonts); } var headerFont = BaseFont.CreateFont(string.Format(CultureInfo.InvariantCulture, @"{0}fonts\ARIAL.TTF", pathFonts), BaseFont.IDENTITY_H, BaseFont.EMBEDDED); var arial = BaseFont.CreateFont(string.Format(CultureInfo.InvariantCulture, @"{0}fonts\ARIAL.TTF", pathFonts), BaseFont.IDENTITY_H, BaseFont.EMBEDDED); var pdfDoc = new iTS.Document(iTS.PageSize.A4.Rotate(), 40, 40, 80, 50); var writer = iTextSharp.text.pdf.PdfWriter.GetInstance(pdfDoc, new FileStream( string.Format(CultureInfo.InvariantCulture, @"{0}Temp\{1}", path, fileName), FileMode.Create)); writer.PageEvent = new TwoColumnHeaderFooter() { CompanyLogo = string.Format(CultureInfo.InvariantCulture, @"{0}\images\logos\{1}.jpg", path, company.Id), IssusLogo = string.Format(CultureInfo.InvariantCulture, "{0}issus.png", path), Date = string.Format(CultureInfo.InvariantCulture, "{0:dd/MM/yyyy}", DateTime.Now), CreatedBy = user.UserName, CompanyId = company.Id, CompanyName = company.Name, Title = dictionary["Item_Objetivo_List"].ToUpperInvariant() }; pdfDoc.Open(); var rowEven = new iTS.BaseColor(240, 240, 240); var titleTable = new iTSpdf.PdfPTable(1); titleTable.SetWidths(new float[] { 50f }); titleTable.AddCell(new iTSpdf.PdfPCell(new iTS.Phrase(string.Format(CultureInfo.InvariantCulture, "{0} - {1}", dictionary["Item_EquipmentList"], company.Name), ToolsPdf.LayoutFonts.TitleFont)) { HorizontalAlignment = iTS.Element.ALIGN_CENTER, Border = iTS.Rectangle.NO_BORDER }); #region Criteria var criteriatable = new iTSpdf.PdfPTable(4) { WidthPercentage = 100 }; criteriatable.SetWidths(new float[] { 20f, 50f, 20f, 150f }); #region texts string periode = string.Empty; if (from.HasValue && to == null) { periode = string.Format(CultureInfo.InvariantCulture, @"{0} {1:dd/MM/yyyy}", dictionary["Item_IncidentAction_List_Filter_From"], from); } else if (from == null && to.HasValue) { periode = string.Format(CultureInfo.InvariantCulture, @"{0} {1:dd/MM/yyyy}", dictionary["Item_IncidentAction_List_Filter_To"], to); } else if (from.HasValue && to.HasValue) { periode = string.Format(CultureInfo.InvariantCulture, @"{0:dd/MM/yyyy} {1:dd/MM/yyyy}", from, to); } else { periode = dictionary["Common_All_Male"]; } string statusText = dictionary["Common_All"]; if (status == 1) { statusText = dictionary["Item_ObjetivoAction_List_Filter_ShowActive"]; } if (status == 2) { statusText = dictionary["Item_ObjetivoAction_List_Filter_ShowClosed"]; } #endregion ToolsPdf.AddCriteria(criteriatable, dictionary["Common_Period"], periode); ToolsPdf.AddCriteria(criteriatable, dictionary["Item_IncidentAction_Header_Status"], statusText); if (!string.IsNullOrEmpty(filterText)) { ToolsPdf.AddCriteria(criteriatable, dictionary["Common_PDF_Filter_Contains"], filterText); } pdfDoc.Add(criteriatable); #endregion var table = new iTSpdf.PdfPTable(5) { WidthPercentage = 100, HorizontalAlignment = 1, SpacingBefore = 20f, SpacingAfter = 30f }; table.SetWidths(new float[] { 7f, 50f, 30f, 12f, 12f }); table.AddCell(ToolsPdf.HeaderCell(dictionary["Common_Status"])); table.AddCell(ToolsPdf.HeaderCell(dictionary["Item_Objetivo_Header_Name"])); table.AddCell(ToolsPdf.HeaderCell(dictionary["Item_Objetivo_Header_Responsible"])); table.AddCell(ToolsPdf.HeaderCell(dictionary["Item_Objetivo_Header_StartDate"])); table.AddCell(ToolsPdf.HeaderCell(dictionary["Item_Objetivo_Header_PreviewEndDate"])); int cont = 0; var data = Objetivo.Filter(companyId, from, to, status).ToList(); foreach (var item in data) { if (!item.Objetivo.EndDate.HasValue) { item.Objetivo.EndDate = item.Objetivo.PreviewEndDate; } } switch (listOrder.ToUpperInvariant()) { default: case "TH0|ASC": data = data.OrderBy(d => d.Objetivo.Name).ToList(); break; case "TH0|DESC": data = data.OrderByDescending(d => d.Objetivo.Name).ToList(); break; case "TH1|ASC": data = data.OrderBy(d => d.Objetivo.Responsible.FullName).ToList(); break; case "TH1|DESC": data = data.OrderByDescending(d => d.Objetivo.Responsible.FullName).ToList(); break; case "TH2|ASC": data = data.OrderBy(d => d.Objetivo.StartDate).ToList(); break; case "TH2|DESC": data = data.OrderByDescending(d => d.Objetivo.StartDate).ToList(); break; case "TH3|ASC": data = data.OrderBy(d => d.Objetivo.EndDate).ToList(); break; case "TH3|DESC": data = data.OrderByDescending(d => d.Objetivo.EndDate).ToList(); break; } cont = 0; foreach (var item in data) { if (!string.IsNullOrEmpty(filterText)) { var show = false; if (item.Objetivo.Name.IndexOf(filterText, StringComparison.OrdinalIgnoreCase) != -1) { show = true; } if (item.Objetivo.Responsible.FullName.IndexOf(filterText, StringComparison.OrdinalIgnoreCase) != -1) { show = true; } if (!show) { continue; } } string endDateText = string.Format(CultureInfo.InvariantCulture, "{0:dd/MM/yyyy}", item.Objetivo.PreviewEndDate); if (item.Objetivo.EndDate.HasValue) { endDateText = string.Format(CultureInfo.InvariantCulture, "{0:dd/MM/yyyy}", item.Objetivo.EndDate); } table.AddCell(ToolsPdf.DataCell(item.Objetivo.Active ? dictionary["Common_Active"] : dictionary["Common_Inactve"], ToolsPdf.LayoutFonts.Times)); table.AddCell(ToolsPdf.DataCell(item.Objetivo.Name, ToolsPdf.LayoutFonts.Times)); table.AddCell(ToolsPdf.DataCell(item.Objetivo.Responsible.FullName, ToolsPdf.LayoutFonts.Times)); table.AddCell(ToolsPdf.DataCellCenter(string.Format(CultureInfo.InvariantCulture, "{0:dd/MM/yyyy}", item.Objetivo.StartDate), ToolsPdf.LayoutFonts.Times)); table.AddCell(ToolsPdf.DataCellCenter(endDateText, ToolsPdf.LayoutFonts.Times)); cont++; } string totalRegistros = string.Format( CultureInfo.InvariantCulture, @"{0}: {1}", dictionary["Common_RegisterCount"], cont); table.AddCell(new iTSpdf.PdfPCell(new iTS.Phrase(totalRegistros, ToolsPdf.LayoutFonts.Times)) { Border = iTS.Rectangle.TOP_BORDER, BackgroundColor = rowEven, Padding = 6f, PaddingTop = 4f, Colspan = 2 }); table.AddCell(new iTSpdf.PdfPCell(new iTS.Phrase(string.Empty, ToolsPdf.LayoutFonts.Times)) { Border = iTS.Rectangle.TOP_BORDER, BackgroundColor = rowEven, Colspan = 3 }); pdfDoc.Add(table); pdfDoc.CloseDocument(); res.SetSuccess(string.Format(CultureInfo.InvariantCulture, @"{0}Temp/{1}", ConfigurationManager.AppSettings["siteUrl"], fileName)); return(res); }
private void FrmTabObjetivos_Activated(object sender, EventArgs e) { Objetivo objetivos = new Objetivo(); dataGridViewObjetivos.DataSource = objetivos.select(); }
private void textPesquisa_TextChanged(object sender, EventArgs e) { Objetivo obj = new Objetivo(); dataGridViewObjetivos.DataSource = obj.select("where nome like '%" + textPesquisa.Text + "%'"); }
public override Result GetC3D(Ent e, bool funcion, bool ciclo, bool isDeclaracion, bool isObjeto, LinkedList <Error> errores) { if (!isDeclaracion) { Debugger(e, "For"); } Result result = new Result(); if (!isDeclaracion) { if (Objetivo.Count() > 0) { Expresion objetivo = Objetivo.ElementAt(0); /*Solo funciona con uno*/ Result rsObjetivo = null; Identificador idObjetivo = null; Referencia refObjetivo = null; AccesoLista listObjetivo = null; if (objetivo is Identificador) { idObjetivo = (Identificador)objetivo; idObjetivo.Acceso = false; idObjetivo.IsDeclaracion = isDeclaracion; rsObjetivo = idObjetivo.GetC3D(e, funcion, ciclo, isObjeto, errores); } if (objetivo is Referencia) { refObjetivo = (Referencia)objetivo; refObjetivo.Acceso = false; refObjetivo.ObtenerValor = true; rsObjetivo = refObjetivo.GetC3D(e, funcion, ciclo, isObjeto, errores); } if (objetivo is AccesoLista) { listObjetivo = (AccesoLista)objetivo; listObjetivo.Acceso = false; rsObjetivo = listObjetivo.GetC3D(e, funcion, ciclo, isObjeto, errores); } if (rsObjetivo != null) { if (rsObjetivo.Valor != null) { result.Codigo = rsObjetivo.Codigo; Result rsValor = Valor.GetC3D(e, funcion, ciclo, isObjeto, errores); if (rsValor != null) { if (Valor.GetTipo().IsList()) { if (rsValor != null) { result.Codigo += rsValor.Codigo; string ptr = NuevoTemporal(); result.Codigo += ptr + " = " + rsValor.Valor + ";\n"; result.EtiquetaF = NuevaEtiqueta(); result.EtiquetaV = NuevaEtiqueta(); string etqCiclo = NuevaEtiqueta(); string etqSalida = ""; if (BloqueElse != null) { etqSalida = NuevaEtiqueta(); } result.Codigo += etqCiclo + ":\n"; result.Codigo += "ifFalse (" + ptr + " >= 0 ) goto " + result.EtiquetaF + ";\n"; result.Codigo += "goto " + result.EtiquetaV + ";\n"; result.Codigo += result.EtiquetaV + ":\n"; result.Codigo += rsObjetivo.Valor + " = heap[" + ptr + "];\n"; result.Codigo += ptr + " = " + ptr + " + 1;\n"; result.Codigo += ptr + " = heap[" + ptr + "];\n"; Ent local = new Ent(e.Ambito + "_for", e); local.EtiquetaCiclo = etqCiclo; if (BloqueElse != null) { local.EtiquetaSalidaCiclo = etqSalida; } else { local.EtiquetaSalidaCiclo = result.EtiquetaF; } result.Codigo += Bloque.GetC3D(local, funcion, true, isDeclaracion, isObjeto, errores).Codigo; //arreglar result.Codigo += "goto " + etqCiclo + ";\n"; result.Codigo += result.EtiquetaF + ":\n"; if (BloqueElse != null) { Ent local2 = new Ent(e.Ambito + "_for", e); result.Codigo += BloqueElse.GetC3D(local2, funcion, ciclo, isDeclaracion, isObjeto, errores).Codigo; result.Codigo += etqSalida + ":\n"; } } else { errores.AddLast(new Error("Semántico", "Error obteniendo el valor a iterar.", Linea, Columna)); } }/*buscar otras*/ } else { errores.AddLast(new Error("Semántico", "Error obteniendo el valor a iterar.", Linea, Columna)); } } else { errores.AddLast(new Error("Semántico", "Error obteniendo el target.", Linea, Columna)); } } else { errores.AddLast(new Error("Semántico", "Error obteniendo el target.", Linea, Columna)); } } } else { if (BloqueElse == null) { Ent local = new Ent(e.Ambito + "_for", e); local.Pos = e.Pos; result.Codigo += Bloque.GetC3D(local, funcion, ciclo, isDeclaracion, isObjeto, errores).Codigo; e.Pos = local.Pos; } else { Ent local = new Ent(e.Ambito + "_for", e); local.Pos = e.Pos; result.Codigo += Bloque.GetC3D(local, funcion, ciclo, isDeclaracion, isObjeto, errores).Codigo; e.Pos = local.Pos; Ent local2 = new Ent(e.Ambito + "_else", e); local2.Pos = e.Pos; result.Codigo += BloqueElse.GetC3D(local2, funcion, ciclo, isDeclaracion, isObjeto, errores).Codigo; e.Pos = local.Pos; } } return(result); }
IEnumerator Rutina(float delay) { EnUso = true; if (Objetivo != null) { if (!PrimeraVuelta) { // Evaluar movimientos EvaluaMovimiento(); // Obtener los posibles movimientos PosiblesMovimientos = SeleccionaMovimiento(Companeros); // Medir la distancia en todos los posibles movimientos // Obtener las coordenadas de los posibles movimientos MapGenerator.Coordenada[] coordenadas = Mapa.PuedeMoverseA(Posicion, PosiblesMovimientos); // Elegir el más cercano (greedy) float mejor = Mapa.mapSize.x * 2 + 1f; Vector3 mejorCoordenada = new Vector3(this.Posicion.x, this.transform.position.y, this.Posicion.y); int j = -1; for (int i = 0; i < 4; i++) { try { if (PosiblesMovimientos[i] && !Utility.IsInList(coordenadas[i], Cerrados)) { Vector3 c = new Vector3(coordenadas[i].x, this.transform.position.y, coordenadas[i].y); float val = Utility.ManhattanDistance(c, Objetivo.Posicion); if (val < mejor) { mejor = val; j = i; mejorCoordenada = c; Debug.Log(System.String.Format("Nuevo mejor valor: {0}", val)); } if (Mathf.Abs(val) <= 1f) { //Alcanzado = true; // Objetivo.Alcanzado = true; Objetivo.setAlcanzadoPor(1); // Alcanzado = Objetivo.AlcanzadoPor >= 2 ? true : false; break; } else { Objetivo.setAlcanzadoPor(-1); } } } catch (Exception) { } } // Moverse al seleccinado // Bloquear posición anterior Anterior = Posicion; Cerrados.Add(new MapGenerator.Coordenada((int)Posicion.x, (int)Posicion.y)); MoverA(j); if (Cerrados.Count >= BloqueoDePosiciones) { Cerrados.RemoveAt(0); } // Repetir } else if (Alcanzado) { Debug.Log("Alcanzado: " + Alcanzado); } else { PrimeraVuelta = false; Cerrados = new List <MapGenerator.Coordenada>(); delay = 0f; } yield return(new WaitForSeconds(delay)); } EnUso = false; }
public bool Actualizar(Objetivo objetivo) { var dato = repositorio.Actualizar(objetivo); return(dato); }
public void setObjetivo(Objetivo objetivo) { this.objetivo = objetivo; }
public List <Evaluacion> ObtenerEvaluacionesDeUnObjetivo(Objetivo objetivo) { return(null); }
public void load() { saveAtual = GameObject.FindObjectOfType<SaveAtual>(); if (File.Exists(Application.persistentDataPath + "/" + saveAtual.getSaveAtualId() + nascaoNome + "NascaoData.dat")) { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Open(Application.persistentDataPath + "/" + saveAtual.getSaveAtualId() + nascaoNome + "NascaoData.dat", FileMode.Open); NascaoData nascaoData = (NascaoData)bf.Deserialize(file); file.Close(); nacaoComercioGerente = new NacaoComercioGerente(); producao = new Producao(); consumo = new Consumo(); objetivo = new Objetivo(); armazem = new NacaoArmazem(); recursoEnum = new RecursoEnum(); this.setNascaoName(nascaoData.nascaoNome); this.setCouroPreco(nascaoData.couroPreco); this.setPlantaPreco(nascaoData.plantaPreco); this.setMelecaPreco(nascaoData.melecaPreco); this.posicao = nascaoData.posicao; setNacaoNoObjetivos(); producao.load(); consumo.load(); objetivo.load(); armazem.load(); } }
/// <summary>Begin page running after session validations</summary> private void Go() { if (this.Request.QueryString["id"] != null) { this.IncidentActionId = Convert.ToInt64(this.Request.QueryString["id"]); } if (this.Request.QueryString["New"] != null) { this.returnScript = "document.location = 'ActionsList.aspx';"; } else { this.returnScript = "document.location = referrer;"; } this.ApplicationUser = Session["User"] as ApplicationUser; this.Company = Session["company"] as Company; this.Dictionary = Session["Dictionary"] as Dictionary <string, string>; this.master = this.Master as Giso; this.master.AdminPage = true; string serverPath = this.Request.Url.AbsoluteUri.Replace(this.Request.RawUrl.Substring(1), string.Empty); if (this.ApplicationUser.HasGrantToRead(ApplicationGrant.IncidentActions)) { this.master.AddBreadCrumb("Item_IncidentActions", "ActionList.aspx", Constant.NotLeaft); } else { this.master.AddBreadCrumb("Item_IncidentActions"); } this.master.AddBreadCrumb("Item_IncidentActions_Detail"); this.grantToWrite = this.ApplicationUser.HasGrantToWrite(ApplicationGrant.IncidentActions); this.Incident = Incident.Empty; if (this.IncidentActionId > 0) { this.IncidentAction = IncidentAction.ById(this.IncidentActionId, this.Company.Id); if (this.IncidentAction.CompanyId != this.Company.Id) { this.Response.Redirect("NoAccesible.aspx", Constant.EndResponse); Context.ApplicationInstance.CompleteRequest(); this.IncidentAction = IncidentAction.Empty; } this.master.TitleInvariant = true; this.master.Titulo = string.Format(CultureInfo.InvariantCulture, "{0}: <strong>{2} - {1}</strong>", this.Dictionary["Item_IncidentAction"], this.IncidentAction.Description, this.IncidentAction.Number.ToString()); this.formFooter = new FormFooter { ModifiedBy = this.IncidentAction.ModifiedBy.Description, ModifiedOn = this.IncidentAction.ModifiedOn }; this.formFooter.AddButton(new UIButton { Id = "BtnRestaurar", Icon = "icon-undo", Text = this.Dictionary["Item_IncidentAction_Btn_Restaurar"], Action = "primary" }); this.formFooter.AddButton(new UIButton { Id = "BtnAnular", Icon = "icon-ban-circle", Text = this.Dictionary["Item_IncidentAction_Btn_Anular"], Action = "danger" }); this.formFooter.AddButton(new UIButton { Id = "BtnPrint", Icon = "icon-file-pdf", Text = this.Dictionary["Common_PrintPdf"], Action = "success", ColumnsSpan = 12 }); this.formFooter.AddButton(new UIButton { Id = "BtnSave", Icon = "icon-ok", Text = this.Dictionary["Common_Accept"], Action = "success", ColumnsSpan = 12 }); this.formFooter.AddButton(new UIButton { Id = "BtnCancel", Icon = "icon-undo", Text = this.Dictionary["Common_Cancel"], ColumnsSpan = 12 }); this.master.ItemCode = this.IncidentAction.Description; this.OriginItemLink = this.Dictionary["Item_IncidentAction_Origin2"]; if (this.IncidentAction.IncidentId.HasValue && this.IncidentAction.IncidentId > 0) { this.Incident = Incident.GetById(this.IncidentAction.IncidentId.Value, this.Company.Id); this.OriginItemLink = this.Dictionary["Item_IncidentAction_Origin3"] + " " + this.Incident.Link; } if (this.IncidentAction.BusinessRiskId.HasValue && this.IncidentAction.BusinessRiskId > 0) { this.BusinessRisk = BusinessRisk.ById(this.Company.Id, this.IncidentAction.BusinessRiskId.Value); this.OriginItemLink = this.Dictionary["Item_IncidentAction_Origin4"] + " " + this.BusinessRisk.Link; } if (this.IncidentAction.Objetivo.Id > 0) { this.Objetivo = this.IncidentAction.Objetivo; this.OriginItemLink = this.Dictionary["Item_IncidentAction_Origin5"] + " " + this.Objetivo.Link; } if (this.IncidentAction.Oportunity.Id > 0) { this.Oportunity = this.IncidentAction.Oportunity; this.OriginItemLink = this.Dictionary["Item_IncidentAction_Origin6"] + " " + this.Oportunity.Link; } if (this.IncidentAction.Origin == 1) { if (this.IncidentAction.AuditoryId != null && this.IncidentAction.AuditoryId > 0) { var auditory = Auditory.ById(this.IncidentAction.AuditoryId.Value, this.Company.Id); this.OriginItemLink = string.Format( CultureInfo.InvariantCulture, @"{0} - {1}", this.Dictionary["Item_IncidentAction_Origin1"], auditory.Link); } else { this.OriginItemLink = this.Dictionary["Item_IncidentAction_Origin1"]; } } this.RenderDocuments(); } else { this.master.Titulo = "Item_IncidentActions_Detail"; this.IncidentAction = IncidentAction.Empty; this.formFooter = new FormFooter(this.Dictionary, this.grantToWrite); if (this.Request.QueryString["o"] != null) { var objetivoId = Convert.ToInt32(this.Request.QueryString["o"]); this.Objetivo = Objetivo.ById(objetivoId, this.Company.Id); this.IncidentAction.Description = this.Objetivo.Name; this.IncidentAction.Origin = 5; this.IncidentAction.Objetivo = this.Objetivo; this.IncidentAction.WhatHappened = this.Objetivo.Description; this.IncidentAction.WhatHappenedOn = DateTime.Now; } this.OriginItemLink = this.Dictionary["Item_IncidentAction_Origin2"]; if (this.IncidentAction.Origin == 1) { this.OriginItemLink = this.Dictionary["Item_IncidentAction_Origin1"]; } else if (this.IncidentAction.Origin == 5) { this.OriginItemLink = string.Format( CultureInfo.InvariantCulture, "{0}: {1}", this.Dictionary["Item_IncidentAction_Origin5"], this.Objetivo.Link); } } this.tabBar.AddTab(new Tab { Id = "home", Selected = true, Active = true, Label = this.Dictionary["Item_IncidentAction_Tab_Basic"], Available = true }); this.tabBar.AddTab(new Tab { Id = "costes", Available = this.ApplicationUser.HasGrantToRead(ApplicationGrant.Cost) && this.IncidentActionId > 0, Active = this.IncidentActionId > 0, Label = this.Dictionary["Item_IncidentAction_Tab_Costs"] }); this.tabBar.AddTab(new Tab { Id = "uploadFiles", Available = true, Active = this.IncidentActionId > 0, Hidden = this.IncidentActionId < 1, Label = this.Dictionary["Item_IncidentAction_Tab_UploadFiles"] }); // this.tabBar.AddTab(new Tab { Id = "trazas", Available = this.user.HasTraceGrant() && this.IncidentActionId > 0, Active = this.IncidentActionId > 0, Label = this.dictionary["Item_IncidentAction_Tab_Traces"] }); this.RenderForm(); this.ProviderBarPopups = new BarPopup { Id = "Provider", DeleteMessage = this.Dictionary["Common_DeleteMessage"], BarWidth = 600, UpdateWidth = 600, DeleteWidth = 600, Required = true, RequiredMessage = this.Dictionary["Common_Required"], Duplicated = true, DuplicatedMessage = this.Dictionary["Common_Error_NameAlreadyExists"], Description = "Proveedor", FieldName = this.Dictionary["Item_Provider"], BarTitle = this.Dictionary["Item_Providers"] }; this.CustomerBarPopups = new BarPopup { Id = "Customer", DeleteMessage = this.Dictionary["Common_DeleteMessage"], BarWidth = 600, UpdateWidth = 600, DeleteWidth = 600, Required = true, RequiredMessage = this.Dictionary["Common_Required"], Duplicated = true, DuplicatedMessage = this.Dictionary["Common_Error_NameAlreadyExists"], Description = "Cliente", FieldName = this.Dictionary["Item_Customer"], BarTitle = this.Dictionary["Item_Customers"] }; }
public ActionResult Save(Objetivo objetivo, int applicationUserId) { return(objetivo.Save(applicationUserId)); }
public void Adicionar(Objetivo objetivo) { throw new NotImplementedException(); }
public ActionResult Restore(int objetivoId, int companyId, int applicationUserId) { return(Objetivo.Restore(objetivoId, companyId, applicationUserId)); }
public void Alterar(int id, Objetivo objetivo) { throw new NotImplementedException(); }
public void Post(Objetivo objetivo) { _objetivoRepository.Adicionar(objetivo); }
public IActionResult GetImage(Guid id) { Objetivo objetivo = _objetivoRepository.BuscarPorId(id); return(Ok(new Uri($"{Request.Scheme}://{Request.Host}{Request.PathBase}/{objetivo.UrlImagem}"))); }
public void Put(Guid id, Objetivo objetivo) { objetivo.IdObjetivo = id; _objetivoRepository.Editar(objetivo); }
public int agregarObjetivo(Objetivo objetivo) { return(conn.Insert(objetivo)); }
private void Go() { if (this.Request.QueryString["id"] != null) { this.objetivoId = Convert.ToInt32(this.Request.QueryString["id"]); } if (this.Request.QueryString["New"] != null) { this.ReturnScript = "document.location = 'ObjetivoList.aspx';"; } else { this.ReturnScript = "document.location = referrer;"; } this.ApplicationUser = (ApplicationUser)Session["User"]; this.Company = (Company)Session["company"]; this.Dictionary = Session["Dictionary"] as Dictionary <string, string>; this.master = this.Master as Giso; this.master.AdminPage = true; string serverPath = this.Request.Url.AbsoluteUri.Replace(this.Request.RawUrl.Substring(1), string.Empty); this.master.AddBreadCrumb("Item_Objetivos", "ObjetivoList.aspx", Constant.NotLeaft); this.master.AddBreadCrumb("Item_Objetivo_Detail"); this.master.Titulo = "Item_Objetivo_Detail"; this.formFooter = new FormFooter(); this.ActionsOpen = 0; if (this.objetivoId > 0) { this.Session["EquipmentId"] = this.objetivoId; this.Objetivo = Objetivo.ById(this.objetivoId, this.Company.Id); if (this.Objetivo.CompanyId != this.Company.Id) { this.Response.Redirect("NoAccesible.aspx", Constant.NotLeaft); Context.ApplicationInstance.CompleteRequest(); this.Objetivo = Objetivo.Empty; } this.master.TitleInvariant = true; this.master.Titulo = string.Format(CultureInfo.InvariantCulture, "{0}: <strong>{1}</strong>", this.Dictionary["Item_Objetivo_Header_Name"], this.Objetivo.Name); this.formFooter.ModifiedBy = this.Objetivo.ModifiedBy.Description; this.formFooter.ModifiedOn = this.Objetivo.ModifiedOn; this.formFooter.AddButton(new UIButton { Id = "BtnPrint", Icon = "icon-file-pdf", Text = this.Dictionary["Common_PrintPdf"], Action = "success" }); this.formFooter.AddButton(new UIButton { Id = "BtnRestaurar", Icon = "icon-undo", Text = this.Dictionary["Item_Objetivo_Btn_Restaurar"], Action = "primary" }); this.formFooter.AddButton(new UIButton { Id = "BtnAnular", Icon = "icon-ban-circle", Text = this.Dictionary["Item_Objetivo_Btn_Anular"], Action = "danger" }); this.formFooter.AddButton(new UIButton { Id = "BtnSave", Icon = "icon-ok", Text = this.Dictionary["Common_Save"], Action = "success" }); } else { //this.master.AddBreadCrumb("Item_Objetivo"); this.master.Titulo = "Item_Objetivo_Detail"; this.Objetivo = Objetivo.Empty; this.formFooter.ModifiedBy = this.Dictionary["Common_New"]; this.formFooter.ModifiedOn = DateTime.Now; this.formFooter.AddButton(new UIButton { Id = "BtnSave", Icon = "icon-ok", Text = this.Dictionary["Common_Accept"], Action = "success" }); } this.formFooter.AddButton(new UIButton { Id = "BtnCancel", Icon = "icon-undo", Text = this.Dictionary["Common_Cancel"] }); this.tabBar.AddTab(new Tab { Id = "home", Selected = true, Active = true, Label = this.Dictionary["Item_Objetivo_TabBasic"], Available = true }); this.tabBar.AddTab(new Tab { Id = "actions", Available = this.objetivoId > 0 && this.ApplicationUser.HasGrantToRead(ApplicationGrant.IncidentActions), Active = this.objetivoId > 0, Hidden = this.objetivoId < 1, Label = this.Dictionary["Item_Objetivo_TabActions"] }); this.tabBar.AddTab(new Tab { Id = "records", Available = this.objetivoId > 0, Active = this.objetivoId > 0, Hidden = this.objetivoId < 1, Label = this.Dictionary["Item_Objetivo_Tab_Records"] }); this.tabBar.AddTab(new Tab { Id = "graphics", Available = this.objetivoId > 0, Active = this.objetivoId > 0, Hidden = this.objetivoId < 1, Label = this.Dictionary["Item_Objetivo_TabGraphics"] }); this.tabBar.AddTab(new Tab { Id = "historic", Available = this.objetivoId > 0 && this.ApplicationUser.HasGrantToRead(ApplicationGrant.IncidentActions), Active = this.objetivoId > 0, Hidden = this.objetivoId < 1, Label = this.Dictionary["Item_Objetivo_TabHistoric"] }); this.RenderForm(); }
public int editarObjetivo(Objetivo objetivo) { return(conn.Update(objetivo)); }
internal bool Existe(Curso oCurso, Objetivo oLista) { return(oCursoDao.ExisteObjetivoBorrado(oCurso, oLista)); }
protected override bool ValidarDependencias(object pObjetivo) { Objetivo objetivo = (Objetivo)pObjetivo; return(objetivo.ListaItemTrilha.Count > 0); }
public override Result GetC3D(Ent e, bool funcion, bool ciclo, bool isDeclaracion, bool isObjeto, LinkedList <Error> errores) { if (!isDeclaracion) { Debugger(e, "Asignacion"); } Result result = new Result(); foreach (LinkedList <Expresion> valList in Valor) { if (Objetivo.Count() != valList.Count()) { if (isDeclaracion) { errores.AddLast(new Error("Semántico", "La lista de ids debe ser simétrica", Linea, Columna)); } return(null); } } for (int i = 0; i < Objetivo.Count(); i++) { Expresion obj = Objetivo.ElementAt(i); if (obj is Identificador || obj is Referencia || obj is AccesoLista) //verifico que sea id o referencia a atributo { Identificador idObjetivo = null; Referencia refObjetivo = null; AccesoLista listObjetivo = null; Result rsObj = null; if (obj is Identificador) { idObjetivo = (Identificador)obj; idObjetivo.Acceso = false; idObjetivo.IsDeclaracion = isDeclaracion; if (!Tipo.IsIndefinido()) { idObjetivo.GetLocal = true; } rsObj = idObjetivo.GetC3D(e, funcion, ciclo, isObjeto, errores); } if (obj is Referencia) { refObjetivo = (Referencia)obj; refObjetivo.Acceso = false; refObjetivo.ObtenerValor = true; if (!isDeclaracion) { rsObj = refObjetivo.GetC3D(e, funcion, ciclo, isObjeto, errores); } else { rsObj = null; } } if (obj is AccesoLista) { listObjetivo = (AccesoLista)obj; listObjetivo.Acceso = false; //listObjetivo.IsDeclaracion = isDeclaracion; if (!isDeclaracion) { rsObj = listObjetivo.GetC3D(e, funcion, ciclo, isObjeto, errores); } else { rsObj = null; } } if (rsObj == null && obj is Identificador) //si no existe, creo la variable si viene con tipo { if (!Tipo.IsIndefinido()) { idObjetivo.Tipo = Tipo; rsObj = new Result(); Sim s = new Sim(((Identificador)obj).Id, Tipo, Rol.LOCAL, 1, e.GetPos(), e.Ambito, -1, -1); rsObj.Simbolo = s; if (isObjeto) { s.IsAtributo = true; } e.Add(s); if (!isDeclaracion) { idObjetivo.PtrVariable = s.Pos + ""; string ptrStack = NuevoTemporal(); if (!isObjeto) { rsObj.Codigo = ptrStack + " = P + " + s.Pos + ";\n"; rsObj.Valor = "stack[" + ptrStack + "]"; } else { string ptrHeap = NuevoTemporal(); string valorHeap = NuevoTemporal(); rsObj.Codigo = ptrStack + " = P + " + 1 + ";\n"; rsObj.Codigo += valorHeap + " = stack[" + ptrStack + "];\n"; rsObj.Codigo += ptrHeap + " = " + valorHeap + " + " + s.Pos + ";\n"; rsObj.Valor = "heap[" + ptrHeap + "]"; } } } else { if (!isDeclaracion) { errores.AddLast(new Error("Semántico", "No se pudo encontrar la variable: " + idObjetivo.Id + ".", Linea, Columna)); } return(null); } } else { if (!Tipo.IsIndefinido() && obj is Identificador) { if (!isDeclaracion) { errores.AddLast(new Error("Semántico", "Ya se declaró una variable con el id: " + idObjetivo.Id + ".", Linea, Columna)); } return(null); } } LinkedList <Result> rsList = new LinkedList <Result>(); for (int j = 0; j < Valor.Count(); j++) { LinkedList <Expresion> valList = Valor.ElementAt(j); Expresion expI = valList.ElementAt(i); if (j + 1 == Valor.Count()) { if (!isDeclaracion) { if (expI is Llamada) { ((Llamada)expI).PtrVariable = idObjetivo.PtrVariable; } Result rsTemp = expI.GetC3D(e, funcion, ciclo, isObjeto, errores); if (rsTemp != null) { if (obj is Identificador) { if (expI.GetTipo().Tip != idObjetivo.Tipo.Tip) { errores.AddLast(new Error("Semántico", "El valor a asignar no es del mismo tipo.", Linea, Columna)); return(null); } } else if (obj is Referencia) { if (expI.GetTipo().Tip != refObjetivo.Tipo.Tip) { errores.AddLast(new Error("Semántico", "El valor a asignar no es del mismo tipo.", Linea, Columna)); return(null); } } else if (obj is AccesoLista) { if (expI.GetTipo().Tip != listObjetivo.Tipo.Tip) { errores.AddLast(new Error("Semántico", "El valor a asignar no es del mismo tipo.", Linea, Columna)); return(null); } } rsList.AddLast(rsTemp); } else { errores.AddLast(new Error("Semántico", "El valor contiene errores.", Linea, Columna)); return(null); } } } else { if (expI is Identificador) { if (!Tipo.IsIndefinido()) { ((Identificador)expI).GetLocal = true; } ((Identificador)expI).Acceso = false; Result rsTemp = expI.GetC3D(e, funcion, ciclo, isObjeto, errores); if (rsTemp == null) //si no existe, creo la variable { if (!Tipo.IsIndefinido()) { rsTemp = new Result(); Sim s = new Sim(((Identificador)expI).Id, Tipo, Rol.LOCAL, 1, e.GetPos(), e.Ambito, -1, -1); rsTemp.Simbolo = s; if (isObjeto) { s.IsAtributo = true; } e.Add(s); if (!isDeclaracion) { string ptrStack = NuevoTemporal(); if (!isObjeto) { rsTemp.Codigo = ptrStack + " = P + " + s.Pos + ";\n"; rsTemp.Valor = "stack[" + ptrStack + "]"; } else { string ptrHeap = NuevoTemporal(); string valorHeap = NuevoTemporal(); rsTemp.Codigo = ptrStack + " = P + " + 1 + ";\n"; rsTemp.Codigo += valorHeap + " = stack[" + ptrStack + "];\n"; rsTemp.Codigo += ptrHeap + " = " + valorHeap + " + " + s.Pos + ";\n"; rsTemp.Valor = "heap[" + ptrHeap + "]"; } rsTemp.PtrStack = s.Pos; } } else { if (!isDeclaracion) { errores.AddLast(new Error("Semántico", "El valor contiene errores.", Linea, Columna)); } return(null); } } else { if (!Tipo.IsIndefinido()) { if (!isDeclaracion) { errores.AddLast(new Error("Semántico", "Ya se declaró una variable con el id: " + idObjetivo.Id + ".", Linea, Columna)); } return(null); } } rsList.AddLast(rsTemp); } else { return(null); /*No implementado otro tipo de valores(listas)*/ } } } if (!isDeclaracion) { if (rsList.Count() == 1) { if (rsObj.Simbolo != null) { if (rsObj.Simbolo.Tipo.IsList()) { if (rsList.ElementAt(0).Tipo != null) { rsObj.Simbolo.Tipo = rsList.ElementAt(0).Tipo; } } } //rsObj.Tipo = rsList.ElementAt(0).Tipo; rsObj.Codigo += rsList.ElementAt(0).Codigo; rsObj.Codigo += rsObj.Valor + " = " + rsList.ElementAt(0).Valor + ";\n"; } else { Result rsAnt = rsList.ElementAt(rsList.Count() - 1); for (int k = rsList.Count() - 2; k >= 0; k--) { Result rsAct = rsList.ElementAt(k); rsAct.Codigo += rsAnt.Codigo; rsAct.Codigo += rsAct.Valor + " = " + rsAnt.Valor + ";\n"; /*Esto solo funciona con ids*/ string ptrStack = NuevoTemporal(); rsAct.Codigo += ptrStack + " = P + " + rsAct.PtrStack + ";\n"; rsAct.Valor = NuevoTemporal(); rsAct.Codigo += rsAct.Valor + " = stack[" + ptrStack + "];\n"; rsAnt = rsAct; } if (rsObj.Simbolo != null) { if (rsObj.Simbolo.Tipo.IsList()) { if (rsAnt.Tipo != null) { rsObj.Simbolo.Tipo = rsAnt.Tipo; } } } rsObj.Codigo += rsAnt.Codigo; rsObj.Codigo += rsObj.Valor + " = " + rsAnt.Valor + ";\n"; } } if (rsObj != null) { result.Codigo += rsObj.Codigo; } } } return(result); }
private void btnAceptar_Click(object sender, EventArgs e) { switch (formMode) { case FormMode.agregar: { if (ValidarCampos()) { Objetivo oObjetivo = new Objetivo(); oObjetivo.nombre_corto = txtNombreCorto.Text; oObjetivo.nombre_largo = txtNombreLargo.Text; var resultado = objetivoService.AgregarObjetivo(oObjetivo); LimpiarTextBox(); this.Close(); } break; } case FormMode.modificar: { if (ValidarCampos()) { oObjetivoSel.nombre_corto = txtNombreCorto.Text; oObjetivoSel.nombre_largo = txtNombreLargo.Text; if (chbDarAlta.Visible == true) { oObjetivoSel.borrado = chbDarAlta.Checked ? "Activo" : "Borrado"; } var resultado = objetivoService.ModificarObjetivo(oObjetivoSel); if (objetivoService.ModificarObjetivo(oObjetivoSel)) { MessageBox.Show("El Objetivo seleccionado fue Modificado", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Dispose(); } else { MessageBox.Show("El Objetivo seleccionado no puedo ser Modificado", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; } case FormMode.eliminar: if (MessageBox.Show("¿Seguro que desea eliminar el objetivo?", "Aviso", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK) { if (objetivoService.BorrarObjetivo(oObjetivoSel)) { MessageBox.Show("El Objetivo Seleccionado Fue Eliminado", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } else { MessageBox.Show("Error al eliminar el Objetivo Seleccionado", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case FormMode.agregarACurso: { if (ValidarCampos()) { Objetivo oObjetivo = new Objetivo(); oObjetivo.nombre_corto = txtNombreCorto.Text; oObjetivo.nombre_largo = txtNombreLargo.Text; objetivos.Add(oObjetivo); LimpiarTextBox(); } break; } } }
public int Guardar(Objetivo model) { return(repositorio.Guardar(model)); }
public void InicializarForm(FormMode opcion, Objetivo objetivoSel) { formMode = opcion; oObjetivoSel = objetivoSel; }