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