private void CreateControlPanelScores() { PanelScores.Controls.Clear(); if (Scores.Count > 0) { foreach (Score score in Scores) { System.Web.UI.UserControl control = (System.Web.UI.UserControl)Page.LoadControl("~/UserControl/ScoreControl.ascx"); control.ID = "Score" + score.ScoreID.ToString(); HiddenField hiddenField = ( HiddenField )control.FindControl("HiddenFieldScoreID"); hiddenField.Value = score.ScoreID.ToString(); Table table = ( Table )control.FindControl("TableScore"); table.ID = "TableScore" + score.ScoreID.ToString(); table.CssClass = "TableScoreStyle"; TextBox textBoxScoreMin = ( TextBox )table.FindControl("TextBoxScoreMin"); textBoxScoreMin.Text = score.ScoreMin.ToString(); TextBox textBoxScoreMax = ( TextBox )table.FindControl("TextBoxScoreMax"); textBoxScoreMax.Text = score.ScoreMax.ToString(); TextBox textBoxScoreTexte = ( TextBox )table.FindControl("TextBoxScoreTexte"); textBoxScoreTexte.Text = score.ScoreTexte; ImageButton imageButtonSupprimer = ( ImageButton )control.FindControl("ImageButtonSupprimerScore"); imageButtonSupprimer.Click += new ImageClickEventHandler(ImageButtonScoreSupprimer_Click); ImageButton imageButtonSauver = ( ImageButton )control.FindControl("ImageButtonSauverScore"); imageButtonSauver.Click += new ImageClickEventHandler(ImageButtonScoreSauver_Click); PanelScores.Controls.Add(control); PanelScores.Controls.Add(new LiteralControl("<br/>")); } } // Scores a ajouter for (int i = Scores.Count + 1; i <= Scores.Count + NombreScores; i++) { System.Web.UI.UserControl control = (System.Web.UI.UserControl)Page.LoadControl("~/UserControl/ScoreControl.ascx"); // BUG29112009 //control.ID = "Score" + i.ToString(); control.ID = "ScoreToAdd" + i.ToString(); Table table = ( Table )control.FindControl("TableScore"); table.ID += i.ToString(); ImageButton imageButtonSupprimer = ( ImageButton )control.FindControl("ImageButtonSupprimerScore"); imageButtonSupprimer.Visible = false; ImageButton imageButtonSauver = ( ImageButton )control.FindControl("ImageButtonSauverScore"); imageButtonSauver.Visible = false; PanelScores.Controls.Add(control); PanelScores.Controls.Add(new LiteralControl("<br/>")); } }
protected void Page_Load(object sender, EventArgs e) { if (Session["AppLocation"] == null || Session.Count == 0 || Session["AppUserID"].ToString() == "") { IQCareMsgBox.Show("SessionExpired", this); Response.Redirect("~/frmlogin.aspx", true); } int PatientId = Convert.ToInt32(Request.QueryString["ptnpk"]); int VisitId = Convert.ToInt32(Request.QueryString["VisitId"]); IPediatric PrintManager; PrintManager = (IPediatric)ObjectFactory.CreateInstance("BusinessProcess.Pharmacy.BPediatric, BusinessProcess.Pharmacy"); DataSet theDSPrint = PrintManager.GetPharmacyDetailforLabelPrint(PatientId, VisitId); int i = 0; foreach (DataRow DR in theDSPrint.Tables[1].Rows) { System.Web.UI.UserControl uc = (System.Web.UI.UserControl)Page.LoadControl("usrctrlprintpharmacy.ascx"); uc.ID = "" + i + ""; Label lblFacility = ((Label)uc.FindControl("lblfacility")); lblFacility.Text = Convert.ToString(theDSPrint.Tables[0].Rows[0]["FacilityName"]); lblFacility.ID = "fac" + i + ""; Label lblpName = ((Label)uc.FindControl("lblpName")); lblpName.Text = Convert.ToString(theDSPrint.Tables[0].Rows[0]["Name"]); lblpName.ID = "pname" + i + ""; Label lbldrugName = ((Label)uc.FindControl("lbldrugName")); lbldrugName.Text = Convert.ToString(DR["DrugName"]); lbldrugName.ID = "dname" + i + ""; Label lblunit = ((Label)uc.FindControl("lblunit")); lblunit.Text = Convert.ToString(DR["unitName"]); lblunit.ID = "uname" + i + ""; TextBox txtprintInstruction = ((TextBox)uc.FindControl("txtprintInstruction")); txtprintInstruction.Text = Convert.ToString(DR["PatientInstructions"]); txtprintInstruction.ID = "PIns" + i + ""; Button theButton = new Button(); theButton.ID = "btn1" + i + ""; theButton.Text = "Print Label"; theButton.Click += new EventHandler(theButton_Click); Panel thepnl = new Panel(); thepnl.ID = "pnl" + i + ""; thepnl.BorderStyle = BorderStyle.Double; thepnl.BorderColor = System.Drawing.Color.Black; thepnl.Controls.Add(uc); thepnl.Controls.Add(theButton); thepnl.Controls.Add(new LiteralControl("<br /><br />")); pnlprintdialog.Controls.Add(thepnl); i++; } }
public static void LoadToolTipHelpValidationsForUserControl(ref System.Web.UI.UserControl oUserControl) { if (oUserControl != null) { UIFactory oUIFactory = new UIFactory(); UIWebUserControl oUIWebUserControl = oUIFactory.GetUIWebUserControl(oUserControl.AppRelativeVirtualPath.Substring(1)); foreach (UIControl oUIControl in oUIWebUserControl.ControlList) { //Find the Label Control to Add Tooltip and Help Control oLabelControl = null; oLabelControl = oUserControl.FindControl(oUIControl.LabelName); if (oLabelControl != null) { Label lbl = (Label)oLabelControl; //lbl.ToolTip = oUIControl.ToolTipText; //Check if already added the help if (lbl.Text.Contains("ShowHelpWindow") == false) { string strHelpPopup = ""; if (oUIControl.HTMLHelp != "") { strHelpPopup = " <a href=\"javascript:void(0);\" onclick=\"ShowHelpWindow('" + oUIControl.ControlId + "');\"><img src=\"/images/help_control.gif\" border=\"0\" align=\"absmiddle\"/></a>"; } lbl.Text = lbl.Text + strHelpPopup; //lbl.Text = oUIControl.LabelText+ strHelpPopup; } } //Find the Primary Control to add validations if (oUIControl.ControlName != "") { Control oPrimaryControl = oUserControl.FindControl(oUIControl.ControlName); if (oPrimaryControl != null) { ApplyToolTip(ref oPrimaryControl, oUIControl); if (ConfigurationManager.AppSettings["CONTROLS_ADD_VALIDATIONS_FROM_DB"].ToString() == "1") { ApplyValidations(ref oPrimaryControl, ref oUserControl, oUIControl); } } } } //Loop through UserControl controls to check for more User controls foreach (Control oControl in oUserControl.Controls) { Control oTmp = new Control(); oTmp = oControl; FindUserControlRecurrsive(ref oTmp); } } }
private void CreateControlPanelQuestions() { PanelQuestions.Controls.Clear(); for (int i = 1; i <= NombreQuestionEnchainee; i++) { System.Web.UI.UserControl control = (System.Web.UI.UserControl)Page.LoadControl("~/UserControl/QuestionControl.ascx"); control.ID = "Question" + i.ToString(); Table table = ( Table )control.FindControl("TableQuestionEnchainee"); table.ID += i.ToString(); Label label = ( Label )control.FindControl("LabelQuestionEnchainee"); label.Text += " <font color=\"#5282D4\">" + i.ToString() + "</font> : "; PanelQuestions.Controls.Add(control); PanelQuestions.Controls.Add(new LiteralControl("<br/>")); } }
/// <Summary> /// GetPortalModuleBase gets the parent PortalModuleBase Control /// </Summary> public static PortalModuleBase GetPortalModuleBase( UserControl objControl ) { PortalModuleBase objPortalModuleBase = null; Panel ctlPanel; if (objControl is SkinObjectBase) { ctlPanel = (Panel)objControl.Parent.FindControl("ModuleContent"); } else { ctlPanel = (Panel)objControl.FindControl("ModuleContent"); } if (ctlPanel != null) { try { objPortalModuleBase = (PortalModuleBase)ctlPanel.Controls[0]; } catch { // module was not loaded correctly } } if (objPortalModuleBase == null) { objPortalModuleBase = new PortalModuleBase(); objPortalModuleBase.ModuleConfiguration = new ModuleInfo(); } return objPortalModuleBase; }
/// <summary> /// 设置网面包屑 /// </summary> /// <param name="value">格式为[一级:/path/,二级:/path/filename.html|三级]</param> public void CrumbRegister(string value) { StringBuilder NodeList = new StringBuilder(); string[] Crumb = value.Split('|'); if (Crumb.Length > 1) { string[] Nodes = Crumb[0].Split(','); string[] _Node = new string[1]; NodeList.Append("<span>»</span>"); foreach (string Node in Nodes) { _Node = Node.Split(':'); NodeList.Append("<a href=\"" + _Node[1] + "\" title=\"" + _Node[0] + "\">" + _Node[0] + "</a><span>»</span>"); } NodeList.Append("<em>" + Crumb[1] + "</em>"); value = NodeList.ToString(); } else { value = "<span>»</span>" + value; } System.Web.UI.UserControl CrumbContainer = this.Master.Master.FindControl("ContainerPlaceHolder").FindControl("CrumbContainer") as System.Web.UI.UserControl; Literal ltCrumbContainer = CrumbContainer.FindControl("ltCrumbContainer") as Literal; ltCrumbContainer.Text = value; }
private void actualizarDatos(UserControl userControl, GridEditableItem g) { Consulta c = new Consulta(); RipsValidadorDao.ConnectionDB.AutenticationProvider.Consulta c1 = new RipsValidadorDao.ConnectionDB.AutenticationProvider.Consulta(); DetalleGrupoDependiente d = null; InsertUpdateDelete i = new InsertUpdateDelete(c1.consultarUsuarioXnombre(User.Identity.Name)); try { d = c.consultarDetalleGrupoDependenciaOBJ(Convert.ToInt32(g.GetDataKeyValue("id_grupo"))); d.estado = c.consultarEstadoParametrizacionOBJ(Convert.ToInt16((userControl.FindControl("ddlEstado") as RadDropDownList).SelectedValue)); d.descripcion = (userControl.FindControl("txtDescripcion") as RadTextBox).Text.Trim(); i.IUDdetGrupoVariableDependiente(d, 3); this.RadWindowManager1.RadAlert("Datos actualizados correctamente", 400, 200, Utilities.windowTitle(TypeMessage.information_message), null, Utilities.pathImageMessage(TypeMessage.information_message)); cargarGrilla2(); } catch (Exception ex) { Logger.generarLogError(ex.Message, new System.Diagnostics.StackFrame(true), ex); this.RadWindowManager1.RadAlert(Utilities.errorMessage(), 400, 200, Utilities.windowTitle(TypeMessage.error_message), null, Utilities.pathImageMessage(TypeMessage.error_message)); } }
protected void ButtonAjouterQuestion_Click(object sender, EventArgs e) { LabelValidationMessage.Text = ""; for (int i = 1; i <= NombreQuestionEnchainee; i++) { string tableQuestionEnchaineeID = "TableQuestionEnchainee" + i.ToString(); string userControlID = "Question" + i.ToString(); System.Web.UI.UserControl control = (System.Web.UI.UserControl)PanelQuestions.FindControl(userControlID); Table tableQuestionEnchainee = ( Table )control.FindControl(tableQuestionEnchaineeID); // Petite precaution toujours aussi dur d'ecrire ce code if (tableQuestionEnchainee == null) { break; } TextBox textBox = ( TextBox )tableQuestionEnchainee.FindControl("TextBoxQuestionEnchainee"); if (string.IsNullOrEmpty(textBox.Text.Trim())) { LabelValidationMessage.Visible = true; LabelValidationMessage.Text += "Donner un libellé pour la Question : " + i.ToString() + "<br/>"; continue; } DropDownList dropDownList = ( DropDownList )tableQuestionEnchainee.FindControl("DropDownListTypeQuestionReponse"); if (dropDownList.SelectedValue == "-1") { LabelValidationMessage.Visible = true; LabelValidationMessage.Text += "Choisir un type de Question pour la Question : " + textBox.Text + "<br/>"; continue; } CheckBox checkBox = ( CheckBox )tableQuestionEnchainee.FindControl("CheckBoxQuestionObligatoire"); PollQuestion question = new PollQuestion(); // Premiere Question, est-ce un tableau ? if (i == 1) { if (TextBoxTitreTableau.Text.Trim() != "") { question.Tableau = TextBoxTitreTableau.Text.Trim(); } if (TextBoxPageTableau.Text.Trim() != "") { question.SautPage = TextBoxPageTableau.Text.Trim(); } } // Derniere Question, terminer le tableau if (i == NombreQuestionEnchainee) { if (TextBoxTitreTableau.Text.Trim() != "") { question.Tableau = Tableau.Fin; } } question.CreationDate = DateTime.Now; question.Question = textBox.Text.Trim(); question.Obligatoire = checkBox.Checked; question.ChoixMultiple = TypeQuestionReponse.GetTypeQuestion(dropDownList.SelectedValue); question.QuestionnaireID = SessionState.Questionnaire.QuestionnaireID; question.MembreGUID = SessionState.Questionnaire.MembreGUID; question.Societe = String.Empty; question.Instruction = String.Empty; question.Message = String.Empty; PollQuestionCollection pollQuestions = PollQuestionCollection.GetByQuestionnaire(SessionState.Questionnaire.QuestionnaireID); question.Rank = pollQuestions.MaxRank() + 1; // Tester les limitations avant d'ajouter la question if (SessionState.Limitations.LimiteQuestions) { Tools.PageValidation("La limite du nombre de Questions : " + SessionState.Limitations.NombreQuestions + " est atteinte.<br/>Contactez l'administrateur."); } int status = PollQuestion.Create(question); if (status != 0) { LabelValidationMessage.Visible = true; LabelValidationMessage.Text += "Erreur à la création de la Question.<br/>"; } else { SessionState.Limitations.AjouterQuestion(); LabelValidationMessage.Visible = true; LabelValidationMessage.Text += "Question crée correctement : " + question.Question + "<br/>"; } // Creer les Reponses a la Question TextBox textBoxReponses = ( TextBox )tableQuestionEnchainee.FindControl("TextBoxReponses"); if (string.IsNullOrEmpty(textBoxReponses.Text.Trim()) == false) { int rank = 1; string[] reponsesSplit = textBoxReponses.Text.Trim().Split(';'); foreach (string rep in reponsesSplit) { PollAnswer reponse = new PollAnswer(rep.Trim()); reponse.PollQuestionId = question.PollQuestionId; reponse.TypeReponse = TypeQuestionReponse.GetTypeReponse(dropDownList.SelectedValue); //reponse.Obligatoire = cbxObligatoire.Checked; on ne sait pas faire reponse.Rank = rank; int status2 = PollAnswer.Create(reponse); rank += 1; if (status2 != 0) { LabelValidationMessage.Visible = true; LabelValidationMessage.Text += "Erreur à la création de la Réponse : " + rep + "<br/>"; } else { LabelValidationMessage.Visible = true; LabelValidationMessage.Text += " Réponse crée correctement : " + rep + "<br/>"; } } } } }
private void guardarDatos(UserControl userControl, GridEditableItem g = null) { string codArchivo = this.ddlTipoArchivo.SelectedValue; int numColumna = Convert.ToInt32(this.ddlNumColumna.SelectedValue); Consulta c = new Consulta(); RipsValidadorDao.ConnectionDB.AutenticationProvider.Consulta c1 = new RipsValidadorDao.ConnectionDB.AutenticationProvider.Consulta(); InsertUpdateDelete i = new InsertUpdateDelete(c1.consultarUsuarioXnombre(User.Identity.Name)); try { EncabezadoGrupoVarDependiente e = new EncabezadoGrupoVarDependiente(); e.datosArchivo = c.consultarEstructuraArchivo(codArchivo, numColumna); e.estado = c.consultarEstadoParametrizacionOBJ(Convert.ToInt16((userControl.FindControl("ddlEstado") as RadDropDownList).SelectedValue)); e.descripcion = (userControl.FindControl("txtDescripcion") as RadTextBox).Text.Trim(); if (g == null) { e.idEncabezadoGrupo = 0; i.IUDencGrupoVariableDependiente(e, 2); } else { e.idEncabezadoGrupo = Convert.ToInt32(g.GetDataKeyValue("id_enc_grupo")); i.IUDencGrupoVariableDependiente(e, 3); } cargarGrilla(); } catch (Exception ex) { Logger.generarLogError(ex.Message, new System.Diagnostics.StackFrame(true), ex); this.RadWindowManager1.RadAlert(Utilities.errorMessage(), 400, 200, Utilities.windowTitle(TypeMessage.error_message), null, Utilities.pathImageMessage(TypeMessage.error_message)); } }
private void actualizarDatos(GridEditableItem g, UserControl uc) { Consulta c = new Consulta(); RipsValidadorDao.ConnectionDB.AutenticationProvider.Consulta c1 = new RipsValidadorDao.ConnectionDB.AutenticationProvider.Consulta(); InsertUpdateDelete i = new InsertUpdateDelete(c1.consultarUsuarioXnombre(User.Identity.Name)); try { int id_var_dependiente = (int)g.OwnerTableView.DataKeyValues[g.ItemIndex]["id_var_dependiente"]; VariableDependiente v = c.consultarVariablesDependientesOBJ(id_var_dependiente); v.mensajeError = ((RadTextBox)uc.FindControl("txtMensaje")).Text.Trim(); v.estado = Convert.ToInt16(((RadDropDownList)uc.FindControl("ddlEstado")).SelectedValue); i.IUDvariablesDependientes(v, 3); this.RadWindowManager1.RadAlert("Registro Actualizado Correctamente", 400, 200, Utilities.windowTitle(TypeMessage.information_message), null, Utilities.pathImageMessage(TypeMessage.information_message)); cargarGrilla(); activarOtroValorDep(1); activarOtroValorCru(1); } catch (Exception ex) { Logger.generarLogError(ex.Message, new System.Diagnostics.StackFrame(true), ex); this.RadWindowManager1.RadAlert(Utilities.errorMessage(), 400, 200, Utilities.windowTitle(TypeMessage.error_message), null, Utilities.pathImageMessage(TypeMessage.error_message)); } }
private void guardarDatos(UserControl userControl, GridEditableItem g = null) { Consulta c = new Consulta(); RipsValidadorDao.ConnectionDB.AutenticationProvider.Consulta c1 = new RipsValidadorDao.ConnectionDB.AutenticationProvider.Consulta(); InsertUpdateDelete i = new InsertUpdateDelete(c1.consultarUsuarioXnombre(User.Identity.Name)); string mensaje = string.Empty; try { CruceAfiliadoColumna c2 = new CruceAfiliadoColumna(); c2.estado = Convert.ToInt16((userControl.FindControl("ddlEstado") as RadDropDownList).SelectedValue); c2.columnaCruce = c.consultarColumnaCruceOBJ(Convert.ToInt32((userControl.FindControl("ddlColumna") as RadDropDownList).SelectedValue)); c2.cruceAfiliado = c.consultarCruceAfiliadoOBJ(Convert.ToInt32(ViewState["idCruce"])); if (g == null) { if (c.consultarCruceAfiliadoColumnaOBJ(c2.cruceAfiliado.id, c2.columnaCruce.id) == null) { i.IUDcruceAfiliadoColumna(c2, 2); mensaje = "Datos Guardados Correctamente"; } else { this.RadWindowManager1.RadAlert("La columna que intenta asignar al cruce, ya hace parte de esté y no se puede duplicar, Favor seleccionar otra columna", 400, 200, Utilities.windowTitle(TypeMessage.information_message), null, Utilities.pathImageMessage(TypeMessage.information_message)); return; } } else { i.IUDcruceAfiliadoColumna(c2, 3); mensaje = "Datos Actualizados Correctamente"; } cargarGrilla(); this.RadWindowManager1.RadAlert(mensaje, 400, 200, Utilities.windowTitle(TypeMessage.information_message), null, Utilities.pathImageMessage(TypeMessage.information_message)); } catch (Exception ex) { Logger.generarLogError(ex.Message, new System.Diagnostics.StackFrame(true), ex); this.RadWindowManager1.RadAlert(Utilities.errorMessage(), 400, 200, Utilities.windowTitle(TypeMessage.error_message), null, Utilities.pathImageMessage(TypeMessage.error_message)); } }
protected void BindBottomPaging(UserControl ucPaging, UserControl ucPaging1) { (ucPaging1.FindControl("txtPageNo") as TextBox).Text = (ucPaging.FindControl("txtPageNo") as TextBox).Text; (ucPaging1.FindControl("lblTotPages") as Label).Text = (ucPaging.FindControl("lblTotPages") as Label).Text; (ucPaging1.FindControl("lnkimgbtnFirst") as LinkButton).Enabled = (ucPaging.FindControl("lnkimgbtnFirst") as LinkButton).Enabled; (ucPaging1.FindControl("lnkimgbtnPrevious") as LinkButton).Enabled = (ucPaging.FindControl("lnkimgbtnPrevious") as LinkButton).Enabled; (ucPaging1.FindControl("lnkimgbtnNext") as LinkButton).Enabled = (ucPaging.FindControl("lnkimgbtnNext") as LinkButton).Enabled; (ucPaging1.FindControl("lnkimgbtnLast") as LinkButton).Enabled = (ucPaging.FindControl("lnkimgbtnLast") as LinkButton).Enabled; }
private void guardarDatos(UserControl userControl, GridEditableItem g = null) { Consulta c = new Consulta(); RipsValidadorDao.ConnectionDB.AutenticationProvider.Consulta c1 = new RipsValidadorDao.ConnectionDB.AutenticationProvider.Consulta(); InsertUpdateDelete i = new InsertUpdateDelete(c1.consultarUsuarioXnombre(User.Identity.Name)); string mensaje = string.Empty; try { CruceAfiliado c2 = new CruceAfiliado(); c2.descripcion = (userControl.FindControl("txtDescripcion") as RadTextBox).Text.Trim(); c2.prioridad = Convert.ToInt32((userControl.FindControl("txtPrioridad") as RadNumericTextBox).Text); c2.estado = Convert.ToInt16((userControl.FindControl("ddlEstado") as RadDropDownList).SelectedValue); if (validarPrioridad(c2.prioridad)) { if (g == null) { c2.id = 0; i.IUDcruceAfiliado(c2, 2); mensaje = "Datos Guardados Correctamente"; } else { c2.id = Convert.ToInt32(g.GetDataKeyValue("id")); i.IUDcruceAfiliado(c2, 3); mensaje = "Datos Actualizados Correctamente"; } cargarGrilla(); this.RadWindowManager1.RadAlert(mensaje, 400, 200, Utilities.windowTitle(TypeMessage.information_message), null, Utilities.pathImageMessage(TypeMessage.information_message)); } else { this.RadWindowManager1.RadAlert("La prioridad seleccionada para el cruce ya existe, por favor seleccione otro nivel de prioridad", 400, 200, Utilities.windowTitle(TypeMessage.information_message), null, Utilities.pathImageMessage(TypeMessage.information_message)); } } catch (Exception ex) { Logger.generarLogError(ex.Message, new System.Diagnostics.StackFrame(true), ex); this.RadWindowManager1.RadAlert(Utilities.errorMessage(), 400, 200, Utilities.windowTitle(TypeMessage.error_message), null, Utilities.pathImageMessage(TypeMessage.error_message)); } }
private void guardarDatos(UserControl uc, GridEditableItem g = null) { string extension = (uc.FindControl("txtExtension") as RadTextBox).Text.Trim().ToUpper(); string descripcion = (uc.FindControl("txtDescipcion") as RadTextBox).Text.Trim(); RipsValidadorDao.ConnectionDB.AutenticationProvider.Consulta c = new RipsValidadorDao.ConnectionDB.AutenticationProvider.Consulta(); InsertUpdateDelete i = new InsertUpdateDelete(c.consultarUsuarioXnombre(User.Identity.Name)); if (g == null) { DataRow[] changeRow = tablaDatos.Select("text = '" + extension + "'"); if (changeRow.Length <= 0) { try { ExtensionArchivo e = new ExtensionArchivo(0, extension.ToUpper(), descripcion); i.IUDextensionArchivo(e, 2); this.RadWindowManager1.RadAlert("Valor agregado correctamente", 400, 200, Utilities.windowTitle(TypeMessage.information_message), null, Utilities.pathImageMessage(TypeMessage.information_message)); cargarGrilla(); } catch(Exception ex) { Logger.generarLogError(ex.Message, new System.Diagnostics.StackFrame(true), ex); this.RadWindowManager1.RadAlert(Utilities.errorMessage(),400,200,Utilities.windowTitle(TypeMessage.error_message), null, Utilities.pathImageMessage(TypeMessage.error_message)); } } else { this.RadWindowManager1.RadAlert("La extension que inteta agregar, ya existe",400,200,Utilities.windowTitle(TypeMessage.information_message), null,Utilities.pathImageMessage(TypeMessage.information_message)); } } else { Int16 idExtension = Convert.ToInt16(g.GetDataKeyValue("value")); try { ExtensionArchivo e = new ExtensionArchivo(idExtension, extension.ToUpper(), descripcion); i.IUDextensionArchivo(e, 3); this.RadWindowManager1.RadAlert("Valor actualizado correctamente", 400, 200, Utilities.windowTitle(TypeMessage.information_message), null, Utilities.pathImageMessage(TypeMessage.information_message)); cargarGrilla(); } catch(Exception ex) { Logger.generarLogError(ex.Message, new System.Diagnostics.StackFrame(true), ex); this.RadWindowManager1.RadAlert(Utilities.errorMessage(),400,200,Utilities.windowTitle(TypeMessage.error_message), null, Utilities.pathImageMessage(TypeMessage.error_message)); } } }
public static PortalModuleBase GetPortalModuleBase(UserControl control) { PortalModuleBase moduleControl = null; Panel panel; if (control is SkinObjectBase) { panel = (Panel) control.Parent.FindControl("ModuleContent"); } else { panel = (Panel) control.FindControl("ModuleContent"); } if (panel != null) { try { moduleControl = (PortalModuleBase) panel.Controls[1]; } catch { //check if it is nested within an UpdatePanel try { moduleControl = (PortalModuleBase) panel.Controls[0].Controls[0].Controls[1]; } catch (Exception exc) { Exceptions.LogException(exc); } } } return moduleControl ?? (new PortalModuleBase {ModuleConfiguration = new ModuleInfo()}); }
protected void ButtonAjouterScore_Click(object sender, EventArgs e) { LabelValidationMessage.Text = ""; for (int i = Scores.Count + 1; i <= Scores.Count + NombreScores; i++) { string tableScoresID = "TableScore" + i.ToString(); // BUG29112009 //string userControlID = "Score" + i.ToString(); string userControlID = "ScoreToAdd" + i.ToString(); System.Web.UI.UserControl control = (System.Web.UI.UserControl)PanelScores.FindControl(userControlID); Table tableScores = ( Table )control.FindControl(tableScoresID); // Petite precaution toujours aussi dur d'ecrire ce code if (tableScores == null) { break; } TextBox textBoxScoreMin = ( TextBox )tableScores.FindControl("TextBoxScoreMin"); int scoreMin = 0; if (string.IsNullOrEmpty(textBoxScoreMin.Text.Trim()) == false) { try { scoreMin = int.Parse(textBoxScoreMin.Text.Trim()); } catch { LabelValidationMessage.Visible = true; LabelValidationMessage.Text += "Score mininum est un entier<br/>"; continue; } } TextBox textBoxScoreMax = ( TextBox )tableScores.FindControl("TextBoxScoreMax"); int scoreMax = 0; if (string.IsNullOrEmpty(textBoxScoreMax.Text.Trim()) == false) { try { scoreMax = int.Parse(textBoxScoreMax.Text.Trim()); } catch { LabelValidationMessage.Visible = true; LabelValidationMessage.Text += "Score maximum est un entier<br/>"; continue; } } if (scoreMin > scoreMax) { LabelValidationMessage.Visible = true; LabelValidationMessage.Text += "Score minimum est supérieur au Score maximum<br/>"; continue; } TextBox textBoxScoreTexte = ( TextBox )tableScores.FindControl("TextBoxScoreTexte"); if (string.IsNullOrEmpty(textBoxScoreTexte.Text.Trim())) { LabelValidationMessage.Visible = true; LabelValidationMessage.Text += "Donnez un texte de validation pour le Score<br/>"; continue; } Score score = new Score(); score.ScoreQuestionnaireID = SessionState.Questionnaire.QuestionnaireID; score.ScoreMin = scoreMin; score.ScoreMax = scoreMax; score.ScoreTexte = textBoxScoreTexte.Text.Trim(); int status = Score.Create(score); if (status != 1) { LabelValidationMessage.Visible = true; LabelValidationMessage.Text += "Erreur à la création du Score .<br/>"; } else { LabelValidationMessage.Visible = true; LabelValidationMessage.Text += "Score crée correctement : " + score.ScoreTexte + "<br/>"; } } // fin du for ( int i = 1;i <= NombreScores;i++ ) Scores = ScoreCollection.GetScoreQuestionnaire(SessionState.Questionnaire.QuestionnaireID); CreateControlPanelScores(); }
/// <summary> /// 页面利用反射循环执行页面用户控件中的某一个方法名相同的方法 /// </summary> /// <param name="page">父页面</param> /// <param name="array">一维数组,用于存放用户控件的名称</param> /// <param name="method_name">方法名</param> /// <returns></returns> public static string UserControlReflectionLoopMethod(UserControl page, string[] array, string method_name) { string ErrMsg = ""; for (int i = 0; i < array.Length; i++) { UserControl uc = page.FindControl(array[i].ToString()) as UserControl; if (uc != null) { Type pageType = uc.GetType(); MethodInfo mi = pageType.GetMethod(method_name); string ErrMsg_Temp = mi.Invoke(uc, null).ToString(); if (ErrMsg_Temp != "") { ErrMsg += ErrMsg_Temp + "\r\n"; } } } return ErrMsg; }