コード例 #1
0
        private void toolStripButtonMod_Click(object sender, EventArgs e)
        {
            if (dgvMain.CurrentRow != null)
            {
                int AssociatorID = Convert.ToInt32(dgvMain.CurrentRow.Cells["ColumnAssociatorID"].Value);

                FormAssociatorItem dlg = new FormAssociatorItem();

                dlg.m_AssociatorItem.AssociatorID = AssociatorID;
                dlg.m_AssociatorItem.CardID       = dgvMain.CurrentRow.Cells["ColumnCardID"].Value.ToString();
                dlg.m_AssociatorItem.CardPwd      = dgvMain.CurrentRow.Cells["ColumnCardPwd"].Value.ToString();
                dlg.m_AssociatorItem.ClassifyID   = Convert.ToInt32(dgvMain.CurrentRow.Cells["ColumnClassifyID"].Value);

                dlg.m_AssociatorItem.Associator   = dgvMain.CurrentRow.Cells["ColumnAssociator"].Value.ToString();
                dlg.m_AssociatorItem.IdentityCard = dgvMain.CurrentRow.Cells["ColumnIdentityCard"].Value.ToString();
                dlg.m_AssociatorItem.Address      = dgvMain.CurrentRow.Cells["ColumnAddress"].Value.ToString();
                dlg.m_AssociatorItem.Company      = dgvMain.CurrentRow.Cells["ColumnCompany"].Value.ToString();
                dlg.m_AssociatorItem.PostCode     = dgvMain.CurrentRow.Cells["ColumnPostCode"].Value.ToString();

                dlg.m_AssociatorItem.Phone       = dgvMain.CurrentRow.Cells["ColumnPhone"].Value.ToString();
                dlg.m_AssociatorItem.MobilePhone = dgvMain.CurrentRow.Cells["ColumnMobilePhone"].Value.ToString();
                try
                {
                    dlg.m_AssociatorItem.Surplus  = Convert.ToDouble(dgvMain.CurrentRow.Cells["ColumnSurplus"].Value);
                    dlg.m_AssociatorItem.Integral = Convert.ToInt32(dgvMain.CurrentRow.Cells["ColumnIntegral"].Value);

                    dlg.m_AssociatorItem.EndDate = Convert.ToDateTime(dgvMain.CurrentRow.Cells["ColumnEndDate"].Value);
                }
                catch
                {
                }
                dlg.m_AssociatorItem.Remark = dgvMain.CurrentRow.Cells["ColumnRemark"].Value.ToString();

                dlg.ShowDialog();
            }
        }
コード例 #2
0
        private void toolStripButtonAdd_Click(object sender, EventArgs e)
        {
            FormAssociatorItem dlg = new FormAssociatorItem();

            dlg.ShowDialog();
        }