public override void OnSelected(AutocompleteMenu popupMenu, SelectedEventArgs e)
 {
     e.Tb.BeginUpdate();
     e.Tb.Selection.BeginUpdate();
     //remember places
     var p1 = popupMenu.Fragment.Start;
     var p2 = e.Tb.Selection.Start;
     //do auto indent
     if (e.Tb.AutoIndent)
     {
         for (int iLine = p1.iLine + 1; iLine <= p2.iLine; iLine++)
         {
             e.Tb.Selection.Start = new Place(0, iLine);
             e.Tb.DoAutoIndent(iLine);
         }
     }
     e.Tb.Selection.Start = p1;
     //move caret position right and find char ^
     while (e.Tb.Selection.CharBeforeStart != '^')
         if (!e.Tb.Selection.GoRightThroughFolded())
             break;
     //remove char ^
     e.Tb.Selection.GoLeft(true);
     e.Tb.InsertText("");
     //
     e.Tb.Selection.EndUpdate();
     e.Tb.EndUpdate();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// This method is called after item inserted into text
 /// </summary>
 public virtual void OnSelected(AutocompleteMenu popupMenu, SelectedEventArgs e)
 {
     ;
 }
Ejemplo n.º 3
0
 protected void OnSelected(SelectedEventArgs e)
 {
     if (Selected != null)
         Selected(this, e);
 }
    protected void tr_OrganizeCity_Selected(object sender, SelectedEventArgs e)
    {
        Label lb_OrganizeCity = (Label)pn_OrderApply.FindControl("ORD_OrderApply_OrganizeCity");
        lb_OrganizeCity.Text = TreeTableBLL.GetFullPathName("MCS_Sys.dbo.Addr_OrganizeCity", e.CurSelectIndex);

        Label lb_SheetCode = (Label)pn_OrderApply.FindControl("ORD_OrderApply_SheetCode");
        lb_SheetCode.Text = ORD_OrderApplyBLL.GenerateSheetCode(e.CurSelectIndex, AC_AccountMonthBLL.GetCurrentMonth());

        MCSSelectControl select_Client = (MCSSelectControl)pn_OrderApply.FindControl("ORD_OrderApply_Client");
        select_Client.PageUrl = "~/SubModule/CM/PopSearch/Search_SelectClient.aspx?ClientType=2&OrganizeCity=" + e.CurSelectIndex;
    }
    void tr_OrganizeCity_Selected(object sender, SelectedEventArgs e)
    {
        int city = 0;
        if (tr_OrganizeCity != null) int.TryParse(tr_OrganizeCity.SelectValue, out city);

        if (city > 0 && ddl_RelateStaff != null)
        {
            #region 判断当前可查询的管理区域范围
            string orgcitys = "";
            if ((int)Session["OwnerType"] != 3 && tr_OrganizeCity.SelectValue != "1")
            {
                Addr_OrganizeCityBLL orgcity = new Addr_OrganizeCityBLL(int.Parse(tr_OrganizeCity.SelectValue), true);
                orgcitys = orgcity.GetAllChildNodeIDs();
                if (orgcitys != "") orgcitys += ",";
                orgcitys += tr_OrganizeCity.SelectValue;

                if (orgcitys != "")
                {
                    string ConditionStr = " Org_Staff.OwnerClient=" + Session["OwnerClient"].ToString() + " AND Dimission=1";
                    ConditionStr += " AND Org_Staff.OrganizeCity IN (" + orgcitys + ") AND Org_Staff.OwnerType=" + Session["OwnerType"].ToString();

                    try
                    {
                        ddl_RelateStaff.DataTextField = "RealName";
                        ddl_RelateStaff.DataValueField = "ID";
                        ddl_RelateStaff.DataSource = Org_StaffBLL.GetStaffList(ConditionStr);
                        ddl_RelateStaff.DataBind();
                        ddl_RelateStaff.Items.Insert(0, new ListItem("请选择...", "0"));
                    }
                    catch { }
                }
            }
            #endregion

        }
    }
    void tr_OrganizeCity_Selected(object sender, SelectedEventArgs e)
    {
        if (tr_OrganizeCity == null) return;

        int city = 0;
        int.TryParse(tr_OrganizeCity.SelectValue, out city);
        BindVisitRoute(city);
    }
 public override void OnSelected(AutocompleteMenu popupMenu, SelectedEventArgs e)
 {
     base.OnSelected(popupMenu, e);
     if (Parent.Fragment.tb.AutoIndent)
         Parent.Fragment.tb.DoAutoIndent();
 }
    void tr_Channel_Selected(object sender, SelectedEventArgs e)
    {
        //根据子渠道自动设定价格渠道
        if (tr_Channel == null) return;

        try
        {
            int channel = 0;
            int.TryParse(tr_Channel.SelectValue, out channel);
            if (channel > 0)
            {
                CM_RTChannel_SYS _ch = new CM_RTChannel_SYSBLL(channel).Model;
                if (_ch != null)
                {
                    DropDownList ddl_MKTSGM = (DropDownList)pl_detail.FindControl("CM_ClientManufactInfo_MKTSGM");
                    if (ddl_MKTSGM != null && ddl_MKTSGM.Items.FindByValue(_ch["MKTSGM"]) != null)
                    {
                        ddl_MKTSGM.SelectedValue = _ch["MKTSGM"];
                    }
                }
            }
        }
        catch { }
    }
    void tr_OfficialCity_Selected(object sender, SelectedEventArgs e)
    {
        if (tr_OfficialCity == null) return;

        int city = 0;
        int.TryParse(tr_OfficialCity.SelectValue, out city);
        BindGeoCode(city);
    }
    void tr_OrganizeCity_Selected(object sender, SelectedEventArgs e)
    {
        if (tr_OrganizeCity == null) return;

        int city = 0;
        int.TryParse(tr_OrganizeCity.SelectValue, out city);
        if (city > 0)
        {

            DropDownList ddl_VisitRoute = (DropDownList)pl_detail.FindControl("CM_ClientManufactInfo_VisitRoute");
            if (ddl_VisitRoute != null)
            {
                ddl_VisitRoute.DataValueField = "ID";
                ddl_VisitRoute.DataTextField = "Name";

                ddl_VisitRoute.DataSource = VST_RouteBLL.GetByOrganizeCity(city);
                ddl_VisitRoute.DataBind();
                ddl_VisitRoute.Items.Insert(0, new ListItem("请选择...", "0"));
            }

            #region 设置营业所编码
            Addr_OrganizeCity citymodel = new Addr_OrganizeCityBLL(city).Model;
            TextBox tbx_OUTLOC = (TextBox)pl_detail.FindControl("CM_ClientManufactInfo_OUTLOC");
            if (citymodel != null && tbx_OUTLOC != null)
            {
                tbx_OUTLOC.Text = citymodel.Code;
            }

            citymodel = new Addr_OrganizeCityBLL(citymodel.SuperID).Model;
            TextBox tbx_SALGRP = (TextBox)pl_detail.FindControl("CM_ClientManufactInfo_SALGRP");
            if (citymodel != null && tbx_SALGRP != null)
            {
                tbx_SALGRP.Text = citymodel.Code;
            }
            #endregion
        }
    }
    void tr_OfficialCity_Selected(object sender, SelectedEventArgs e)
    {
        if (tr_OfficialCity == null) return;

        int city = 0;
        int.TryParse(tr_OfficialCity.SelectValue, out city);
        if (city > 0)
        {

            DropDownList ddl_GeoCode = (DropDownList)pl_detail.FindControl("CM_ClientManufactInfo_GeoCode");
            if (ddl_GeoCode != null)
            {
                ddl_GeoCode.DataValueField = "ID";
                ddl_GeoCode.DataTextField = "Name";

                ddl_GeoCode.DataSource = CM_GeoCodeBLL.GetListByCityCode(CM_ClientBLL.GetORGCOD2ByCity(city));
                ddl_GeoCode.DataBind();
                ddl_GeoCode.Items.Insert(0, new ListItem("请选择...", "0"));
            }
        }
    }
    protected void tr_OrganizeCity_Selected(object sender, SelectedEventArgs e)
    {
        #region 限定选择提成计算方法的范围只能是当前片区
        DropDownList ddl_SalaryGrade = (DropDownList)UC_DetailView1.FindControl("PM_Promotor_SalaryGrade");
        if (ddl_SalaryGrade != null)
        {
            try
            {
                ddl_SalaryGrade.DataTextField = "Name";
                ddl_SalaryGrade.DataValueField = "ID";

                string orgcitys = "";
                DataTable dt = TreeTableBLL.GetFullPath("MCS_SYS.dbo.Addr_OrganizeCity", "ID", "SuperID", int.Parse(tr_OrganizeCity.SelectValue));
                foreach (DataRow dr in dt.Rows)
                {
                    if (dr["ID"].ToString() != "")
                        orgcitys += "," + dr["ID"].ToString();
                }
                if (orgcitys.Length > 1) orgcitys = orgcitys.Substring(1, orgcitys.Length - 1);

                ddl_SalaryGrade.DataSource = PM_SalaryLevelBLL.GetModelList("OrganizeCity in (" + orgcitys + ")");
                ddl_SalaryGrade.DataBind();
            }
            catch { }
            ddl_SalaryGrade.Items.Insert(0, new ListItem("请选择", "0"));
        }
        #endregion
    }
Ejemplo n.º 13
0
 private void NativeItem_Selected(object sender, SelectedEventArgs e)
 {
     OnItemSelected?.Invoke(((NativeMenu)sender).SelectedItem, e);
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Default handler of <see cref="OnItemSelected"/>.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public abstract void Menu_OnItemSelected(NativeItem sender, SelectedEventArgs e);