//设置界面 private void SetSetting() { StructDictItem item = this.items[0]; this.pwCheckEdit.Checked = int.Parse(item.GetItem(0)) == 1; this.pwTextEdit.Text = item.GetItem(1); }
//g修改费率设置 private void update_Click(object sender, EventArgs e) { if (sender.Equals(this.nUpdateButton)) { List <string> ids = GetCheckIds(this.gridView1, nitems); if (ids.Count > 0) { StructDictItem item = GetAwardSetting(int.Parse(ids[0])); if (item != null) { RateManageNetOperation.UpdateAwardManage(UpdateAwardResult, item); } } } else if (sender.Equals(this.mUpdateButton)) { List <string> ids = GetCheckIds(this.gridView4, mitems); if (ids.Count > 0) { StructDictItem item = GetMemberAwardSetting(int.Parse(ids[0])); if (item != null) { RateManageNetOperation.UpdateMemberDayAwardManage(UpdateMemberDayAwardResult, item); } } } }
//按钮列的点击事件 public void ColumnButtonClick(object sender, ButtonPressedEventArgs e) { int rowhandle = this.gridView1.FocusedRowHandle; StructDictItem item = wecomeitems[rowhandle]; String tag = (String)e.Button.Tag; String[] param = tag.Split('_'); //使用 if (param[1].Equals("0")) { } //删除 else if (param[1].Equals("1")) { List <string> ids = new List <string>() { item.Id.ToString(), }; SystemManageNetOperation.DeleteClientWecome(DeletelientWecomeResult, ids); // this.mainDataTable.Rows.RemoveAt(rowhandle); wecomeitems.RemoveAt(rowhandle); } }
private void InitAreaUI() { this.areaScrollPanel.Hide(); this.hScrollBar1.Hide(); this.mainDataTable.Clear(); this.currentComsPanel.Controls.Clear(); this.selectArea = null; this.selectButtons.Clear(); this.panel1.Controls.Clear(); using (Graphics gra = CreateGraphics()) { for (int i = 0; i < this.areas.Count; i++) { StructDictItem item = this.areas[i]; Label area = new Label(); area.AutoSize = false; area.BackColor = Color.Transparent; area.ForeColor = N_AREA_F_COLOR; area.Text = item.GetItem(0); area.Click += AreaLabel_Click; area.Tag = i; area.TextAlign = ContentAlignment.MiddleCenter; area.Font = new Font("宋体", 18, GraphicsUnit.Pixel); area.Margin = new Padding(0); area.Paint += Area_Paint; this.panel1.Controls.Add(area); area.Dock = DockStyle.Left; SizeF size = gra.MeasureString(area.Text, area.Font); area.Size = new Size((int)size.Width + AREABTN_WITH, this.panel1.Size.Height); } } InitScollBar(); this.areaScrollPanel.Show(); }
//添加新行 private void AddNewRow(StructDictItem item) { DataRow row = this.mainDataTable.NewRow(); this.mainDataTable.Rows.Add(row); row[TitleList.Number.ToString()] = this.mainDataTable.Rows.Count + ""; row[TitleList.Type.ToString()] = item.GetItem(0); }
//设置界面 private void SetSetting() { StructDictItem item = this.items[0]; this.memberCheckEdit.Checked = int.Parse(item.GetItem(0)) == 1; this.memberMinuteText.Text = item.GetItem(1); this.temCheckEdit.Checked = int.Parse(item.GetItem(2)) == 1; this.temMinuteText.Text = item.GetItem(3); }
public static void UpdateSysInfo(DataResultBlock result, string parent, StructDictItem child) { List <StructDictItem> items = new List <StructDictItem>() { child, }; SysNetOperation.UpdateSysInfo(result, parent, items); }
//更新GridControl1 private void UpdateGridControlData(SCSysInfo info, DataTable table) { table.Clear(); for (int i = 0; i < info.ChildCount; i++) { StructDictItem item = info.GetChild(i); AddNewRow(item, table); } }
//按钮列的点击事件 public void ColumnButtonClick(object sender, ButtonPressedEventArgs e) { int rowhandle = this.gridView1.FocusedRowHandle; DataRow row = this.gridView1.GetDataRow(rowhandle); StructDictItem item = items[rowhandle]; MemberLevAddView view = new MemberLevAddView(item); ToolsManage.ShowForm(view, false, CloseMemberLevAddViewBlock); }
//添加新的一行 private void AddNewRow(StructDictItem item, DataTable table) { DataRow row = table.NewRow(); table.Rows.Add(row); row[TitleList.Number.ToString()] = table.Rows.Count; row[TitleList.MemberType.ToString()] = SysManage.GetMemberTypeName(item.GetItem(0)); row[TitleList.RechargeMoney.ToString()] = item.GetItem(1); row[TitleList.GiveMoney.ToString()] = item.GetItem(2); row[TitleList.ValidDay.ToString()] = item.GetItem(3) + "-" + item.GetItem(4); }
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 }
private void InitPushMsgUI(List <StructDictItem> temPushItems) { this.pushScrollView.Hide(); this.hScrollBar1.Hide(); this.panel1.Controls.Clear(); this.textBox1.Text = ""; this.selectPush = null; //更新右侧员工数据 for (int i = 0; i < this.gridView1.RowCount; i++) { DataRow row = this.gridView1.GetDataRow(i); row[TitleList.Check.ToString()] = false; } using (Graphics graphics = CreateGraphics()) { for (int i = 0; i < this.showPushItems.Count; i++) { StructDictItem item = this.showPushItems[i]; //判断之前是否改过内容 if (temPushItems != null) { int index = temPushItems.FindIndex(tem => tem.Id == item.Id && !tem.GetItem(1).Equals(item.GetItem(1))); if (index >= 0) { this.showPushItems[i] = temPushItems[index]; } } item = this.showPushItems[i]; Label pushLabel = new Label(); pushLabel.AutoSize = false; pushLabel.Dock = DockStyle.Left; pushLabel.BackColor = Color.Transparent; pushLabel.ForeColor = N_PUSH_F_COLOR; pushLabel.Text = item.GetItem(0); pushLabel.Click += PushButton_ButtonClick; pushLabel.Font = new Font("宋体", 18, GraphicsUnit.Pixel); pushLabel.Tag = item; pushLabel.Margin = new Padding(0); pushLabel.Paint += Button_Paint; pushLabel.TextAlign = ContentAlignment.MiddleCenter; SizeF sizeF = graphics.MeasureString(pushLabel.Text, pushLabel.Font); pushLabel.Size = new Size((int)sizeF.Width + PUSHBUTTON_W, this.panel1.Size.Height); this.panel1.Controls.Add(pushLabel); } } InitScollBar(); this.pushScrollView.Show(); }
//客户端基本设置结果 private void ClientInfoResult(ResultModel result) { System.Console.WriteLine("ClientInfoResult:" + result.pack); if (result.pack.Content.MessageType != 1) { return; } if (result.pack.Cmd == Cmd.CMD_SYS_INFO && result.pack.Content.ScSysInfo.Parent.Equals(SystemManageNetOperation.client)) { NetMessageManage.RemoveResultBlock(ClientInfoResult); this.Invoke(new RefreshUIHandle(delegate { this.clientItem = result.pack.Content.ScSysInfo.GetChild(0); RefreshClientUI(); })); } }
//获取所有勾选的id private List <string> GetCheckIds(GridView gridView, IList <StructDictItem> items) { List <string> ids = new List <string>(); //获取所有勾选的column for (int i = 0; i < gridView.RowCount; i++) { DataRow row = gridView.GetDataRow(i); string value = row[TitleList.Check.ToString()].ToString(); if (value.Equals("True")) { StructDictItem item = items[i]; ids.Add(item.Id.ToString()); } } return(ids); }
private void SetSetting() { StructDictItem defaultItem = this.items[0]; StructDictItem activeItem = this.items[1]; this.dRechargeText.Text = defaultItem.GetItem(0); this.dRechargeItText.Text = defaultItem.GetItem(1); this.staffPjItText.Text = defaultItem.GetItem(2); this.netBarPjItText.Text = defaultItem.GetItem(3); this.logItText.Text = defaultItem.GetItem(4); this.bingingItText.Text = defaultItem.GetItem(5); this.aRechargeText.Text = activeItem.GetItem(0); this.aRechargItText.Text = activeItem.GetItem(1); endComboBoxEdit.Text = activeItem.GetItem(3); startComboBoxEdit.Text = activeItem.GetItem(2); }
//添加奖励 private void AddAward_Click(object sender, EventArgs e) { if (sender.Equals(this.nAddButton)) { StructDictItem item = GetAwardSetting(0); if (item != null) { RateManageNetOperation.AddAwardManage(AddAwardResult, item); } } else if (sender.Equals(this.mAddButton)) { StructDictItem item = GetMemberAwardSetting(0); if (item != null) { RateManageNetOperation.AddMemberDayAwardManage(AddMemberDayAwardResult, item); } } }
//保存基本设置 private void simpleButton1_Click(object sender, EventArgs e) { string item1 = this.textEdit1.Text; string item2 = this.textEdit2.Text; string item3 = this.textEdit3.Text; string item4 = this.textEdit4.Text; string item5 = this.textEdit5.Text; StructDictItem.Builder item = new StructDictItem.Builder(clientItem); item.ClearItem(); item.AddItem(item1); item.AddItem(item2); item.AddItem(item3); item.AddItem(item4); item.AddItem(item5); this.clientItem = item.Build(); SystemManageNetOperation.UpdateClient(UpdateClientResult, clientItem); }
public static void AddSysInfo(DataResultBlock resultBlock, string parent, StructDictItem item) { CSAddSysInfo.Builder info = new CSAddSysInfo.Builder() { Parent = parent, Child = item, }; MessageContent.Builder content = new MessageContent.Builder(); content.SetMessageType(1); content.SetCsAddSysInfo(info); SendModel send = new SendModel() { cmd = Cmd.CMD_SYS_ADD, content = content.Build() }; NetMessageManage.SendMsg(send, resultBlock); }
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); } }
//标签点击 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; } }
public static void UpdateIntegralDefaultSetting(DataResultBlock resultBlock, StructDictItem child) { SysNetOperation.UpdateSysInfo(resultBlock, integralParent, child); }
//会员日充值奖励添加 public static void AddMemberDayAwardManage(DataResultBlock resultBlock, StructDictItem item) { SysNetOperation.AddSysInfo(resultBlock, memberDayAwardParent, item); }
//会员日充值奖励更新 public static void UpdateMemberDayAwardManage(DataResultBlock resultBlock, StructDictItem child) { SysNetOperation.UpdateSysInfo(resultBlock, memberDayAwardParent, child); }
public AreaTypeModel(StructDictItem item) { this.areaId = item.Code; this.areaName = item.GetItem(0); }
public ProductTypeModel(StructDictItem item) { this.typeId = item.Code; this.typeName = item.GetItem(0); }
public MemberTypeModel(StructDictItem item) { this.typeId = item.Code; this.typeName = item.GetItem(0); this.payMoney = item.GetItem(1); }
public static void UpdateOtherSetting(DataResultBlock resultBlock, StructDictItem child) { SysNetOperation.UpdateSysInfo(resultBlock, otherParent, child); }
public static void UpdateMemberLvSetting(DataResultBlock resultBlock, StructDictItem child) { SysNetOperation.UpdateSysInfo(resultBlock, lvParent, child); }
public static void AddMemberLv(DataResultBlock resultBlock, StructDictItem child) { SysNetOperation.AddSysInfo(resultBlock, lvParent, child); }
public static void AddArea(DataResultBlock resultBlock, StructDictItem item) { SysNetOperation.AddSysInfo(resultBlock, areaParent, item); }