protected void dxmenumain_ItemDataBound(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
 {
     //open in a new window (e.g. for onedrive account)
     if (e.Item.NavigateUrl.StartsWith("https://"))
     {
         e.Item.Target = "_blank";
     }
 }
Exemple #2
0
        protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
        {
            IDao dao = DaoFactory.GetDao("DaoSysMenu");

            dao.Params["Oper"] = Session["MyUserName"].ToString();
            int    id  = Convert.ToInt16(ASPxTreeView1.SelectedNode.Name);
            string msg = "操作失败!";
            int    rtn = -1;

            // 增加平级菜单
            if (e.Item.Name.Equals("mAddDept"))
            {
                dao.Params["ID"] = id;
                rtn = dao.Insert(out msg);
            }
            // 增加子菜单
            else if (e.Item.Name.Equals("mAddSubDept"))
            {
                dao.Params["ParentID"] = id;
                rtn = dao.Oper("P_Sys_Oper_Menu", "insertSub", out msg);
            }
            // 删除部门
            else if (e.Item.Name.Equals("mDel"))
            {
                rtn = dao.Delete(id + "", out msg);
            }
            // 保存部门
            else if (e.Item.Name.Equals("mSave"))
            {
                FrmUtil.GetData(ASPxCallbackPanel1, dao.Params);
                rtn = dao.Update(out msg);
            }
            // 上移
            else if (e.Item.Name.Equals("mUp"))
            {
                dao.Params["ID"] = id;
                rtn = dao.Oper("P_Sys_Oper_Menu", "up", out msg);
            }
            // 下移
            else if (e.Item.Name.Equals("mDown"))
            {
                dao.Params["ID"] = id;
                rtn = dao.Oper("P_Sys_Oper_Menu", "down", out msg);
            }

            if (rtn != 0)
            {
                lblMsg.Text = msg;
                ASPxPopupControl1.ShowOnPageLoad = true;
            }
            else
            {
                ASPxTreeView1.Nodes.Clear();
                dao.Params.Clear();
                loadMenu(null, dao.Select(), id);
                //ASPxTreeView1.ExpandAll();
            }
        }
Exemple #3
0
    /// <summary>
    /// once command menu initialised format urls with current order no (not decrypted)
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void dxmnuOrder_ItemDataBound(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
    {
        string _orderno = get_token("pno");

        if (!string.IsNullOrEmpty(e.Item.NavigateUrl))
        {
            e.Item.NavigateUrl = String.Format(e.Item.NavigateUrl, _orderno);
        }
    }
Exemple #4
0
        protected void popMenAddCalcField_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
        {
            KPIPartCtrlBase ctrl = AddKPIPartControl(String.Format("context-{0}", e.Item.Name).ToLower(), string.Empty);

            m_PartControls.Add(new PartControlInfo()
            {
                ID = ctrl.ID, ControlType = ctrl.PartType
            });
        }
    protected void ASPxMenu2_ItemDataBound(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
    {
        SiteMapNode node = e.Item.DataItem as SiteMapNode;

        if (node != null)
        {
            e.Item.TextTemplate = new MenuItemTemplate(node);
        }
    }
Exemple #6
0
        protected void popFilterMenu_Click(object sender, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
        {
            String         filterType = e.Item.Name;
            FilterCtrlBase ctl        = GenerateFilterControl(filterType, String.Empty);

            m_Filters.Add(new FilterControlInfo(ctl)
            {
                Type = filterType
            });
        }
 /// <summary>
 /// on menu databound modify navigate urls to current page and primary key (pno)
 /// </summary>
 /// <param name="source"></param>
 /// <param name="e"></param>
 protected void dxmnuFormView_ItemDataBound(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
 {
     //do NOT set the NavigateUrl property as it prevents itemclick event fom being fired! You can only have one or the other
     e.Item.NavigateUrl = "";
     //if (!string.IsNullOrEmpty(e.Item.NavigateUrl))
     //{
     //    string _page = System.IO.Path.GetFileNameWithoutExtension(Page.AppRelativeVirtualPath);//e.g. "BOL_Edit";
     //    string _id = get_token("pno");
     //    if (!string.IsNullOrEmpty(e.Item.NavigateUrl)) { e.Item.NavigateUrl = String.Format(e.Item.NavigateUrl, _page, _id); }
     //}
 }
Exemple #8
0
 protected virtual void mSelector_ItemDataBound(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
 {
     if (GetStatus(e.Item.DataItem, "IsUpdated"))
     {
         e.Item.Text += " <span style=\"color: #2D9404;\">(updated)</span>";
     }
     if (GetStatus(e.Item.DataItem, "IsNew"))
     {
         e.Item.Text += " <span style=\"color: #BD0808;\">(new)</span>";
     }
 }
Exemple #9
0
 protected void dxmnuCommand_ItemDataBound(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
 {
     //do not set navigateurl as it prevents itemclick event from firing
     e.Item.NavigateUrl = "";
     //if (!string.IsNullOrEmpty(e.Item.NavigateUrl))
     // {
     //     string _page = System.IO.Path.GetFileNameWithoutExtension(Page.AppRelativeVirtualPath);//e.g. "BOL_Edit";
     //     string _id = get_token("pno");
     //     if (!string.IsNullOrEmpty(e.Item.NavigateUrl)) { e.Item.NavigateUrl = String.Format(e.Item.NavigateUrl, _page, _id); }
     // }
 }
 protected void dxmnuCommand_ItemDataBound(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
 {
     if (!string.IsNullOrEmpty(e.Item.NavigateUrl))
     {
         string _page = System.IO.Path.GetFileNameWithoutExtension(Page.AppRelativeVirtualPath);//e.g. "BOL_Edit";
         string _id   = get_token("pno");
         if (!string.IsNullOrEmpty(e.Item.NavigateUrl))
         {
             e.Item.NavigateUrl = String.Format(e.Item.NavigateUrl, _page, _id);
         }
     }
 }
Exemple #11
0
    protected void dxmnuGrid1_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
    {
        switch (e.Item.Name.ToString())
        {
        case "mnuExport":     //replaces export button & combo
        {
            export_grid_data();
            break;
        }

        default:
        {
            break;
        }
        }//end switch
    }
 protected void dxmnuSearchTools_DataBound(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
 {
     if (!string.IsNullOrEmpty(e.Item.NavigateUrl))
     {
         //get path to form
         string _folder = System.IO.Path.GetDirectoryName(Page.AppRelativeVirtualPath);
         //change to formview page by removing 'search' e.g. container_search.aspx becomes container.aspx
         string _page = System.IO.Path.GetFileNameWithoutExtension(Page.AppRelativeVirtualPath).Replace("_search", "");
         //primary key id
         string _id = get_token("pno");
         if (!string.IsNullOrEmpty(e.Item.NavigateUrl))
         {
             e.Item.NavigateUrl = String.Format(e.Item.NavigateUrl, _folder + "\\" + _page, _id);
         }
     }
 }
Exemple #13
0
    protected void mnuToolbar_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
    {
        string format = hdnFormat.Value; // or (mnuToolbar.Items[3].FindControl("cbFormat") as ASPxComboBox).Text;

        if (e.Item.Name == "mnuSaveToDisk")
        {
            if (format == "pdf")
            {
                ASPxTreeListExporter1.WritePdfToResponse(true);
            }
            else if (format == "xls")
            {
                ASPxTreeListExporter1.WriteXlsToResponse(true);
            }
            else if (format == "rtf")
            {
                ASPxTreeListExporter1.WriteRtfToResponse(true);
            }
        }
    }
 protected void popMen_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
 {
     this.Add_CalcFieldControl(e.Item.Name, false);
 }
 protected void popMenAddCalcField_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
 {
     this.Add_PartControl(string.Format("context-{0}", e.Item.Name), false);
 }
    //crud commands for formview
    protected void dxmnuFormView_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
    {
        string        _item      = e.Item.Name.ToString();
        List <string> _menuitems = new List <string>();

        switch (_item)
        {
        case "cmdNew":
        {
            set_mode("Insert");
            //call databind to change mode
            bind_formview("Insert");
            break;
        }

        case "cmdEdit":
        {
            set_mode("Edit");
            //call databind to change mode
            bind_formview("Edit");
            break;
        }

        case "cmdDelete":     //not enabled - do we want users to delete records?
        {
            break;
        }

        case "cmdUpdate":
        {
            update_country();
            set_mode("ReadOnly");
            //call databind to change mode
            bind_formview("ReadOnly");
            //this.fmvVoyage.UpdateItem(false);
            //set_mode("view"); not necesary form will revert to read only after save
            break;
        }

        case "cmdSave":
        {
            this.dxhfOrder.Clear();
            int _newid = insert_country();
            if (_newid > 0)
            {
                //set_mode("ReadOnly");
                //call databind to change mode
                //bind_formview("ReadOnly");
                string[] _args = { System.IO.Path.GetDirectoryName(Page.AppRelativeVirtualPath),
                                   System.IO.Path.GetFileNameWithoutExtension(Page.AppRelativeVirtualPath),
                                   wwi_security.EncryptString(_newid.ToString(),                           "publiship"),
                                   "ReadOnly" };
                string   _url = string.Format("{0}\\{1}.aspx?pid={2}&mode={3}", _args);
                Response.Redirect(_url);
            }
            else
            {
                if (this.dxlblErr.Text == "")
                {
                    this.dxlblErr.Text = "Error new record NOT saved";
                }
                this.dxpnlErr.ClientVisible = true;
            }

            //this.fmvVoyage.InsertItem(false);
            //set_mode("view"); not necesary form will revert to read only after save
            break;
        }

        case "cmdCancel":
        {
            set_mode("ReadOnly");
            bind_formview("ReadOnly");
            break;
        }

        case "cmdClose":
        {
            string[] _args = { System.IO.Path.GetDirectoryName(Page.AppRelativeVirtualPath),
                               "country_search", };
            string   _url = string.Format("{0}\\{1}.aspx?", _args);
            Response.Redirect(_url);
            break;
        }

        default:
        {
            break;
        }
        }
        //end switch
    }
Exemple #17
0
 protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
 {
     Session["menu_name"] = e.Item.Text;
 }
Exemple #18
0
 protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
 {
     FormsHelper.ToolBarClick(ucABM1, e.Item.Name, gv, ASPxGridViewExporter1);
 }
    //crud commands for formview
    protected void dxmnuFormView_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
    {
        string        _item      = e.Item.Name.ToString();
        List <string> _menuitems = new List <string>();

        switch (_item)
        {
        case "cmdNew":
        {
            set_mode("Insert");
            //call databind to change mode
            bind_formview("Insert");
            break;
        }

        case "cmdEdit":
        {
            set_mode("Edit");
            //call databind to change mode
            bind_formview("Edit");
            break;
        }

        case "cmdDelete":     //not enabled - do we want users to delete records?
        {
            break;
        }

        case "cmdUpdate":
        {
            update_dimensions();
            set_mode("ReadOnly");
            //call databind to change mode
            bind_formview("ReadOnly");
            //this.fmvVoyage.UpdateItem(false);
            //set_mode("view"); not necesary form will revert to read only after save
            break;
        }

        case "cmdSave":
        {
            break;         //not available on this form
        }

        case "cmdCancel":
        {
            set_mode("ReadOnly");
            bind_formview("ReadOnly");
            break;
        }

        case "cmdClose":
        {
            string[] _args = { System.IO.Path.GetDirectoryName(Page.AppRelativeVirtualPath),
                               "country_search", };
            string   _url = string.Format("{0}\\{1}.aspx?", _args);
            Response.Redirect(_url);
            break;
        }

        default:
        {
            break;
        }
        }
        //end switch
    }
Exemple #20
0
 protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
 {
     ASPxSplitter1.GetPaneByName("MainFrame").ContentUrl = ASPxMenu1.SelectedItem.NavigateUrl;
 }
 protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
 {
     Label1.Text = "The clicked item: " + e.Item.Text;
 }
Exemple #22
0
    //end mode changing

    /// <summary>
    /// on click events
    /// </summary>
    /// <param name="source"></param>
    /// <param name="e"></param>
    protected void dxeditFormMenu_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
    {
        string _item = e.Item.Name.ToString();

        List <string> _menuitems = new List <string>();

        switch (_item)
        {
        case "miNew":
        {
            set_mode("Insert");
            //rebind formview to force mode change
            bind_company("Insert");
            break;
        }

        case "miEdit":
        {
            set_mode("Edit");
            bind_company("Edit");
            break;
        }

        case "miDelete":     //not enabled - do we want users to delete records?
        {
            //this.fmvAddressBook.DeleteItem();
            break;
        }

        case "miUpdate":
        {
            //for testing purposes
            //string _s = "";
            //ASPxMemo _memo = (ASPxMemo)this.formOrder.FindControl("dxmemoRemarksToCustomer");
            //if (_memo != null) {
            //    _s = _memo.Text.ToString();
            //}
            //OrderTable _o = new OrderTable(303635);
            //_o.RemarksToCustomer = _s;
            //_o.Save();
            this.fmvAddressBook.UpdateItem(false);
            set_mode("ReadOnly");
            bind_company("ReadOnly");
            break;
        }

        case "miSave":
        {
            this.fmvAddressBook.InsertItem(false);
            set_mode("ReadOnly");
            bind_company("ReadOnly");
            break;
        }

        case "miCancel":
        {
            //this.fmvAddressBook.ChangeMode(FormViewMode.ReadOnly);
            set_mode("ReadOnly");
            bind_company("ReadOnly");
            break;
        }

        default:
        {
            break;
        }
        }
        //end switch
    }
Exemple #23
0
        protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
        {
            IDao dao = DaoFactory.GetDao("DaoBasDept");

            dao.Params["Oper"] = Session["MyUserName"].ToString();
            string code = ASPxTreeView1.SelectedNode.Name;
            string msg  = "操作失败!";
            int    rtn  = -1;

            // 增加平级部门
            if (e.Item.Name.Equals("mAddDept"))
            {
                dao.Params["Code"] = code;
                rtn  = dao.Insert(out msg);
                code = msg;
            }
            // 增加子部门
            else if (e.Item.Name.Equals("mAddSubDept"))
            {
                dao.Params["ParentCode"] = code;
                rtn  = dao.Oper("P_Bas_Oper_Dept", "insertSub", out msg);
                code = msg;
            }
            // 删除部门
            else if (e.Item.Name.Equals("mDel"))
            {
                rtn = dao.Delete(code, out msg);
            }
            // 保存部门
            else if (e.Item.Name.Equals("mSave"))
            {
                FrmUtil.GetData(ASPxPageControl1, dao.Params);
                dao.Params["NewCode"] = dao.Params["Code"];
                dao.Params["Code"]    = code;
                rtn = dao.Update(out msg);

                code = txtCode.Text;
            }
            // 上移
            else if (e.Item.Name.Equals("mUp"))
            {
                dao.Params["Code"] = code;
                rtn = dao.Oper("P_Bas_Oper_Dept", "up", out msg);
            }
            // 下移
            else if (e.Item.Name.Equals("mDown"))
            {
                dao.Params["Code"] = code;
                rtn = dao.Oper("P_Bas_Oper_Dept", "down", out msg);
            }

            if (rtn != 0)
            {
                lblMsg.Text = msg;
                ASPxPopupControl1.ShowOnPageLoad = true;
            }
            else
            {
                ASPxTreeView1.Nodes.Clear();
                dao.Params.Clear();
                loadTree(null, dao.Select(), code);
                ASPxTreeView1.ExpandAll();
            }
        }
    //end incremental filtering of company name
    #endregion


    #region menu and tab control
    protected void dxmnuCommand_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
    {
        string        _item      = e.Item.Name.ToString();
        List <string> _menuitems = new List <string>();

        try
        {
            switch (_item)
            {
            case "cmdNew":
            {
                set_mode("Insert");
                //for the mode to change call databind
                //bind_formview("Insert", 0);
                break;
            }

            case "cmdEdit":
            {
                set_mode("Edit");
                //for the mode to change call databind
                //bind_formview("Edit", 0);
                break;
            }

            case "cmdDelete":     //not enabled - do we want users to delete records?
            {
                //this.fmvCourier.DeleteItem();
                break;
            }

            case "cmdUpdate":
            {
                //update_courier();
                set_mode("ReadOnly");
                //for the mode to change call databind
                //bind_formview("ReadOnly", 0);
                //this.fmvCourier.UpdateItem(false);
                //set_mode("view"); will return to view automatically after updating
                break;
            }

            case "cmdSave":
            {
                //no insert option needed for courier
                //insert_courier();
                set_mode("ReadOnly");
                //rebind griview
                this.dxgrdCourier.DataBind();
                //DEPRECTED we are not using a formview. for the mode to change call databind
                //bind_formview("ReadOnly", 0);
                //this.fmvCourier.InsertItem(false);
                //set_mode("view"); will return to view automatically after inserting
                break;
            }

            case "cmdCancel":
            {
                set_mode("ReadOnly");
                //for the mode to change call databind
                //bind_formview("Insert", 0);
                break;
            }

            default:
            {
                break;
            }
            }
            //end switch
        }
        catch (Exception ex)
        {
            string _ex = ex.Message.ToString();
            this.dxlblErr.Text = _ex;
        }
    }
 protected void ASPxPopupMenu1_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
 {
     ASPxGridViewExporter1.WriteXlsToResponse();
 }
Exemple #26
0
    protected void dxmnuCommand_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
    {
        string        _item      = e.Item.Name.ToString();
        List <string> _menuitems = new List <string>();

        try
        {
            switch (_item)
            {
            case "cmdNew":
            {
                set_mode("Insert");
                //for the mode to change call databind
                bind_formview("Insert");
                break;
            }

            case "cmdEdit":
            {
                set_mode("Edit");
                //for the mode to change call databind
                bind_formview("Edit");
                break;
            }

            case "cmdDelete":     //not enabled - do we want users to delete records?
            {
                //this.fmvAddresses.DeleteItem();
                break;
            }

            case "cmdUpdate":
            {
                update_addresses();
                set_mode("ReadOnly");
                //for the mode to change call databind
                bind_formview("ReadOnly");
                //this.fmvAddresses.UpdateItem(false);
                break;
            }

            case "cmdSave":
            {
                insert_addresses();
                set_mode("ReadOnly");
                //for the mode to change call databind
                bind_formview("ReadOnly");
                //no insert option needed for charges
                //this.fmvAddresses.InsertItem(false);
                break;
            }

            case "cmdCancel":
            {
                set_mode("ReadOnly");
                //for the mode to change call databind
                bind_formview("ReadOnly");
                break;
            }

            default:
            {
                break;
            }
            }
            //end switch
        }
        catch (Exception ex)
        {
            string _ex = ex.Message.ToString();
            this.dxlblErr.Text = _ex;
        }
    }
    protected void ASPxMenu1_ItemClick(object source, DevExpress.Web.ASPxMenu.MenuItemEventArgs e)
    {
        string strCssFilePath = "";
        string strCssPostfix  = "";

        switch (e.Item.Name)
        {
        case "BlackGlass":
            strCssFilePath = "~/App_Themes/BlackGlass/{0}/styles.css";
            strCssPostfix  = "BlackGlass";
            break;

        case "Blue":
            strCssFilePath = "~/App_Themes/Blue/{0}/styles.css";
            strCssPostfix  = "Blue";
            break;

        case "Glass":
            strCssFilePath = "~/App_Themes/Glass/{0}/styles.css";
            strCssPostfix  = "Glass";
            break;

        case "Office2003Blue":
            strCssFilePath = "~/App_Themes/Office2003 Blue/{0}/styles.css";
            strCssPostfix  = "Office2003_Blue";
            break;

        case "Office2003Olive":
            strCssFilePath = "~/App_Themes/Office2003 Olive/{0}/styles.css";
            strCssPostfix  = "Office2003_Olive";
            break;

        case "Office2003Silver":
            strCssFilePath = "~/App_Themes/Office2003 Silver/{0}/styles.css";
            strCssPostfix  = "Office2003_Silver";
            break;

        case "PlasticBlue":
            strCssFilePath = "~/App_Themes/Plastic Blue/{0}/styles.css";
            strCssPostfix  = "PlasticBlue";
            break;

        case "RedWine":
            strCssFilePath = "~/App_Themes/Red Wine/{0}/styles.css";
            strCssPostfix  = "RedWine";
            break;

        case "SoftOrange":
            strCssFilePath = "~/App_Themes/Soft Orange/{0}/styles.css";
            strCssPostfix  = "Soft_Orange";
            break;

        case "Youthful":
            strCssFilePath = "~/App_Themes/Youthful/{0}/styles.css";
            strCssPostfix  = "Youthful";
            break;

        default:
            return;
        }
        ChangeTheme(this.Form.Controls, strCssFilePath, strCssPostfix);
    }