protected void cmdreset_Click(object sender, EventArgs e)
        {
            RadComboBox cmbcat1 = (RadComboBox)RadPanelBar1.FindItemByValue("info").FindControl("cmbservicio");
            RadComboBox cmbcat2 = (RadComboBox)RadPanelBar1.FindItemByValue("info").FindControl("cmbproducto");
            RadComboBox cmbcat3 = (RadComboBox)RadPanelBar1.FindItemByValue("info").FindControl("cmbcentro");

            RadButton rbt1 = (RadButton)RadPanelBar1.FindItemByValue("info").FindControl("rbtDefault");
            RadButton rbt2 = (RadButton)RadPanelBar1.FindItemByValue("info").FindControl("rbtRevisado");
            RadButton rbt3 = (RadButton)RadPanelBar1.FindItemByValue("info").FindControl("rbtTramite");
            RadButton rbt4 = (RadButton)RadPanelBar1.FindItemByValue("info").FindControl("rbtCancel");
            RadButton rbt5 = (RadButton)RadPanelBar1.FindItemByValue("info").FindControl("rbtaceptadopag");
            RadButton rbt6 = (RadButton)RadPanelBar1.FindItemByValue("info").FindControl("rbtarechazadopag");
            RadButton rbt9 = (RadButton)RadPanelBar1.FindItemByValue("info").FindControl("rbtnBarco");

            RadDatePicker rdp1 = (RadDatePicker)RadPanelBar1.FindItemByValue("info").FindControl("rdpFechaIni");
            RadDatePicker rdp2 = (RadDatePicker)RadPanelBar1.FindItemByValue("info").FindControl("rdpFechaFin");

            RadButton rbt7 = (RadButton)RadPanelBar1.FindItemByValue("info").FindControl("rbtAnio");
            RadButton rbt8 = (RadButton)RadPanelBar1.FindItemByValue("info").FindControl("rbtAniomes");

            cmbcat1.ClearSelection();
            cmbcat2.ClearSelection();
            cmbcat3.ClearSelection();

            rbt1.Checked = false;
            rbt2.Checked = false;
            rbt3.Checked = false;
            rbt4.Checked = false;
            rbt5.Checked = false;
            rbt6.Checked = false;
            rbt7.Checked = false;
            rbt8.Checked = false;
            rbt9.Checked = false;

            rdp1.Clear();
            rdp2.Clear();


        }
        protected void rcbArea_SelectedIndexChanged(object sender, EventArgs e)
        {
            RadComboBox rcbTempArea         = (RadComboBox)sender;
            String      selected            = rcbTempArea.SelectedValue;
            RadComboBox rcbTempCoordinacion = (RadComboBox)rcbTempArea.NamingContainer.FindControl("rcbCoordinacion");
            RadComboBox rcbTempPuesto       = (RadComboBox)rcbTempArea.NamingContainer.FindControl("rcbPuesto");

            rcbTempCoordinacion.ClearSelection();

            this.odsCoordinacion.SelectParameters.Clear();
            this.odsCoordinacion.SelectParameters.Add("area_id", System.Data.DbType.Guid, selected);
            rcbTempCoordinacion.DataBind();

            if (rcbTempArea.Items.Count != 0)
            {
                rcbTempPuesto.ClearSelection();
                this.odsPuesto.SelectParameters.Clear();
                this.odsPuesto.SelectParameters.Add("empresa_id", System.Data.DbType.Guid, Guid.Empty.ToString());
                this.odsPuesto.SelectParameters.Add("gerencia_id", System.Data.DbType.Guid, Guid.Empty.ToString());
                this.odsPuesto.SelectParameters.Add("area_id", System.Data.DbType.Guid, rcbTempArea.SelectedValue);
                rcbTempPuesto.DataBind();
            }
        }
        public static void Search(RadComboBox rcb_search, String SearchExpr, String UserID, bool CompaniesOnly = false, String CustomOnClientClick = "", bool FromLeads = false)
        {
            if (HttpContext.Current.User.Identity.IsAuthenticated)
            {
                rcb_search.Items.Clear();

                // Get and clean search term
                String search_term = SearchExpr;
                search_term = search_term.Replace("+", String.Empty); // for phone number search

                if (search_term == String.Empty)
                {
                    // Add empty separator
                    RadComboBoxItem break_item = new RadComboBoxItem();
                    break_item.IsSeparator = true;
                    break_item.Controls.Add(new System.Web.UI.WebControls.Label()
                    {
                        Text = "Type to search for Companies and Contacts.."
                    });
                    rcb_search.Items.Add(break_item);
                }
                else
                {
                    String radopen = "rwm_master_radopen";
                    if (FromLeads)
                    {
                        radopen = "rwm_radopen";
                    }

                    String qry = "SELECT cpy.CompanyID, cpy.Country, cpy.Industry, CONCAT(cpy.CompanyName,' (',COUNT(ctc.ContactID),')') as 'CompanyName' FROM (SELECT CompanyID, CompanyName, Country, Industry " +
                                 "FROM db_company WHERE ((CONCAT(CompanyName,' ',IFNULL(Country,'')) LIKE @s AND CompanyName IS NOT NULL AND TRIM(CompanyName) != '' AND CompanyNameClean!='unknown') OR (CONCAT(TRIM(IFNULL(PhoneCode,'')),TRIM(REPLACE(Phone,' ',''))) LIKE @s)) " +
                                 "AND Source NOT LIKE 'db_tmp%' LIMIT 10) as cpy LEFT JOIN db_contact ctc ON cpy.CompanyID = ctc.CompanyID GROUP BY cpy.CompanyID ORDER BY cpy.CompanyName, cpy.Country";
                    DataTable dt_companies = SQL.SelectDataTable(qry, "@s", search_term + "%"); //"%" + search_term + "%"

                    qry = "SELECT ContactID, TRIM(CONCAT(CASE WHEN FirstName IS NULL THEN '' ELSE CONCAT(TRIM(FirstName), ' ') END, CASE WHEN NickName IS NULL THEN '' ELSE CONCAT('\"',TRIM(NickName),'\" ') END, CASE WHEN LastName IS NULL THEN '' ELSE TRIM(LastName) END)) as 'contact', " +
                          "CompanyName, JobTitle, DontContactReason, DontContactUntil, DontContactDateSet, DontContactSetByUserID " +
                          "FROM db_contact ctc, db_company cpy WHERE ctc.CompanyID=cpy.CompanyID AND " +
                          "(TRIM(CONCAT(TRIM(FirstName),' ',TRIM(LastName))) LIKE @s OR CONCAT(TRIM(REPLACE(ctc.Phone,' ','')),TRIM(REPLACE(Mobile,' ',''))) LIKE @s OR CONCAT(TRIM(Email)) LIKE @s OR CONCAT(TRIM(PersonalEmail)) LIKE @s) " +
                          "AND Visible=1 ORDER BY FirstName, LastName LIMIT 6";
                    DataTable dt_contacts = SQL.SelectDataTable(qry, "@s", search_term + "%");

                    // Add Company separator
                    if (dt_companies.Rows.Count > 0)
                    {
                        RadComboBoxItem break_item = new RadComboBoxItem();
                        break_item.IsSeparator = true;
                        System.Web.UI.WebControls.Label lbl_cpy = new System.Web.UI.WebControls.Label();
                        lbl_cpy.Text      = "Companies";
                        lbl_cpy.Font.Bold = true;
                        break_item.Controls.Add(lbl_cpy);
                        System.Web.UI.WebControls.Label lbl_cpy_info = new System.Web.UI.WebControls.Label();
                        lbl_cpy_info.Text      = "Hover over a company name to see industry";
                        lbl_cpy_info.Font.Size = 8;
                        lbl_cpy_info.Attributes.Add("style", "position:absolute; right:0; margin-right:4px;");
                        break_item.Controls.Add(lbl_cpy_info);
                        rcb_search.Items.Add(break_item);
                    }

                    for (int i = 0; i < dt_companies.Rows.Count; i++)
                    {
                        String cpy_id  = dt_companies.Rows[i]["CompanyID"].ToString();
                        String country = dt_companies.Rows[i]["Country"].ToString();
                        if (country == String.Empty)
                        {
                            country = "?";
                        }
                        country = "&nbsp;" + country;

                        HtmlGenericControl ul = new HtmlGenericControl("ul");
                        HtmlGenericControl li = new HtmlGenericControl("li");
                        ul.Controls.Add(li);
                        li.Attributes.Add("class", "CompanyBullet");

                        RadComboBoxItem cpy_item = new RadComboBoxItem();
                        cpy_item.ToolTip = dt_companies.Rows[i]["industry"].ToString();
                        cpy_item.Style.Add("cursor", "pointer");
                        LinkButton lb_cpy = new LinkButton();
                        lb_cpy.Text = Util.TruncateText(dt_companies.Rows[i]["CompanyName"].ToString(), 40);
                        System.Web.UI.WebControls.Label lbl_cpy_country = new System.Web.UI.WebControls.Label();
                        lbl_cpy_country.Text = country;

                        if (CustomOnClientClick == String.Empty)
                        {
                            cpy_item.Attributes.Add("onclick", "$find('" + rcb_search.ClientID + "').hideDropDown(); var rw=" + radopen + "('/dashboard/leads/viewcompanyandcontact.aspx?cpy_id="
                                                    + HttpContext.Current.Server.UrlEncode(cpy_id) + "', 'rw_view_cpy_ctc'); rw.autoSize(); rw.center(); return false;");
                        }
                        else
                        {
                            String ThisCustomOnClientClick = CustomOnClientClick.Replace("[cpy_id]", cpy_id) + " return false;";
                            cpy_item.Attributes.Add("onclick", ThisCustomOnClientClick);
                        }

                        li.Controls.Add(lb_cpy);
                        li.Controls.Add(lbl_cpy_country);
                        cpy_item.Controls.Add(ul);
                        rcb_search.Items.Add(cpy_item);
                    }

                    // Add Contact separator
                    if (!CompaniesOnly)
                    {
                        if (dt_contacts.Rows.Count > 0)
                        {
                            RadComboBoxItem break_item = new RadComboBoxItem();
                            break_item.IsSeparator = true;
                            System.Web.UI.WebControls.Label lbl_ctc = new System.Web.UI.WebControls.Label();
                            lbl_ctc.Text      = "Contacts";
                            lbl_ctc.Font.Bold = true;
                            break_item.Controls.Add(lbl_ctc);
                            System.Web.UI.WebControls.Label lbl_ctc_info = new System.Web.UI.WebControls.Label();
                            lbl_ctc_info.Text      = "Hover over a name to see job title";
                            lbl_ctc_info.Font.Size = 8;
                            lbl_ctc_info.Attributes.Add("style", "position:absolute; right:0; margin-right:4px;");
                            break_item.Controls.Add(lbl_ctc_info);
                            rcb_search.Items.Add(break_item);
                        }

                        qry = "SELECT LeadID FROM dbl_lead WHERE Active=1 AND ContactID=@ctc_id AND (ProjectID IN (SELECT ProjectID FROM dbl_project WHERE UserID=@user_id) OR ProjectID IN (SELECT ProjectID FROM dbl_project_share WHERE UserID=@user_id)) ORDER BY DateUpdated DESC LIMIT 1";
                        for (int i = 0; i < dt_contacts.Rows.Count; i++)
                        {
                            String             ctc_id = dt_contacts.Rows[i]["ContactID"].ToString();
                            HtmlGenericControl ul     = new HtmlGenericControl("ul");
                            HtmlGenericControl li     = new HtmlGenericControl("li");
                            ul.Controls.Add(li);
                            li.Attributes.Add("class", "CompanyBullet");

                            RadComboBoxItem ctc_item = new RadComboBoxItem();
                            ctc_item.Style.Add("cursor", "pointer");
                            LinkButton lb_ctc = new LinkButton();
                            lb_ctc.Text      = Util.TruncateText(dt_contacts.Rows[i]["contact"].ToString(), 25) + " @ <b>" + Util.TruncateText(dt_contacts.Rows[i]["CompanyName"].ToString(), 30) + "</b>";
                            ctc_item.ToolTip = dt_contacts.Rows[i]["JobTitle"].ToString();

                            lb_ctc.Attributes.Add("onclick", "$find('" + rcb_search.ClientID + "').hideDropDown(); var rw = " + radopen + "('/dashboard/leads/viewcompanyandcontact.aspx?ctc_id="
                                                  + HttpContext.Current.Server.UrlEncode(ctc_id) + "', 'rw_view_cpy_ctc'); rw.autoSize(); rw.center(); return false;");

                            CheckAndSetDoNotContact(dt_contacts.Rows[i], ctc_item, lb_ctc, null, null);

                            // Check to see if this contact is in this user's Leads list
                            DataTable dt_lead = SQL.SelectDataTable(qry,
                                                                    new String[] { "@ctc_id", "@user_id" },
                                                                    new Object[] { ctc_id, UserID });

                            ImageButton imbtn_view_overview = null;
                            ImageButton imbtn_view_project  = null;
                            if (dt_lead.Rows.Count > 0)
                            {
                                String lead_id = dt_lead.Rows[0]["LeadID"].ToString();
                                imbtn_view_overview          = new ImageButton();
                                imbtn_view_overview.ImageUrl = "~/images/leads/ico_details.png";
                                imbtn_view_overview.ToolTip  = "View Lead overview";
                                imbtn_view_overview.Attributes.Add("style", "margin-right:4px;");
                                imbtn_view_overview.OnClientClick = "$find('" + rcb_search.ClientID + "').hideDropDown(); " + radopen + "('/dashboard/leads/leadoverview.aspx?lead_id=" + HttpContext.Current.Server.UrlEncode(lead_id) + "', 'rw_lead_overview'); return false;";

                                imbtn_view_project               = new ImageButton();
                                imbtn_view_project.ID            = "imbtn_view_" + ctc_id;
                                imbtn_view_project.ImageUrl      = "~/images/leads/ico_go_to.png";
                                imbtn_view_project.ToolTip       = "Go to Lead in my Project";
                                imbtn_view_project.CommandName   = lead_id;
                                imbtn_view_project.OnClientClick = "$find('" + rcb_search.ClientID + "').hideDropDown(); SetViewLeadID(" + lead_id + "); return false;";
                            }

                            li.Controls.Add(lb_ctc);
                            if (dt_lead.Rows.Count > 0)
                            {
                                Panel p = new Panel();
                                p.CssClass = "ViewLeadOptions";
                                p.Controls.Add(imbtn_view_overview);
                                p.Controls.Add(imbtn_view_project);
                                li.Controls.Add(p);
                            }

                            ctc_item.Controls.Add(ul);
                            rcb_search.Items.Add(ctc_item);
                        }
                    }
                }
                rcb_search.ClearSelection();
                rcb_search.DataBind();
            }
        }
 private void BindStateCombo(RadComboBox sender, int contryId)
 {
     objBindCombo = new BindCombo();
     sender.Items.Clear();
     sender.ClearSelection();
     sender.DataTextField = "STATE_NAME";
     sender.DataValueField = "STATE_ID";
     sender.DataSource = objBindCombo.GetStateKeyValue(contryId);
     sender.DataBind();
     sender.Items.Insert(0, new RadComboBoxItem("", "0"));
     sender.SelectedValue = "0";
 }
 private void BindCountryCombo(RadComboBox sender)
 {
     objBindCombo = new BindCombo();
     sender.Items.Clear();
     sender.ClearSelection();
     sender.DataTextField = "COUNTRY_NAME";
     sender.DataValueField = "COUNTRY_ID";
     sender.DataSource = objBindCombo.GetCountryKeyValue();
     sender.DataBind();
     sender.Items.Insert(0, new RadComboBoxItem("", "0"));
     sender.SelectedValue = "0";
 }
