Esempio n. 1
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
        }
Esempio n. 2
0
        //更新员工信息
        private void UpdateStaff()
        {
            string name     = this.nameTextBox.Text;
            string phone    = this.phoneTextBox.Text;
            string userName = this.userNameTextBox.Text;
            string pw       = this.pwTextBox.Text;
            int    index    = this.comboBoxEdit1.SelectedIndex;

            if (name.Equals("") || phone.Equals("") || userName.Equals("") || pw.Equals("") || index < 0)
            {
                MessageBox.Show("请将信息填充完整");
                return;
            }

            StructAccount.Builder staff = new StructAccount.Builder(this.staff);
            staff.Nickname = name;
            staff.Password = pw;
            staff.Phone    = phone;
            staff.Roleid   = managers[index].Roleid;
            StaffNetOperation.UpdateStaff(UpdateStaffResult, staff.Build());
        }