void sendNToolStripMenuItem_Click(object sender, EventArgs e) { using (var dlg = new SendItemDialog(this, R.InputSendCount)){ if (dlg.ShowDialog() == DialogResult.OK) { int count = dlg.Count; SendSelectItems(count); } } }
private void ContentMenuSendItemXClick(object sender, EventArgs e) { using (SendItemDialog dlg = new SendItemDialog(this)){ if (dlg.ShowDialog() == DialogResult.OK) { int count = dlg.Count; SendSelectItems(count); } } }
private void SendSItem(ItemClassInfo item, int count) { if (item == null) { return; } MessageBox.Show(item.Name); using (SendItemDialog dlg = new SendItemDialog(this)){ dlg.Title = "请输入一个数字(将替换" + item.Name + "的{0})"; if (dlg.ShowDialog() == DialogResult.OK) { int var = dlg.Count; if (this.SendItem(CurUser, count, item.ItemClass, item.Name, "" + var) > 0) { log("发送" + item.Name + "成功"); } } } }
private void SendSelectItems(int count) { if (!CheckUser()) { return; } ItemClassInfo[] items = SearchListView.GetSelectItems <ItemClassInfo>(); if (items == null || items.Length == 0) { return; } foreach (var item in items) { int val = 0; if (item.Name != null && item.Name.Contains("{0}")) { using (var dlg = new SendItemDialog(this, R.InputNumber)){ if (dlg.ShowDialog() == DialogResult.OK) { val = dlg.Count; } } //弹框输入 if (val < 0) { continue; } } string extra = val > 0? "" + val:null; if (this.SendItem(CurUser, count, item.ItemClass, item.Name, extra) > 0) { log("发送" + item.Name + "成功"); } else { log("发送" + item.Name + "失败"); } } ReadMails(); }