Esempio n. 1
0
        private void btnBatchCommit_Click(object sender, EventArgs e)
        {
            if (listView1.CheckedItems.Count == 0)
            {
                return;
            }
            var ids = new List <long>();

            for (int i = 0; i < listView1.CheckedItems.Count; ++i)
            {
                ids.Add(Convert.ToInt64(listView1.CheckedItems[i].Text));
            }
            var dlg = new BatchProcessDlg(ids);

            dlg.StartPosition = FormStartPosition.CenterParent;
            var d = new Dictionary <string, object>();

            d["remark"] = "批量操作";
            d["action"] = Commons.NormalNumberStr(((Button)listView1.Tag).Name);

            dlg.RunSingle += (id) => CrmInvestor.SaveRemark(id, d).Result;
            dlg.ShowDialog();
            Updatetable1();
            ((Button)listView1.Tag).PerformClick();
        }
Esempio n. 2
0
 private void GetAllPlans(TabPage tabPage)
 {
     m_ckbPlans = new List <Tuple <int, CheckBox> >();
     foreach (var ctl in tabPage.Controls)
     {
         if (ctl is CheckBox)
         {
             var ckb = (CheckBox)ctl;
             m_ckbPlans.Add(Tuple.Create(Convert.ToInt32(Commons.NormalNumberStr(ckb.Name)), ckb));
         }
     }
 }
Esempio n. 3
0
        private async void Details(object sender, bool showBatch = false)
        {
            SetBtnsEnabled(false);
            listView1.Items.Clear();
            listView1.Tag = sender;
            if (showBatch)
            {
                btnBatchCommit.Visible = true;
                ckbAll.Visible         = true;
            }
            else
            {
                btnBatchCommit.Visible = false;
                ckbAll.Visible         = false;
            }

            ckbAll.Checked = false;

            var r = new Dictionary <string, object>();

            r["action"] = Commons.NormalNumberStr(((Button)sender).Name);
            r["u-name"] = m_uName;

            var p = await CrmInvestor.GetInvestorByStatus(r);

            if (p.IsOk)
            {
                var dl = JArray.Parse(p.AsString).ToList();
                foreach (var d in dl)
                {
                    ListViewItem lvi = new ListViewItem();
                    lvi.Text = d["ciId"].ToStdString();
                    lvi.SubItems.Add(d["loginName"].ToStdString());
                    lvi.SubItems.Add(d["realName"].ToStdString());
                    lvi.SubItems.Add(d["mobile"].ToStdString());
                    lvi.SubItems.Add(CrmCommons.PrLevels.FindByValue(d["prLevel"].ToStdString()));

                    listView1.Items.Add(lvi);
                }
            }
            else
            {
                Commons.ShowResultErrorBox(this, p);
            }
            SetBtnsEnabled(true);
        }
Esempio n. 4
0
        private async void Updatetable1()
        {
            var r = new Dictionary <string, object>();

            r["u-name"] = m_uName;
            var p = await CrmInvestor.GetNumInStatus(r);

            if (p.IsOk)
            {
                var dl = p.AsDictionary;
                foreach (var btn in panel2.Controls)
                {
                    if (btn is Button)
                    {
                        ((Button)btn).Text = string.Format(Convert.ToString(((Button)btn).Tag), dl.GetOrDefault <string>(Commons.NormalNumberStr(((Button)btn).Name)));
                    }
                }
            }
            else
            {
                Commons.ShowResultErrorBox(this, p);
            }
        }