Exemple #1
0
 //增加
 private void tsbAdd_Click(object sender, EventArgs e)
 {
     using (FrmAppPropEdit dlg = new FrmAppPropEdit()) {
         if (dlg.ShowDialog() == DialogResult.OK)
         {
             RecordService.Create <SAppProps>(dlg.DataObject);
             RefreshData();
         }
     }
 }
Exemple #2
0
 //修改
 private void tsbEdit_Click(object sender, EventArgs e)
 {
     if (dataGridView1.CurrentRow != null)
     {
         int       id   = (int)dataGridView1.CurrentRow.Cells["propid"].Value;
         SAppProps data = RecordService.GetOneByKey <SAppProps>(id);
         using (FrmAppPropEdit dlg = new FrmAppPropEdit()) {
             dlg.DataObject = data;
             if (dlg.ShowDialog() == DialogResult.OK)
             {
                 RecordService.Update <SAppProps>(data);
                 RefreshData();
             }
         }
     }
 }