Ejemplo n.º 1
0
 private void btn_ricerca_Click(object sender, System.Web.UI.ImageClickEventArgs e)
 {
     try
     {
         string tipoOp = "";
         if (this.rb_opzioni.SelectedIndex == -1)
         {
             Response.Write("<script>alert('Attenzione selezionare un criterio di ricerca.')</script>");
             return;
         }
         else
         {
             //Verifica che siano stati inseriti tutti i campi obbligatori
             if (this.rb_opzioni.SelectedItem.Value == "fascGen")
             {
                 if (this.Gerarchia != null && Gerarchia.Nodes.Count == 0)
                 {
                     Response.Write("<script>alert('Attenzione selezionare un fascicolo.')</script>");
                     return;
                 }
                 if (string.IsNullOrEmpty(tbAnnoProt.Text))
                 {
                     Response.Write("<script>alert('Attenzione selezionare un anno.')</script>");
                     return;
                 }
                 Session.Add("Anno", this.tbAnnoProt.Text);
                 tipoOp = "F";
             }
             else
             if (this.rb_opzioni.SelectedItem.Value == "serie")
             {
                 if (ddl_tipologiaDoc.SelectedIndex == 0)
                 {
                     Response.Write("<script>alert('Attenzione selezionare una tipologia documento.')</script>");
                     return;
                 }
                 DropDownList ddl = (DropDownList)panel_Contenuto.FindControl("ddl_Contatori");
                 if (ddl != null && ddl.SelectedIndex == -1)
                 {
                     Response.Write("<script>alert('Attenzione selezionare un contatore.')</script>");
                     return;
                 }
                 if (string.IsNullOrEmpty(this.TxtAnno.Text))
                 {
                     Response.Write("<script>alert('Attenzione selezionare un anno.')</script>");
                     return;
                 }
                 CreaCriterioRicercaSerie();
                 tipoOp = "S";
             }
             string url       = "tabRisultatiRicArchivio.aspx?tipoOp=" + tipoOp;
             string funct_dx2 = "top.principale.frames[1].location='" + url + "'";
             this.Page.Response.Write("<script> " + funct_dx2 + "</script>");
         }
     }
     catch (Exception ex)
     {
         DocsPAWA.ErrorManager.redirectToErrorPage(this, ex);
     }
 }
        /// <summary>
        /// Displays an empty Zutetenlist which is used when new Zutaten are added.
        /// </summary>
        /// <param name="rezeptAbteilungPanel"></param>
        /// <param name="newestOnly">true when called form the AddZutaten OnClick event</param>
        private void DisplayNeueZutatentenListe(Panel rezeptAbteilungPanel, bool newestOnly)
        {
            var eventtarget = Request.Params.Get("__EVENTTARGET"); //is null when a submit button is clicked or page is loaded without postback
            var rezeptAbteilungPanelID = Helper.IsolateRezepAbteilungPanelIDFromEventtargetString(eventtarget);

            var zutatenAnzahl = 0;
            if (ViewState[rezeptAbteilungPanel.ID] != null)
                zutatenAnzahl = (int) ViewState[rezeptAbteilungPanel.ID];

            if(zutatenAnzahl == 0)
            {
                //ZutatenCounter für Rezeptabteilung erhöhen
                zutatenAnzahl += 1;
                ViewState[rezeptAbteilungPanel.ID] = zutatenAnzahl;
            }

            if (newestOnly)
            {
                //Bestehende neue Zutat und Rezeptabteilung Buttons entfernen - sonst steht die neue Zeile nach den Buttons
                var neueZutatButton = rezeptAbteilungPanel.FindControl(Helper.REZEPBEARBEITEN_IDENT_NEUE_ZUTAT_BUTTON + rezeptAbteilungPanel.ID);
                var neueRezeptAbteilungButton = rezeptAbteilungPanel.FindControl(Helper.REZEPBEARBEITEN_IDENT_NEUE_REZEPTABTEILUNG_BUTTON + rezeptAbteilungPanel.ID);
                var neueZutatButtonLit = rezeptAbteilungPanel.FindControl("Lit " + Helper.REZEPBEARBEITEN_IDENT_NEUE_REZEPTABTEILUNG_BUTTON + rezeptAbteilungPanel.ID);
                rezeptAbteilungPanel.Controls.Remove(neueZutatButton);
                rezeptAbteilungPanel.Controls.Remove(neueRezeptAbteilungButton);
                rezeptAbteilungPanel.Controls.Remove(neueZutatButtonLit);

                //Neue Zutatenliste Eingaben einfügen inkl. leeren Eintrag
                this.DisplayNeueZutatenListeEingaben(rezeptAbteilungPanel, zutatenAnzahl-1);
                this.DisplayNeueZutatButton(rezeptAbteilungPanel);
                rezeptAbteilungPanel.Controls.Add(new Literal { Text = "&nbsp;" });
                DisplayNeueRezeptabteilungButton(rezeptAbteilungPanel);
            }
            else
            {
                for (int i = 0; i < zutatenAnzahl; i++)
                {
                    //Neue Zutatenliste Eingaben einfügen inkl. leeren Eintrag
                    this.DisplayNeueZutatenListeEingaben(rezeptAbteilungPanel, i);

                    //Der leeren Eintrag erhält den neue Zutat Button und den neuen Rezeptabteilung Button
                    if (i == zutatenAnzahl - 1)
                    {
                        this.DisplayNeueZutatButton(rezeptAbteilungPanel);
                        rezeptAbteilungPanel.Controls.Add(new Literal { Text = "&nbsp;", ID = "Lit " + Helper.REZEPBEARBEITEN_IDENT_NEUE_REZEPTABTEILUNG_BUTTON + rezeptAbteilungPanel.ID });
                        DisplayNeueRezeptabteilungButton(rezeptAbteilungPanel);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        protected void Cerca()
        {
            string idDocProt       = string.Empty;
            int    idProfile       = 0;
            bool   numeroRisultati = true;

            DocsPaWR.InfoDocumento[] ListaDoc = null;
            string inArchivio = "-1";

            DocsPaWR.DocumentoStatoFinale[] docs = null;
            string IdAmm = AmmUtils.UtilsXml.GetAmmDataSession((string)Session["AMMDATASET"], "3");

            switch (rblTipo.SelectedValue.ToString())
            {
            case "P":

                idDocProt = tbx_numProto.Text;

                docs = this.GetDocumentiStatoFinale(idDocProt, tbx_anno.Text, ddl_registri.SelectedValue, string.Empty, IdAmm, true);
                bindGridview(docs);
                break;

            case "NP":
                idDocProt = tbxDoc.Text;
                //da verificare,perchè non ho il ruolo utente (amm)----dimitri
                docs = this.GetDocumentiStatoFinale(idDocProt, string.Empty, string.Empty, string.Empty, IdAmm, false);
                bindGridview(docs);
                break;


            case "Tipologia":
                DropDownList ddl       = (DropDownList)panel_Contenuto.FindControl("ddl_Contatori");
                string       id_Aoo_RF = string.Empty;
                string       idOggetto = string.Empty;

                if (ddl != null && ddl.SelectedValue == "")
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('Attenzione selezionare un contatore')</script>");
                    this.panel_Contenuto.Visible = true;
                    this.pnl_RFAOO.Visible       = false;
                    return;
                }
                else
                if (ddl != null)
                {
                    idOggetto = ddl.SelectedValue;
                }

                if (ddlAooRF != null && ddlAooRF.SelectedIndex > 0)
                {
                    id_Aoo_RF = this.ddlAooRF.SelectedValue;
                }

                if (string.IsNullOrEmpty(txt_anno.Text) || string.IsNullOrEmpty(txt_numero.Text))
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('Il campo Anno e Numero sono obbligatori')</script>");
                    this.panel_Contenuto.Visible = true;
                    this.pnl_RFAOO.Visible       = false;
                }
                else
                {
                    string anno   = txt_anno.Text.Trim();
                    string numero = txt_numero.Text.Trim();

                    string idTemplate = ddl_tipologiaDoc.SelectedValue;
                    bool   sbloccato  = cbSbloccati.Checked;


                    docs = this.GetDocumentiStatoFinalePerTipologia(idOggetto, idTemplate, id_Aoo_RF, anno, numero, sbloccato, IdAmm);
                    bindGridview(docs);
                }
                break;
            }
        }
        public static void SaveProperty(
            SiteUser siteUser,
            Panel parentControl,
            mojoProfilePropertyDefinition propertyDefinition,
            Double legacyTimeZoneOffset,
            TimeZoneInfo timeZone)
        {
            String controlID;
            Control control;

            if (propertyDefinition.ISettingControlSrc.Length > 0)
            {
                controlID = "isc" + propertyDefinition.Name;
                control = parentControl.FindControl(controlID);
                if (control != null)
                {
                    siteUser.SetProperty(
                        propertyDefinition.Name,
                        ((ISettingControl)control).GetValue(),
                        propertyDefinition.SerializeAs,
                        propertyDefinition.LazyLoad);
                }

            }
            else
            {

                switch (propertyDefinition.Type)
                {
                    case "System.Boolean":

                        controlID = "chk" + propertyDefinition.Name;
                        control = parentControl.FindControl(controlID);
                        if (control != null)
                        {
                            siteUser.SetProperty(
                                propertyDefinition.Name,
                                ((CheckBox)control).Checked,
                                propertyDefinition.SerializeAs,
                                propertyDefinition.LazyLoad);

                        }

                        break;

                    case "System.DateTime":

                        controlID = "dp" + propertyDefinition.Name;
                        control = parentControl.FindControl(controlID);
                        if (control != null)
                        {
                            DatePickerControl dp = (DatePickerControl)control;
                            if (dp.Text.Length > 0)
                            {
                                DateTime dt;
                                if (DateTime.TryParse(
                                    dp.Text,
                                    CultureInfo.CurrentCulture,
                                    DateTimeStyles.AdjustToUniversal, out dt))
                                {

                                    if (propertyDefinition.IncludeTimeForDate)
                                    {
                                        if (timeZone != null)
                                        {
                                            dt = dt.ToUtc(timeZone);
                                        }
                                        else
                                        {
                                            dt = dt.AddHours(-legacyTimeZoneOffset);
                                        }

                                        if (propertyDefinition.Name == "DateOfBirth")
                                        {
                                            siteUser.DateOfBirth = dt.Date;
                                            siteUser.Save();
                                        }
                                        else
                                        {
                                            siteUser.SetProperty(
                                                propertyDefinition.Name,
                                                dt.ToString(),
                                                propertyDefinition.SerializeAs,
                                                propertyDefinition.LazyLoad);
                                        }
                                    }
                                    else
                                    {

                                        if(propertyDefinition.Name == "DateOfBirth")
                                        {
                                            siteUser.DateOfBirth = dt.Date;
                                            siteUser.Save();
                                        }
                                        else
                                        {
                                            siteUser.SetProperty(
                                            propertyDefinition.Name,
                                            dt.Date.ToShortDateString(),
                                            propertyDefinition.SerializeAs,
                                            propertyDefinition.LazyLoad);
                                        }

                                    }

                                }
                                else
                                {

                                        siteUser.SetProperty(
                                        propertyDefinition.Name,
                                        dp.Text,
                                        propertyDefinition.SerializeAs,
                                        propertyDefinition.LazyLoad);

                                }

                            }
                            else // blank
                            {
                                if (propertyDefinition.Name == "DateOfBirth")
                                {
                                    siteUser.DateOfBirth = DateTime.MinValue;
                                    siteUser.Save();
                                }
                                else
                                {
                                    siteUser.SetProperty(
                                        propertyDefinition.Name,
                                        String.Empty,
                                        propertyDefinition.SerializeAs,
                                        propertyDefinition.LazyLoad);
                                }
                            }
                        }

                        break;

                    case "System.String":
                    default:

                        if (propertyDefinition.OptionList.Count > 0)
                        {
                            if (propertyDefinition.Type == "CheckboxList")
                            {
                                controlID = "cbl" + propertyDefinition.Name;
                                control = parentControl.FindControl(controlID);
                                if (control != null)
                                {
                                    if (control is CheckBoxList)
                                    {
                                        CheckBoxList cbl = (CheckBoxList)control;

                                        siteUser.SetProperty(
                                            propertyDefinition.Name,
                                            cbl.Items.SelectedItemsToCommaSeparatedString(),
                                            propertyDefinition.SerializeAs,
                                            propertyDefinition.LazyLoad);

                                    }
                                }

                            }
                            else
                            {

                                controlID = "dd" + propertyDefinition.Name;
                                control = parentControl.FindControl(controlID);
                                if (control != null)
                                {
                                    if (control is DropDownList)
                                    {
                                        DropDownList dd = (DropDownList)control;
                                        if (dd.SelectedIndex > -1)
                                        {
                                            siteUser.SetProperty(
                                                propertyDefinition.Name,
                                                dd.SelectedValue,
                                                propertyDefinition.SerializeAs,
                                                propertyDefinition.LazyLoad);
                                        }
                                    }
                                }
                            }

                        }
                        else
                        {
                            controlID = "txt" + propertyDefinition.Name;
                            control = parentControl.FindControl(controlID);
                            if (control != null)
                            {
                                siteUser.SetProperty(
                                    propertyDefinition.Name,
                                    ((TextBox)control).Text,
                                    propertyDefinition.SerializeAs,
                                    propertyDefinition.LazyLoad);
                            }

                        }

                        break;

                }
            }
        }
        public static void LoadState(
            Panel parentControl,
            mojoProfilePropertyDefinition propertyDefinition)
        {
            String controlID;
            Control control;

            switch (propertyDefinition.Type)
            {
                case "System.Boolean":

                    controlID = "chk" + propertyDefinition.Name;
                    control = parentControl.FindControl(controlID);
                    if (control != null)
                    {
                        propertyDefinition.StateValue = ((CheckBox)control).Checked.ToString();

                    }

                    break;

                case "System.DateTime":

                    controlID = "dp" + propertyDefinition.Name;
                    control = parentControl.FindControl(controlID);
                    if (control != null)
                    {
                        DatePickerControl dp = (DatePickerControl)control;
                        if (dp.Text.Length > 0)
                        {
                            propertyDefinition.StateValue = dp.Text;

                        }
                    }

                    break;

                case "System.String":
                default:

                    if (propertyDefinition.OptionList.Count > 0)
                    {
                        if (propertyDefinition.Type == "CheckboxList")
                        {
                            controlID = "cbl" + propertyDefinition.Name;
                            control = parentControl.FindControl(controlID);
                            if (control != null)
                            {
                                if (control is CheckBoxList)
                                {
                                    CheckBoxList cbl = (CheckBoxList)control;
                                    propertyDefinition.StateValue = cbl.Items.SelectedItemsToCommaSeparatedString();

                                }
                            }

                        }
                        else
                        {
                            controlID = "dd" + propertyDefinition.Name;
                            control = parentControl.FindControl(controlID);
                            if (control != null)
                            {
                                if (control is DropDownList)
                                {
                                    DropDownList dd = (DropDownList)control;
                                    if (dd.SelectedIndex > -1)
                                    {
                                        propertyDefinition.StateValue = dd.SelectedValue;

                                    }
                                }
                            }
                        }

                    }
                    else
                    {
                        controlID = "txt" + propertyDefinition.Name;
                        control = parentControl.FindControl(controlID);
                        if (control != null)
                        {
                            propertyDefinition.StateValue = ((TextBox)control).Text;

                        }

                    }

                    break;

            }
        }
Ejemplo n.º 6
0
        private String getCbxResult(Panel pnlID, String cbxID)
        {
            CheckBox tempCbx = pnlID.FindControl(cbxID) as CheckBox;

            if (tempCbx != null)
            {
                return tempCbx.Checked.ToString();
            }
            else
            {
                return null;
            }
        }
Ejemplo n.º 7
0
        private TextBox getTbx(Panel pnlID, string tbxID)
        {
            //            throw new NotImplementedException();

            TextBox tempTbx = pnlID.FindControl(tbxID) as TextBox;

            if (tempTbx != null)
            {
                return tempTbx;
            }
            else
            {
                return null;
            }
        }
Ejemplo n.º 8
0
        public static void SetDataToControlsOnPanel(Panel oPanel, DataTable oDT, int eFormID)
        {
            foreach (System.Web.UI.Control oControl in oPanel.Controls)
            {
                for (int n = 0; n <= oDT.Columns.Count - 1; n++)
                {
                    string ColumnName = oDT.Columns[n].ColumnName;
                    Control oWControl = oPanel.FindControl("txtEform" + ColumnName) as Control;
                    if (oWControl != null)
                    {
                        TextBox oText = oWControl as TextBox;
                        oText.Text = oDT.Rows[0][ColumnName].ToString();
                    }
                    Control oOtherControl = oPanel.FindControl(ColumnName) as Control;
                    if (oOtherControl != null)
                    {

                        if (oOtherControl is TextBox)
                        {
                            TextBox oText = oOtherControl as TextBox;
                            oText.Text = oDT.Rows[0][ColumnName].ToString();
                        }
                        else if (oOtherControl is DropDownList)
                        {
                            DropDownList oDDL = oOtherControl as DropDownList;
                            oDDL.SelectedValue = oDT.Rows[0][ColumnName].ToString();
                        }
                        else if (oOtherControl is CheckBox)
                        {
                            CheckBox oChk = oOtherControl as CheckBox;
                            if (oDT.Rows[0][ColumnName].ToString() != string.Empty)
                            {
                                if (Convert.ToBoolean(oDT.Rows[0][ColumnName]) == false)
                                {
                                    oChk.Checked = false;
                                }
                                else
                                {
                                    oChk.Checked = true;
                                }
                            }
                        }
                        else if (oOtherControl is UserControl)
                        {

                            if (oDT.Rows[0][ColumnName] != null)
                            {

                                if (oDT.Rows[0][ColumnName].ToString() != string.Empty)
                                {
                                    if (HttpContext.Current.Session[ImageList] == null)
                                    {
                                        Hashtable oImageValue = new Hashtable();
                                        oImageValue.Add(oOtherControl.ClientID, oDT.Rows[0][ColumnName].ToString());
                                        HttpContext.Current.Session[ImageList] = oImageValue;
                                        HttpContext.Current.Session[FormDesign.SessionImageList] = oImageValue;
                                        ucImageControl oImage = oOtherControl as ucImageControl;

                                        oImage.SetImagePath();

                                    }
                                    else
                                    {
                                        if (oDT.Rows[0][ColumnName] != null)
                                        {
                                            Hashtable oImageValue = HttpContext.Current.Session[ImageList] as Hashtable;
                                            if (!oImageValue.ContainsKey(oOtherControl.ClientID))
                                            {

                                                oImageValue.Add(oOtherControl.ClientID, oDT.Rows[0][ColumnName].ToString());
                                                HttpContext.Current.Session[ImageList] = oImageValue;
                                                HttpContext.Current.Session[FormDesign.SessionImageList] = oImageValue;
                                                ucImageControl oImage = oOtherControl as ucImageControl;
                                                oImage.SetImagePath();

                                            }

                                        }

                                    }

                                }

                            }

                        }

                    }
                }

            }
        }
Ejemplo n.º 9
0
        private TextBox getTbx(Panel pnlID, string tbxID)
        {
            //            throw new NotImplementedException();
            System.Diagnostics.Debug.WriteLine(">> In getTbx(" + pnlID.ID + ", " + tbxID + ")");

            TextBox tempTbx = pnlID.FindControl(tbxID) as TextBox;

            if (tempTbx != null)
            {
                return tempTbx;
            }
            else
            {
                return null;
            }
        }
Ejemplo n.º 10
0
        private void processBtnUpdateCbxs(Panel pnlID, string numOfCbxsTbxID, String cbxPrefix, string outTbxID)
        {
            System.Diagnostics.Debug.WriteLine(">> In processBtnUpdateCbxs(..)");

            int numOfCbxs, i;
            String myStringVariable = string.Empty;
            TextBox numOfCbxsTbx = getTbx(pnlID, numOfCbxsTbxID);
            TextBox outTbx = getTbx(pnlID, outTbxID);
            CheckBox cbx;

            if (numOfCbxsTbx != null && outTbx != null)
            {
                numOfCbxs = getIntFrom(pnlID, numOfCbxsTbxID);

                if (numOfCbxs > 0)
                {
                    outTbx.Text = "";

                    for (i = 1; i <= numOfCbxs; i++)
                    {
                        cbx = pnlID.FindControl(cbxPrefix + i.ToString()) as CheckBox;

                        if (cbx != null)
                        {
                            outTbx.Text += ", " + cbx.ID + "=" + cbx.Checked.ToString();
                        }
                    }
                }
            }
            else
            {
                if (numOfCbxsTbx == null)
                    myStringVariable = numOfCbxsTbxID;

                if (outTbx == null)
                    myStringVariable = myStringVariable + " " + outTbxID ;

                myStringVariable = myStringVariable + " cannot be found";

//                ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable + "');", true);
                doAlert(myStringVariable);
            }
        }
Ejemplo n.º 11
0
        private int getIntFrom(Panel pnlID, string tbxID)
        {
//            throw new NotImplementedException();
            System.Diagnostics.Debug.WriteLine(">> In getIntFrom(" + pnlID.ID + ", " + tbxID + ")");

            TextBox tempTbx = pnlID.FindControl(tbxID) as TextBox;

            if (tempTbx != null)
            {
                int result;

                if (int.TryParse(tempTbx.Text, out result))
                {
                    return result;
                }
                else
                {
                    return 0;
                }
            }
            else
            {
                return 0;
            }
        }
Ejemplo n.º 12
0
    public void SetLanguage(string code)
    {
        for (int i = 0; i < pForm.Controls.Count; i++)
        {
            if ((pForm.Controls[i].GetType() == typeof(System.Web.UI.WebControls.Label)) && pForm.Controls[i].ID.StartsWith("lt\uFFFD"))
            {
                ((System.Web.UI.WebControls.Label)pForm.Controls[i]).Text = ((Language)Session["language"]).Words[System.Convert.ToInt32(pForm.Controls[i].ID.Replace("lt\uFFFD", "\uFFFD"))].ToString();
            }
        }
        lAttach.Text      = "<img src=\"icons/attach_off.gif\" style=\"width:16px;height:16px;\" align=\"absmiddle\" alt=\"\" name=\"attach\" />&nbsp;&nbsp;\uFFFD" + ((Language)Session["language"]).Words[27].ToString();
        lInsertImage.Text = "<img src=\"icons/pictures_off.gif\" style=\"width:16px;height:16px;\" align=\"absmiddle\" alt=\"\" name=\"pictures\" />&nbsp;&nbsp;\uFFFD" + ((Language)Session["language"]).Words[66].ToString();
        lCompose.Text     = ((Language)Session["language\uFFFD"]).Words[33].ToString();
        System.Web.UI.HtmlControls.HtmlInputButton bb = (System.Web.UI.HtmlControls.HtmlInputButton)pForm.FindControl("iSubmit");

        // TODO: Review it
        //((System.Web.UI.HtmlControls.HtmlInputButton)pForm.FindControl("iSubmit")).Value = ((Language)Session["language"]).Words[26].ToString();
        //((System.Web.UI.HtmlControls.HtmlInputButton)pForm.FindControl("iSave")).Value = ((Language)Session["language"]).Words[16].ToString();
    }
Ejemplo n.º 13
0
 /// <summary>
 /// Determina la visualización de las opciones disponibles para el usuario
 /// </summary>
 /// <param name="uid">Identificacion del usuario</param>
 /// <param name="controlPanel">Panel donde se ubican los controles a determinar su presentacion</param>
 public static void SeguridadInspeccion(Object uid, Panel controlPanel)
 {
     if (uid != null)
       {
     int uidValue = int.Parse((string)uid);
     if (uidValue == 1)
     {
       ((ImageButton)controlPanel.FindControl("anularImageButton")).Visible = false;
       ((ImageButton)controlPanel.FindControl("aprobarImageButton")).Visible = false;
       ((ImageButton)controlPanel.FindControl("desaprobarImageButton")).Visible = false;
       ((ImageButton)controlPanel.FindControl("terminarImageButton")).Visible = true;
     }
     else if (uidValue == 2)
     {
       controlPanel.Visible = false;
     }
       }
 }
        protected bool CheckEmptySearch(Panel panel)
        {
            bool searchOnCommission = true;
            bool searchOnPremiere = true;//string.IsNullOrEmpty(premiereControl.SelectedValue.Trim());

            var commissionControl = (DropDownList)panel.FindControl("WorkCommissions");
            if (commissionControl != null) searchOnCommission = string.IsNullOrEmpty(commissionControl.SelectedValue.Trim());

            var premiereControl = (DropDownList)panel.FindControl("WorkPremiere");
            if (premiereControl != null) searchOnPremiere = string.IsNullOrEmpty(premiereControl.SelectedValue.Trim());

            return panel.Controls.OfType<TextBox>().All(input => String.IsNullOrEmpty(input.Text.Trim())) && searchOnCommission && searchOnPremiere;
        }
Ejemplo n.º 15
0
        private void LoadSettings()
        {
            AddClassToBody("registerpage");

            siteAvailableSubscriptions = NewsletterHelper.GetAvailableNewslettersForSiteMembers(siteSettings.SiteGuid);

            IncludeDescriptionInList = displaySettings.IncludeNewsletterDescriptionInList;
            pnlSubscribe = (Panel)CreateUserWizardStep1.ContentTemplateContainer.FindControl("pnlSubscribe");
            if (pnlSubscribe != null)
            {
                pnlSubscribe.Visible = displaySettings.ShowNewsLetters;

                clNewsletters = (CheckBoxList)pnlSubscribe.FindControl("clNewsletters");
                rbHtmlFormat = (RadioButton)pnlSubscribe.FindControl("rbHtmlFormat");
                rbPlainText = (RadioButton)pnlSubscribe.FindControl("rbPlainText");

                rbHtmlFormat.Text = Resource.NewsletterHtmlFormatLabel;
                rbPlainText.Text = Resource.NewsletterPlainTextFormatLabel;
                Label lblNewsletterListHeading = (Label)pnlSubscribe.FindControl("lblNewsletterListHeading");
                lblNewsletterListHeading.Text = displaySettings.NewsletterListHeading.Coalesce(Resource.NewsletterPreferencesHeader);
                // fix bug https://www.mojoportal.com/Forums/Thread.aspx?pageid=5&t=11390~1#post47409
                if((IsPostBack)&&(clNewsletters.Items.Count == 0)) { pnlSubscribe.Visible = false;}
            }

            if (WebConfigSettings.AllowUserProfilePage)
            {
                string destinationUrl = WebConfigSettings.PageToRedirectToAfterRegistration;
                if (destinationUrl.Length == 0) { destinationUrl = "/Secure/UserProfile.aspx"; }

                this.RegisterUser.FinishDestinationPageUrl
                    = SiteRoot + destinationUrl;

                this.RegisterUser.ContinueDestinationPageUrl
                    = SiteRoot + destinationUrl;

                this.RegisterUser.EditProfileUrl = SiteRoot + "/Secure/UserProfile.aspx";
            }
            else
            {
                this.RegisterUser.FinishDestinationPageUrl = SiteRoot ;

                this.RegisterUser.ContinueDestinationPageUrl = SiteRoot;

                this.RegisterUser.EditProfileUrl = SiteRoot;

            }

            rpxApiKey = siteSettings.RpxNowApiKey;
            rpxApplicationName = siteSettings.RpxNowApplicationName;

            if (WebConfigSettings.UseOpenIdRpxSettingsFromWebConfig)
            {
                if (WebConfigSettings.OpenIdRpxApiKey.Length > 0)
                {
                    rpxApiKey = WebConfigSettings.OpenIdRpxApiKey;
                }

                if (WebConfigSettings.OpenIdRpxApplicationName.Length > 0)
                {
                    rpxApplicationName = WebConfigSettings.OpenIdRpxApplicationName;
                }

            }

            //string returnUrlParam = Page.Request.Params.Get("returnurl");
            //if (!String.IsNullOrEmpty(returnUrlParam))
            //{
            //    string redirectUrl = Page.ResolveUrl(Page.Server.UrlDecode(returnUrlParam));
            //    this.RegisterUser.FinishDestinationPageUrl = redirectUrl;
            //    this.RegisterUser.ContinueDestinationPageUrl = redirectUrl;

            //}

            if (ViewState["returnurl"] != null)
            {
                this.RegisterUser.ContinueDestinationPageUrl = ViewState["returnurl"].ToString();
            }

            // only allow return urls that are relative or start with the site root
            //http://www.mojoportal.com/Forums/Thread.aspx?thread=5314&mid=34&pageid=5&ItemID=2&pagenumber=1#post22121

            if (Request.Params.Get("returnurl") != null)
            {
                //string returnUrlParam = Page.Request.Params.Get("returnurl");
                //if (!String.IsNullOrEmpty(returnUrlParam))
                //{
                    //returnUrlParam = SecurityHelper.RemoveMarkup(returnUrlParam);
                string redirectUrl = SiteUtils.GetReturnUrlParam(Page, SiteRoot);
                    //string redirectUrl = Page.ResolveUrl(SecurityHelper.RemoveMarkup(Page.Server.UrlDecode(returnUrlParam)));
                    //if (redirectUrl.StartsWith("/")) { redirectUrl = SiteRoot + redirectUrl; }

                    //if (
                    //    (redirectUrl.StartsWith(SiteRoot))
                    //    || (redirectUrl.StartsWith(SiteRoot.Replace("https://", "http://")))
                    //    )
                    //{
                if (redirectUrl.Length > 0)
                {
                    this.RegisterUser.ContinueDestinationPageUrl = redirectUrl;
                }
                    //}
               // }

            }

            timeOffset = SiteUtils.GetUserTimeOffset();
            timeZone = SiteUtils.GetUserTimeZone();

            if (WebConfigSettings.ShowCustomProfilePropertiesAboveManadotoryRegistrationFields)
            {
                pnlProfile = (Panel)CreateUserWizardStep1.ContentTemplateContainer.FindControl("pnlRequiredProfilePropertiesUpper");
            }
            else
            {
                pnlProfile = (Panel)CreateUserWizardStep1.ContentTemplateContainer.FindControl("pnlRequiredProfileProperties");
            }

            chkAgree = (CheckBox)CreateUserWizardStep1.ContentTemplateContainer.FindControl("chkAgree");

            showRpx = ((!WebConfigSettings.DisableRpxAuthentication) && (rpxApiKey.Length > 0));

            showOpenId = (
                (WebConfigSettings.EnableOpenIdAuthentication && siteSettings.AllowOpenIdAuth)

                );

            string wlAppId = siteSettings.WindowsLiveAppId;
            if (ConfigurationManager.AppSettings["GlobalWindowsLiveAppId"] != null)
            {
                wlAppId = ConfigurationManager.AppSettings["GlobalWindowsLiveAppId"];
                if (wlAppId.Length == 0) { wlAppId = siteSettings.WindowsLiveAppId; }
            }

            showWindowsLive
                = WebConfigSettings.EnableWindowsLiveAuthentication
                && siteSettings.AllowWindowsLiveAuth
                && (wlAppId.Length > 0);

            if (IsPostBack)
            {
                showOpenId = false;
                showWindowsLive = false;
                showRpx = false;
            }

            if (showOpenId)
            {
                AddClassToBody("openid");
            }

            if (showWindowsLive)
            {
                AddClassToBody("windowslive");
            }

            if (showRpx)
            {
                AddClassToBody("janrain");
            }

            pnlThirdPartyAuth.Visible = (showOpenId || showWindowsLive || showRpx);
            divLiteralOr.Visible = (showOpenId && showWindowsLive);
            pnlOpenID.Visible = showOpenId;
            pnlWindowsLiveID.Visible = showWindowsLive;
            pnlRpx.Visible = showRpx;

            if (siteSettings.DisableDbAuth) { pnlStandardRegister.Visible = false; }
        }
Ejemplo n.º 16
0
        private String getCbxResult(Panel pnlID, String cbxID)
        {
            System.Diagnostics.Debug.WriteLine(">> In getCbxResult(" + pnlID.ID + ", " + cbxID + ")");

            CheckBox tempCbx = pnlID.FindControl(cbxID) as CheckBox;

            if (tempCbx != null)
            {
                return tempCbx.Checked.ToString();
            }
            else
            {
                return null;
            }
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Set the photo categories
        /// </summary>
        /// <param name="imagePanel">The panel that contains the photo</param>
        /// <returns></returns>
        private async Task SetPhotoCategories(Panel imagePanel)
        {
            Image itemImage = (Image)imagePanel.FindControl("itemImage");
            Image itemLoading = (Image)imagePanel.FindControl("itemWordsLoading");
            Label itemWords = (Label)imagePanel.FindControl("itemWords");

            itemLoading.Visible = false;

            var item = ItemList.Where(i => i.URL.Equals(itemImage.ImageUrl)).FirstOrDefault();

            if (item != null && string.IsNullOrEmpty(item.Words))
            {
                string[] tags = await ComputerVision.GetCategories(item.URL);
                item.Words = StringUtils.ConvertStringArrayToString(tags);
                itemWords.Text = item.Words;
            }

            if (item == null || String.IsNullOrEmpty(item.Words))
            {
                itemWords.Text = "Não foi possível obter as categorias da imagem";
            }
        }
Ejemplo n.º 18
0
 public string GetText(Panel pn)
 {
     string strQueryText = "";
     for (int i = 0; i < this.Columns.Count; i++)
     {
         string text = "";
         //if (pn.FindControl("txt" + i.ToString()) == null)
         //{
         //    return "GetText Error!Can't find control in panel: " + pn.ID;
         //}
         switch (((WebQueryColumns)this.Columns[i]).ColumnType)
         {
             case "ClientQueryTextBoxColumn":
                 text = (pn.FindControl("txt" + i.ToString()) as TextBox).Text;
                 break;
             case "ClientQueryComboBoxColumn":
                 text = (pn.FindControl("txt" + i.ToString()) as WebDropDownList).SelectedValue;
                 break;
             case "ClientQueryRefValColumn":
                 text = (pn.FindControl("txt" + i.ToString()) as WebRefVal).BindingValue;
                 break;
             case "ClientQueryCalendarColumn":
                 text = (pn.FindControl("txt" + i.ToString()) as WebDateTimePicker).Text;
                 break;
         }
         if (text != string.Empty)
         {
             strQueryText += ((WebQueryColumns)this.Columns[i]).Caption
                                + ((WebQueryColumns)this.Columns[i]).Operator
                                + text + "\n";
         }
     }
     return strQueryText;
 }