Exemple #1
0
        private void barCreat_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
            if (treeList1.FocusedNode == null)
                return;

            PJ_17 obj = MainHelper.PlatformSqlMap.GetOneByKey<PJ_17>(treeList1.FocusedNode["ID"]);
            if (obj == null)
                return;
            try {
                if (ExportToExcel("高压配电线路条图", "", obj) < 1) return;

                frm17Template frm = new frm17Template();
                frm.pjobject = obj;
                if (frm.ShowDialog() == DialogResult.OK) {
                    Client.ClientHelper.PlatformSqlMap.Update<PJ_17>(frm.pjobject);
                    //MessageBox.Show("保存成功");
                }
            } catch (Exception ex) {
                MsgBox.ShowException(ex);
                if (ex.Message.IndexOf("无效") > -1) {
                    SelectorHelper.Execute("taskkill /im EXCEL.EXE /f");
                }
            }
        }
Exemple #2
0
 private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
     if (treeList1.FocusedNode != null) {
         frm17Template frm = new frm17Template();
         PJ_17 obj = MainHelper.PlatformSqlMap.GetOneByKey<PJ_17>(treeList1.FocusedNode["ID"]);
         if (obj == null)
             return;
         frm.pjobject = obj;
         if (frm.ShowDialog() == DialogResult.OK) {
             Client.ClientHelper.PlatformSqlMap.Update<PJ_17>(frm.pjobject);
             //MessageBox.Show("保存成功");
         }
     }
 }
Exemple #3
0
        private void btReAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
            if (btXlList.EditValue == null || btXlList.EditValue.ToString() == "") {
                return;
            }
            PS_xl xl = btXlList.EditValue as PS_xl;
            PJ_17 pj = new PJ_17();
            pj.CreateDate = DateTime.Now;
            pj.CreateMan = MainHelper.User.UserName;
            pj.LineName = xl.LineName;
            pj.LineCode = xl.LineCode;
            pj.OrgCode = xl.OrgCode;
            pj.OrgName = parentObj.OrgName;
            pj.Remark = "";
            MainHelper.PlatformSqlMap.Create<PJ_17>(pj);

            InitData();
            //if (MsgBox.ShowAskMessageBox("是否马上生成条图") == DialogResult.OK)
            {

                try {
                    if (ExportToExcel("高压配电线路条图", "", pj) < 1) return;

                    frm17Template frm = new frm17Template();
                    frm.pjobject = pj;
                    if (frm.ShowDialog() == DialogResult.OK) {
                        Client.ClientHelper.PlatformSqlMap.Update<PJ_17>(frm.pjobject);
                        //MessageBox.Show("保存成功");
                    }
                } catch (Exception ex) {
                    MsgBox.ShowException(ex);

                }
            }

        }