/// <summary>
        /// 换肤Gallery
        /// </summary>
        private void rgbiSkins_Gallery_ItemClick(object sender, DevExpress.XtraBars.Ribbon.GalleryItemClickEventArgs e)
        {
            //  记录员工个人皮肤选项
            String newSkin = Convert.ToString(e.Item.Tag);
            List <KeyValuePair <string, string> > parms = new List <KeyValuePair <string, string> >();

            parms.Add(new KeyValuePair <string, string>("empId", EmpInfo.Id.ToString()));
            parms.Add(new KeyValuePair <string, string>("parmName", "DEF_SKIN"));
            parms.Add(new KeyValuePair <string, string>("value", newSkin));
            CustomException ce = null;

            HttpDataHelper.HttpPostFormUrlParamWithInfo("BASE", "/sys/parameteremp", out ce, parms);
            MessageHelper.ShowInfo("已设置新皮肤: " + newSkin);
        }
Exemple #2
0
        private void bbiDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (tlSysMenu.FocusedNode != null)
            {
                if (tlSysMenu.FocusedNode.HasChildren)
                {
                    MessageHelper.ShowWarning("还有子项不能删除!");
                    return;
                }

                string mess = (tlSysMenu.FocusedNode.Level == 0) ? "系统:" : "菜单:";
                mess = mess + "(" + tlSysMenu.FocusedNode.GetDisplayText(tlcCode) + ")" + tlSysMenu.FocusedNode.GetDisplayText(tlcName);

                if (MessageHelper.ShowYesNoAndInfo("是否真的删除 " + mess + "?") == DialogResult.Yes)
                {
                    CustomException ce = null;

                    if (tlSysMenu.FocusedNode.Level == 0)
                    {
                        BDictSystem system   = tlSysMenu.FocusedNode.Tag as BDictSystem;
                        var         parmList = new List <KeyValuePair <string, string> >
                        {
                            new KeyValuePair <string, string>("systemId", system.Id.ToString())
                        };
                        //  删除子系统
                        HttpDataHelper.HttpPostFormUrlParamWithInfo("BASE", "/setup/systemdelete", out ce, parmList);
                    }
                    else
                    {
                        BDictMenu menu     = tlSysMenu.FocusedNode.Tag as BDictMenu;
                        var       parmList = new List <KeyValuePair <string, string> >
                        {
                            new KeyValuePair <string, string>("systemId", menu.SystemId.ToString()),
                            new KeyValuePair <string, string>("menuCode", menu.Code),
                        };
                        //  删除菜单
                        HttpDataHelper.HttpPostFormUrlParamWithInfo("BASE", "/setup/menudelete", out ce, parmList);
                    }
                    // 处理异常ce
                    if (ce != null)
                    {
                        MessageHelper.ShowError("删除操作失败!\r\n" + ce.Info);
                    }
                    tlSysMenu.FocusedNode.Remove();
                }
            }
        }
        /// <summary>
        /// 切换输入法
        /// </summary>
        private void bbiChangeChoice_ItemClick(object sender, ItemClickEventArgs e)
        {
            FrmInputCode frminput = new FrmInputCode();

            if (frminput.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                this.bbiChangeChoice.Caption = (EmpInfo.InputChoice == "1") ? "首拼" : "五笔";

                List <KeyValuePair <string, string> > parms = new List <KeyValuePair <string, string> >();
                parms.Add(new KeyValuePair <string, string>("empId", EmpInfo.Id.ToString()));
                parms.Add(new KeyValuePair <string, string>("parmName", "DEF_INPUT"));
                parms.Add(new KeyValuePair <string, string>("input", (EmpInfo.InputChoice == "1" ? 1 : 2).ToString()));
                // 设置默认输入法
                CustomException ce = null;
                HttpDataHelper.HttpPostFormUrlParamWithInfo("BASE", "/sys/parameteremp", out ce, parms);
            }
        }
Exemple #4
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            TreeListNode tn = tlSysMenu.FocusedNode;

            if (tn != null && !tn.HasChildren)
            {
                String code = tn.GetValue(tlcCode).ToString();
                // 设置默认菜单code
                List <KeyValuePair <string, string> > parms = new List <KeyValuePair <string, string> >();
                parms.Add(new KeyValuePair <string, string>("empId", EmpInfo.Id.ToString()));
                parms.Add(new KeyValuePair <string, string>("parmName", "DEF_MENU_" + EnvInfo.SystemCode));
                parms.Add(new KeyValuePair <string, string>("value", code));
                CustomException ce = null;
                HttpDataHelper.HttpPostFormUrlParamWithInfo("BASE", "/sys/parameteremp", out ce, parms);
                MessageBox.Show("默认菜单设置完成!");
                this.Close();
            }
        }
