示例#1
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            //LIC_KIHD_MW.Policy result = new LIC_KIHD_MW.Policy();//need MW
            LIC_KIHD_MW.Agent agent   = new LIC_KIHD_MW.Agent("", "", "", "");
            string            policyN = ""; //need MW

            this.View.UseColumnTextForButtonValue = true;
            this.View.Text = "View";

            if (e.ColumnIndex == dataGridView1.Columns["View"].Index)
            {
                policyN = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
                string[] searchInfo = agent.searchOnClick(policyN);
                if (searchInfo[21] == "A")
                {
                    Policyinfo infoPage = new Policyinfo(searchInfo, policyN);
                    infoPage.ShowDialog();
                }
                else if (searchInfo[21] == "D")
                {
                    DelinquentPolicyInfo delinquent = new DelinquentPolicyInfo(searchInfo, policyN);
                    delinquent.ShowDialog();
                }
                else if (searchInfo[21] == "C")
                {
                    InactivePolicy inactive = new InactivePolicy(searchInfo, policyN);
                    inactive.ShowDialog();
                }
                else if (searchInfo[21] == "I")
                {
                    InactivePolicy inactive = new InactivePolicy(searchInfo, policyN);
                    inactive.ShowDialog();
                }
            }
        }
示例#2
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            string policyN;

            this.ViewButton.UseColumnTextForButtonValue = true;
            this.ViewButton.Text = "View";
            LIC_KIHD_MW.Agent manager = new LIC_KIHD_MW.Agent(barForAgentFirstName.Text, BarForAgentLastName.Text, "", agentID);
            if (e.ColumnIndex == dataGridView1.Columns["ViewButton"].Index)
            {
                policyN = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
                string[] searchInfo = manager.searchOnClick(policyN);
                if (searchInfo[21] == "A")
                {
                    Policyinfo infoPage = new Policyinfo(searchInfo, policyN);
                    infoPage.ShowDialog();
                }
                else if (searchInfo[21] == "D")
                {
                    DelinquentPolicyInfo delinquent = new DelinquentPolicyInfo(searchInfo, policyN);
                    delinquent.ShowDialog();
                }
                else if (searchInfo[21] == "C")
                {
                    InactivePolicy inactive = new InactivePolicy(searchInfo, policyN);
                    inactive.ShowDialog();
                }
                else if (searchInfo[21] == "I")
                {
                    InactivePolicy inactive = new InactivePolicy(searchInfo, policyN);
                    inactive.ShowDialog();
                }
            }
        }