Exemplo n.º 1
0
        private void Updateanager()
        {
            string name = this.textEdit1.Text;

            if (!name.Equals("") && !name.Equals(this.manager.Name))
            {
                ManagerNetOperation.UpdateManagerName(UpdateManagerNameResult, int.Parse(this.manager.Roleid), name);
            }

            List <int> rights = new List <int>();

            foreach (TreeNode node in this.treeView1.Nodes)
            {
                //System.Console.WriteLine("node:" + node.Checked);
                if (node.Checked)
                {
                    int nodeId = (int)node.Tag;
                    rights.Add(nodeId);
                }
                foreach (TreeNode child in node.Nodes)
                {
                    if (child.Checked)
                    {
                        int nodeId = (int)child.Tag;
                        rights.Add(nodeId);
                    }
                }
            }

            BigInteger.BigIntegerTools big = new BigInteger.BigIntegerTools(rights);
            ManagerNetOperation.UpdateManagerRights(UpdateManagerRightsResult, int.Parse(this.manager.Roleid), 1, big.ToString());
        }
Exemplo n.º 2
0
        private void SaveCurrentSetting()
        {
            if (this.selectPush == null)
            {
                return;
            }

            //获取当前选中的推送事项
            StructDictItem item = (StructDictItem)this.selectPush.Tag;//this.showPushItems[index];

            #region 修改员工短信Sns
            for (int i = 0; i < this.gridView1.RowCount; i++)
            {
                DataRow row = this.gridView1.GetDataRow(i);


                string        value = row[TitleList.Check.ToString()].ToString();
                StructAccount staff = showStaffs[i];

                BigInteger.BigIntegerTools big = new BigInteger.BigIntegerTools(staff.Sns);
                //勾选上的
                if (value.Equals("True"))
                {
                    big.SumRights(item.Id);
                }
                else
                {
                    big.RemoveRights(item.Id);
                }

                string sns = big.ToString();

                // System.Console.WriteLine("sns:"+sns);
                //有改变
                if (!sns.Equals(staff.Sns))
                {
                    StructAccount.Builder newStaff = new StructAccount.Builder(staff);
                    newStaff.Sns       = sns;
                    this.showStaffs[i] = newStaff.Build();
                }
            }
            #endregion

            #region 修改推送事项内容
            if (!item.GetItem(1).Equals(textBox1.Text))
            {
                StructDictItem.Builder newItem = new StructDictItem.Builder(item);
                newItem.SetItem(1, textBox1.Text);
                int index = this.showPushItems.IndexOf(item);
                this.showPushItems[index] = newItem.Build();
            }
            #endregion
        }