Exemple #5
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (txtOld.Text.Length * txtNew1.Text.Length * txtNew2.Text.Length == 0)
            {
                MessageHelper.ShowWarning("口令不得为空!");
                return;
            }
            if (!txtNew1.Text.Equals(txtNew2.Text))
            {
                MessageHelper.ShowWarning("新密码与确认密码不一致!");
                return;
            }
            int branchid = EnvInfo.BranchId;
            int empid    = EmpInfo.Id;

            //  修改密码
            List <KeyValuePair <string, string> > parms = new List <KeyValuePair <string, string> >();

            parms.Add(new KeyValuePair <string, string>("empId", EmpInfo.Id.ToString()));
            parms.Add(new KeyValuePair <string, string>("opsw", DataCryptoHelper.MD5EncryptString(txtOld.Text)));
            parms.Add(new KeyValuePair <string, string>("npsw", DataCryptoHelper.MD5EncryptString(txtNew1.Text)));
            CustomException ce = null;

            if (Convert.ToInt32(HttpDataHelper.HttpPostFormUrlParamWithInfo("BASE", "/setup/newpsw", out ce, parms)) == 1)//CloudServiceHelper.PathGetString("PROVIDER", "/sys/getemppasswd", branchid.ToString(), empid.ToString()).Equals(txtOld.Text)
            {
                //CloudServiceHelper.PathGetString("PROVIDER", "/sys/setemppasswd", branchid.ToString(), empid.ToString(), txtNew1.Text);
                MessageHelper.ShowInfo("密码设置完成!");
            }
            else
            {
                MessageHelper.ShowWarning("密码验证失败!");
                return;
            }

            this.Close();
        }
Exemple #6
0
        private void tlSysMenu_DragDrop(object sender, DragEventArgs e)
        {
            e.Effect = DragDropEffects.None;
            TreeListNode snode        = GetDragNode(e.Data);
            BDictMenu    menu         = snode.Tag as BDictMenu;
            string       old_code     = menu.Code;
            int          old_systemId = menu.SystemId;

            if (snode == null)
            {
                return;
            }
            TreeListHitInfo info = tlSysMenu.CalcHitInfo(tlSysMenu.PointToClient(new System.Drawing.Point(e.X, e.Y)));

            if (info == null)
            {
                return;
            }
            TreeListNode tnode = info.Node;

            if (snode.ParentNode == tnode)    //  还是同一父节点下
            {
                return;
            }
            if (snode.Level == 0 || tnode.Level == 4)    //  系统不能拖到其他节点下,4级菜单下不能再有子节点
            {
                return;
            }

            if (snode.HasChildren)
            {
                MessageHelper.ShowWarning("有子节点的不能被拖到其他菜单下!");
                return;
            }

            int    new_systemId = 0;
            string new_code     = string.Empty;

            if (tnode.Level > 0)
            {
                if (!string.IsNullOrEmpty((tnode.Tag as BDictMenu).ObjectCode))
                {
                    MessageHelper.ShowWarning("节点有功能不能挂其他菜单!");
                    return;
                }
                new_systemId = (tnode.Tag as BDictMenu).SystemId;
                new_code     = tnode.GetValue(tlcCode).ToString() + "1";
            }
            else
            {
                new_systemId = (tnode.Tag as BDictSystem).Id;
                new_code     = "1";
            }

            //  计算新的代码
            if (tnode.HasChildren)
            {
                new_code = getNextMenuCode(tnode.Nodes[tnode.Nodes.Count - 1].GetValue(this.tlcCode).ToString());
            }
            menu.Code     = new_code;
            menu.SystemId = new_systemId;

            // 拖拽修修改
            List <KeyValuePair <string, string> > parms = new List <KeyValuePair <string, string> >();

            parms.Add(new KeyValuePair <string, string>("oldSystem", old_systemId.ToString()));
            parms.Add(new KeyValuePair <string, string>("oldMenu", old_code));
            parms.Add(new KeyValuePair <string, string>("newSystem", new_systemId.ToString()));
            parms.Add(new KeyValuePair <string, string>("newMenu", new_code));
            CustomException ce = null;

            HttpDataHelper.HttpPostFormUrlParamWithInfo("BASE", "/setup/menumove", out ce, parms);
            if (ce == null)
            {
                snode.Remove();
                TreeListNode cnode = tnode.Nodes.Add(new object[] { menu.Code, menu.Title });
                cnode.Tag             = menu;
                tlSysMenu.FocusedNode = cnode;
            }
            else
            {
                MessageHelper.ShowError("菜单移动调用服务失败!\r\n" + ce.Info);
            }
        }