コード例 #1
0
        private void cmdadd_Click(object sender, EventArgs e)
        {
            newzaminforoshiform qqf = new newzaminforoshiform(0);

            qqf.ShowDialog();
            BindData();
        }
コード例 #2
0
        private void cmdedit_Click(object sender, EventArgs e)
        {
            if (grid1.SelectedRows.Count == 0)
            {
                MessageBox.Show("یک سطر را انتخاب کنید");
            }
            else
            {
                DataRowView         drv = (DataRowView)grid1.SelectedRows[0].DataBoundItem;
                newzaminforoshiform qqf = new newzaminforoshiform(1);

                qqf.id     = (int)drv.Row["id"];
                qqf.adress = (drv.Row["adress"] != System.DBNull.Value ? (string)drv.Row["adress"] : "");

                qqf.gheymat  = (drv.Row["gheymat"] != System.DBNull.Value ? (string)drv.Row["gheymat"] : "");
                qqf.kharidar = (drv.Row["namekharidar"] != System.DBNull.Value ? (string)drv.Row["namekharidar"] : "");
                qqf.saheb    = (drv.Row["namesaheb"] != System.DBNull.Value ? (string)drv.Row["namesaheb"] : "");
                qqf.tarikh   = (drv.Row["tarikh"] != System.DBNull.Value ? (string)drv.Row["tarikh"] : "");
                qqf.ShowDialog();

                BindData();
            }
        }