Example #1
0
 private void btAdds_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (string.IsNullOrEmpty(parentID))
     {
         MsgBox.ShowWarningMessageBox("请先选择一个变电所!");
         return;
     }
     frm_xdjl frm = new frm_xdjl();
     bdjl_xdjl xdjl = new bdjl_xdjl();
     xdjl.OrgCode = parentID;
     xdjl.sdsj = DateTime.Now;
     xdjl.xdsj = DateTime.Now;
     try
     {
         xdjl.c1 = Client.ClientHelper.PlatformSqlMap.GetOne<mOrg>("where OrgCode='" + parentID + "'").OrgName;
         frm.RowData = xdjl;
     }
     catch
     {
         MsgBox.ShowWarningMessageBox("单位代码错误!");
         return;
     }
     if (frm.ShowDialog() == DialogResult.OK)
     {
         Client.ClientHelper.PlatformSqlMap.Create<bdjl_xdjl>(frm.RowData);
         RefreshGridData("");
     }
 }
Example #2
0
 private void btEdits_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (gridView1.GetFocusedRow() == null)
         return;
     bdjl_xdjl xdjl = gridView1.GetFocusedRow() as bdjl_xdjl;
     frm_xdjl frm = new frm_xdjl();
     frm.RowData = xdjl;
     if (frm.ShowDialog() == DialogResult.OK)
     {
         Client.ClientHelper.PlatformSqlMap.Update<bdjl_xdjl>(frm.RowData);
         RefreshGridData("");
     }
 }