Example #1
0
        private void button5_Click(object sender, EventArgs e)
        {
            if (dataGridView1.CurrentCell == null)
            {
                return;
            };

            int sltRow = dataGridView1.CurrentCell.RowIndex;

            string strStatus = dataGridView1.Rows[sltRow].Cells["注册状态"].Value.ToString();

            if (strStatus == "已注册") {

                string CorpID = dataGridView1.Rows[sltRow].Cells["企业号"].Value.ToString();
                string Pwd = dataGridView1.Rows[sltRow].Cells[3].Value.ToString();

                try
                {
                    Dxt.LinkWS LinkWs = new Dxt.LinkWS();
                    int ReS = LinkWs.SelSum(CorpID.Trim(), Pwd.Trim());
                    if (ReS >= 0)
                    {

                        MessageBox.Show("还剩" + ReS.ToString() + "条");
                    }
                    else if (ReS == -1)
                    {
                        MessageBox.Show("帐号未注册!");
                    }
                    else if (ReS == -2)
                    {
                        MessageBox.Show("其他错误!");
                    }
                    else if (ReS == -3)
                    {
                        MessageBox.Show("帐号密码不匹配!");
                    }
                }
                catch (System.Net.WebException WebExcp)
                {
                    MessageBox.Show("网络错误,无法连接到服务器!");
                }
                
            } else {
                MessageBox.Show("请检查注册状态", "警告信息", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;     
            }
        }