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

            sdjls_sbpjb obj = MainHelper.PlatformSqlMap.GetOneByKey<sdjls_sbpjb>(treeList1.FocusedNode["ID"]);
            if (obj == null)
                return;
            try {
                if (ExportToExcel("送电线路评级", "", obj) < 1) return;

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

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

                try {
                    if (ExportToExcel("送管22送电线路设备评级表.xls", "", pj) < 1) return;

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

                }
            }

        }