Exemple #6
0
 public static void SeleccionarItemCombo(ref RadComboBox combo, string valor, string texto)
 {
     combo.ClearSelection();
     if ((combo.Items.FindItemByValue(valor) == null))
         combo.Items.Insert(0, new RadComboBoxItem(texto, valor));
     combo.Items.FindItemByValue(valor).Selected = true;
 }
 private void BindEmployeeCombo(RadComboBox sender)
 {
     objUserMasterDAL = new UserMasterDal();
     sender.Items.Clear();
     sender.ClearSelection();
     sender.DataTextField = "EMP_NAME";
     sender.DataValueField = "EMP_ID";
     sender.DataSource = objUserMasterDAL.GetEmployeeKeyValue();
     sender.DataBind();
     sender.Items.Insert(0, new RadComboBoxItem("", "0"));
     sender.SelectedValue = "0";
 }
 private void BindSecurityQuestionCombo(RadComboBox sender)
 {
     objUserMasterDAL = new UserMasterDal();
     sender.Items.Clear();
     sender.ClearSelection();
     sender.DataTextField = "SECURITY_QUESTION_DESC";
     sender.DataValueField = "SECURITY_QUESTION_ID";
     sender.DataSource = objUserMasterDAL.GetSecurityQuestion();
     sender.DataBind();
     sender.Items.Insert(0, new RadComboBoxItem("--Select--", "0"));
     sender.SelectedValue = "0";
 }
		private void bindCountryCombo(RadComboBox sender, DataSet source)
		{
			objBindCombo = new BindCombo();
			sender.Items.Clear();
			sender.ClearSelection();
			sender.DataTextField = "COUNTRY_NAME";
			sender.DataValueField = "COUNTRY_ID";
			if (source != null)
				sender.DataSource = source;
			else
				sender.DataSource = objBindCombo.GetAirLine();
			sender.DataBind();
			sender.Items.Insert(0, new RadComboBoxItem("", "0"));
			sender.SelectedValue = "0";
		}
		//#region btnDeleteAirport_Click
		//protected void btnDeleteAirport_Click(object sender, EventArgs e)
		//{


		//    try
		//    {
		//        int serialNo = 0;
		//        ImageButton imgbtnDetailDelete = (ImageButton)sender;
		//        if (imgbtnDetailDelete != null)
		//            Int32.TryParse(imgbtnDetailDelete.CommandArgument, out serialNo);

		//        objAirlineMapDal = new AirlineMapDal();

		//        int result = objAirlineMapDal.DeleteAirportBySrNo(serialNo);
		//        if (result == 1)
		//        {
		//            Master.DisplayMessage(ConfigurationSettings.AppSettings[SuccessMessage.Delete].ToString());
		//            Master.MessageCssClass = "successMessage";
		//            BindAirportGrid();
		//        }
		//        else if (result == 547)
		//        {
		//            Master.DisplayMessage(ConfigurationSettings.AppSettings[FailureMessage.Delete].ToString());
		//            Master.MessageCssClass = "errorMessage";
		//        }
		//        else
		//        {
		//            Master.DisplayMessage(ConfigurationSettings.AppSettings[FailureMessage.Delete].ToString());
		//            Master.MessageCssClass = "errorMessage";
		//        }
		//    }
		//    catch (Exception ex)
		//    {
		//        bool rethrow = ExceptionPolicy.HandleException(ex, DALHelper.DAL_EXP_POLICYNAME);
		//        if (rethrow)
		//        { throw ex; }
		//    }
		//}
		//#endregion


		#endregion

		#region Method

		private void BindRegionCombo(RadComboBox sender, DataSet source)
		{
			objBindCombo = new BindCombo();
			sender.Items.Clear();
			sender.ClearSelection();
			sender.DataTextField = "REGION_LONG_NAME";
			sender.DataValueField = "REGION_ID";
			if (source != null)
				sender.DataSource = source;
			else
				sender.DataSource = objBindCombo.GetCityKeyValue(0, 0);
			sender.DataBind();
			sender.Items.Insert(0, new RadComboBoxItem("", "0"));
			sender.SelectedValue = "0";
		}
