示例#1
0
 public StaffAddView(StructAccount tem)
 {
     InitializeComponent();
     if (tem != null)
     {
         this.staff = tem;
     }
     InitUI();
 }
示例#2
0
        //添加新行
        private void AddNewRow(StructAccount staff)
        {
            DataRow row = this.mainDataTable.NewRow();

            this.mainDataTable.Rows.Add(row);
            row[TitleList.Number.ToString()]    = this.mainDataTable.Rows.Count;
            row[TitleList.StaffName.ToString()] = staff.Nickname;
            row[TitleList.TelNumber.ToString()] = staff.Phone;
            row[TitleList.UserName.ToString()]  = staff.Username;
            row[TitleList.Role.ToString()]      = SysManage.GetManagerName(staff.Roleid);
        }
示例#3
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
        }
示例#4
0
        /// <summary>
        /// 添加员工
        /// </summary>
        /// <param name="resultBlock"></param>
        /// <param name="account"></param>
        public static void AddStaff(DataResultBlock resultBlock, StructAccount account)
        {
            CSAccountAdd.Builder add = new CSAccountAdd.Builder();
            add.SetAccount(account);

            MessageContent.Builder content = new MessageContent.Builder();
            content.SetMessageType(1);
            content.SetCsAccountAdd(add.Build());

            SendModel send = new SendModel()
            {
                cmd     = Cmd.CMD_STAFF_ADD,
                content = content.Build()
            };

            NetMessageManage.SendMsg(send, resultBlock);
        }
示例#5
0
        /// <summary>
        /// 修改员工信息
        /// </summary>
        /// <param name="resultBlock"></param>
        /// <param name="account"></param>
        public static void UpdateStaff(DataResultBlock resultBlock, StructAccount account)
        {
            CSAccountUpdate.Builder update = new CSAccountUpdate.Builder();
            update.SetAccount(account);

            MessageContent.Builder content = new MessageContent.Builder();
            content.SetMessageType(1);
            content.SetCsAccountUpdate(update.Build());

            SendModel send = new SendModel()
            {
                cmd     = Cmd.CMD_STAFF_UPDATE,
                content = content.Build()
            };

            NetMessageManage.SendMsg(send, resultBlock);
        }
示例#6
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            SaveCurrentSetting();

            //根据Ori进行判断是否修改过
            //员工判断
            List <StructAccount> changeStaffs = new List <StructAccount>();

            for (int i = 0; i < this.oriStaffs.Count; i++)
            {
                StructAccount ori    = this.oriStaffs[i];
                StructAccount change = this.showStaffs[i];
                if (!ori.Sns.Equals(change.Sns))
                {
                    changeStaffs.Add(change);
                    // System.Console.WriteLine("ori:" + ori + "\nchange:" + change);
                }
            }

            //推送事项
            List <StructDictItem> changePush = new List <StructDictItem>();

            for (int i = 0; i < this.oriPushItems.Count; i++)
            {
                StructDictItem ori    = this.oriPushItems[i];
                StructDictItem change = this.showPushItems[i];
                if (!ori.GetItem(1).Equals(change.GetItem(1)))
                {
                    changePush.Add(change);
                }
            }
            if (changePush.Count > 0)
            {
                SystemManageNetOperation.UpdateSmsPushMessage(UpdateSmsPushMessage, changePush);
            }
            if (changeStaffs.Count > 0)
            {
                StaffNetOperation.UpdateStaffSns(UpdateStaffSnsResult, changeStaffs);
            }
        }
示例#7
0
        //按钮列功能
        private void ButtonPressedEventClick(object sender, ButtonPressedEventArgs e)
        {
            int           row   = this.gridView1.FocusedRowHandle;
            StructAccount staff = this.staffs[row];

            char[]   splits = { '_' };
            string[] res    = ((string)e.Button.Tag).Split(splits);
            //修改
            if (res[1].Equals("0"))
            {
                CloseFormHandle closeEvent = new CloseFormHandle(delegate {
                    GetStaffList();
                });
                StaffAddView view = new StaffAddView(staff);
                ToolsManage.ShowForm(view, false, closeEvent);
            }
            //删除
            else if (res[1].Equals("1"))
            {
                StaffNetOperation.DeleteStaffs(DeleteStaffsResult, staff.Guid);
            }
        }
示例#8
0
        //标签点击
        private void PushButton_ButtonClick(object sender, EventArgs e)
        {
            //保存当前勾选的状态
            this.SaveCurrentSetting();
            Label push = (Label)sender;

            //设置选中按钮/前一个选中按钮的状态
            if (this.selectPush != null && this.selectPush.Equals(push))
            {
                return;
            }

            Label tem = this.selectPush;

            this.selectPush = push;

            if (tem != null)
            {
                tem.ForeColor = N_PUSH_F_COLOR;
            }
            this.selectPush.ForeColor = S_PUSH_F_COLOR;

            //获取输入短信内容
            // int index = int.Parse((string)this.selectPush.Tag);
            StructDictItem item = (StructDictItem)this.selectPush.Tag;

            this.textBox1.Text = item.GetItem(1);


            //更新右侧员工数据
            for (int i = 0; i < this.gridView1.RowCount; i++)
            {
                DataRow       row   = this.gridView1.GetDataRow(i);
                StructAccount staff = showStaffs[i];
                bool          check = BigInteger.BigIntegerTools.TestRights(staff.Sns, item.Id);
                row[TitleList.Check.ToString()] = check;
            }
        }