protected override void CreateRowTemplate(C1GridViewRow row) { var lblEstado = row.Cells[TicketVo.IndexEstado].FindControl("lblEstado") as ResourceLabel; var lnkIniciar = row.Cells[TicketVo.IndexEstado].FindControl("lnkIniciar") as ResourceLinkButton; var lnkCerrar = row.Cells[TicketVo.IndexEstado].FindControl("lnkCerrar") as ResourceLinkButton; if (lblEstado == null) { lblEstado = new ResourceLabel { ResourceName = "Labels", ID = "lblEstado", Visible = false }; row.Cells[TicketVo.IndexEstado].Controls.Add(lblEstado); } if (lnkIniciar == null) { lnkIniciar = new ResourceLinkButton { ResourceName = "Labels", ID = "lnkIniciar", CommandName = "Start", CommandArgument = row.RowIndex.ToString(), VariableName = "TICKET_INICIAR", Visible = false, CausesValidation = false }; row.Cells[TicketVo.IndexEstado].Controls.Add(lnkIniciar); } if (lnkCerrar == null) { lnkCerrar = new ResourceLinkButton { ResourceName = "Labels", ID = "lnkCerrar", CommandName = "Close", CommandArgument = row.RowIndex.ToString(), VariableName = "TICKET_CERRAR", Visible = false, CausesValidation = false }; row.Cells[TicketVo.IndexEstado].Controls.Add(new Literal { Text = "<br/>" }); row.Cells[TicketVo.IndexEstado].Controls.Add(lnkCerrar); } lnkIniciar.Command += lnkbtnEstado_Command; lnkCerrar.Command += lnkbtnEstado_Command; }
/// <summary> /// Manages the errors raised by the parser methods /// </summary> /// <param name="projectTested">Project Tested</param> /// <param name="errorMsg">Error message to raise</param> /// <param name="msgParameters">List of paramaters to associated to the error message</param> /// <returns>Project tested with the error flag on</returns> protected virtual Project ManageError(Project projectTested, ResourceLabel label, string[] msgParameters) { //Validate object before use it if (projectTested == null) { return(projectTested); } projectTested.Error = true; //Throw the proper error this.OnMessageRaised(new Message(MessageType.Error, label, msgParameters)); return(projectTested); }
/// <summary> /// Constructor /// </summary> /// <param name="typeOfMessage">Type of Message</param> /// <param name="description">Message description</param> /// <param name="label">Resource label to be used on message</param> /// <param name="arguments">Arguments to replace values on message</param> public Message(MessageType typeOfMessage, ResourceLabel label, string[] arguments) { typeMessage = typeOfMessage; string description = resMan.Resources.GetString(label.ToString()); if (arguments == null) { messageDescription = description; } else { messageDescription = string.Format(CultureInfo.CurrentCulture, description, arguments); } }
protected override void CreateRowTemplate(C1GridViewRow row) { var lblEstado = row.Cells[ViajeDistribucionVo.IndexEstado].FindControl("lblEstado") as ResourceLabel; var lnkIniciar = row.Cells[ViajeDistribucionVo.IndexEstado].FindControl("lnkIniciar") as ResourceLinkButton; var lnkCerrar = row.Cells[ViajeDistribucionVo.IndexEstado].FindControl("lnkCerrar") as ResourceLinkButton; var lnkReenviar = row.Cells[ViajeDistribucionVo.IndexEstado].FindControl("lnkReenviar") as ResourceLinkButton; var lnkAsociar = row.Cells[ViajeDistribucionVo.IndexEstado].FindControl("lnkAsociar") as ResourceLinkButton; var lnkCombinar = row.Cells[ViajeDistribucionVo.IndexEstado].FindControl("lnkCombinar") as ResourceLinkButton; var cbVehiculo = row.Cells[ViajeDistribucionVo.IndexVehiculo].FindControl("cbVehiculo") as DropDownList; if (lblEstado == null) { lblEstado = new ResourceLabel { ResourceName = "Labels", ID = "lblEstado", Visible = false }; row.Cells[ViajeDistribucionVo.IndexEstado].Controls.Add(lblEstado); } if (lnkIniciar == null) { lnkIniciar = new ResourceLinkButton { ResourceName = "Labels", ID = "lnkIniciar", CommandName = "Start", CommandArgument = row.RowIndex.ToString("#0"), VariableName = "DISTRIBUCION_INICIAR", Visible = false }; row.Cells[ViajeDistribucionVo.IndexEstado].Controls.Add(lnkIniciar); } row.Cells[ViajeDistribucionVo.IndexEstado].Controls.Add(new Literal { Text = @"<br/>" }); if (lnkAsociar == null) { lnkAsociar = new ResourceLinkButton { ResourceName = "Labels", ID = "lnkAsociar", CommandName = "Asociar", CommandArgument = row.RowIndex.ToString("#0"), VariableName = "ASOCIAR_VEHICULO", Visible = false, OnClientClick = string.Concat("return confirm('", CultureManager.GetString("SystemMessages", "CONFIRM_OPERATION"), "');") }; row.Cells[ViajeDistribucionVo.IndexEstado].Controls.Add(lnkAsociar); } if (lnkCombinar == null) { lnkCombinar = new ResourceLinkButton { ResourceName = "Labels", ID = "lnkCombinar", CommandName = "Combinar", CommandArgument = row.RowIndex.ToString("#0"), VariableName = "DISTRIBUCION_COMBINAR", Visible = false, OnClientClick = string.Concat("return confirm('", CultureManager.GetString("SystemMessages", "CONFIRM_OPERATION"), "');") }; row.Cells[ViajeDistribucionVo.IndexEstado].Controls.Add(lnkCombinar); } if (lnkCerrar == null) { lnkCerrar = new ResourceLinkButton { ResourceName = "Labels", ID = "lnkCerrar", CommandName = "Close", CommandArgument = row.RowIndex.ToString("#0"), VariableName = "DISTRIBUCION_CERRAR", Visible = false, OnClientClick = string.Concat("return confirm('", CultureManager.GetString("SystemMessages", "CONFIRM_OPERATION"), "');") }; row.Cells[ViajeDistribucionVo.IndexEstado].Controls.Add(lnkCerrar); } if (lnkReenviar == null) { lnkReenviar = new ResourceLinkButton { ResourceName = "Labels", ID = "lnkReenviar", CommandName = "Reenviar", CommandArgument = row.RowIndex.ToString("#0"), VariableName = "DISTRIBUCION_REENVIAR", Visible = false, OnClientClick = string.Concat("return confirm('", CultureManager.GetString("SystemMessages", "CONFIRM_OPERATION"), "');") }; row.Cells[ViajeDistribucionVo.IndexEstado].Controls.Add(new Literal { Text = @"<br/>" }); row.Cells[ViajeDistribucionVo.IndexEstado].Controls.Add(lnkReenviar); } if (cbVehiculo == null) { cbVehiculo = new DropDownList { ID = "cbVehiculo", Visible = true }; row.Cells[ViajeDistribucionVo.IndexVehiculo].Controls.Add(cbVehiculo); } cbVehiculo.SelectedIndexChanged += ComboOnSelectedIndexChanged; lnkIniciar.Command += LnkbtnEstadoCommand; lnkCerrar.Command += LnkbtnEstadoCommand; lnkReenviar.Command += LnkbtnEstadoCommand; lnkAsociar.Command += LnkbtnEstadoCommand; lnkCombinar.Command += LnkbtnEstadoCommand; }