Exemple #11
0
    public void CargaDrop(object nombreDrop, string value, string text, DataTable dt, string[] atributos = null)
    {
        if (nombreDrop is ComboBox)
        {
            ComboBox drop = (ComboBox)nombreDrop;
            drop.DataSource = null;
            drop.DataBind();
            //drop.SelectedIndex = 0;
            drop.Items.Clear();
            if (dt.Rows.Count > 0)
            {
                drop.DataSource     = dt;
                drop.DataValueField = value;
                drop.DataTextField  = text;
                drop.DataBind();
            }
            ListItem li = new ListItem("Seleccione...", "0");
            li.Attributes.Add("Style", "font-weight:bold;");
            drop.Items.Insert(0, li);
            drop.SelectedIndex = 0;
        }
        else if (nombreDrop is RadComboBox)
        {
            RadComboBox drop = (RadComboBox)nombreDrop;
            drop.DataSource    = null;
            drop.SelectedIndex = -1;
            drop.ClearSelection();
            drop.SelectedValue = null;
            drop.DataBind();
            drop.Items.Clear();
            RadComboBoxItem li = new RadComboBoxItem("Seleccione...", "0");
            drop.Items.Add(li);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                RadComboBoxItem l2 = new RadComboBoxItem();
                l2.Value = dt.Rows[i][value].ToString();
                l2.Text  = dt.Rows[i][text].ToString().ToUpper();
                drop.Items.Add(l2);
                if (atributos != null)
                {
                    for (int j = 0; j < atributos.Length; j++)
                    {
                        l2.Attributes.Add(atributos[j], dt.Rows[i][atributos[j]].ToString());
                    }
                }
            }
            drop.SelectedIndex = 0;


            if (drop.Items.Count == 2)
            {
                drop.SelectedIndex = 1;
            }
        }
        else
        {
            DropDownList drop = (DropDownList)nombreDrop;
            drop.DataSource    = null;
            drop.SelectedIndex = -1;
            drop.ClearSelection();
            drop.SelectedValue = null;
            drop.DataBind();
            drop.Items.Clear();
            ListItem li = new ListItem("Seleccione...", "0");
            drop.Items.Add(li);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                ListItem l2 = new ListItem();
                l2.Value = dt.Rows[i][value].ToString();
                l2.Text  = dt.Rows[i][text].ToString().ToUpper();
                drop.Items.Add(l2);
                if (atributos != null)
                {
                    for (int j = 0; j < atributos.Length; j++)
                    {
                        l2.Attributes.Add(atributos[j], dt.Rows[i][atributos[j]].ToString());
                    }
                }
            }
            drop.SelectedIndex = 0;


            if (drop.Items.Count == 2)
            {
                drop.SelectedIndex = 1;
            }
        }
    }