Пример #1
0
 public void Show(sdjls_sbpjb obj) {
     _pjobject = obj;
     //this.Show();
 }
Пример #2
0
        void treeViewOperator_CreatingObject(sdjls_sbpjb newobj) {

        }
Пример #3
0
 void treeViewOperator_AfterAdd(sdjls_sbpjb newobj) {
     if (AfterAdd != null)
         AfterAdd(treeList1, newobj);
 }
Пример #4
0
 void treeViewOperator_AfterDelete(sdjls_sbpjb newobj) {
     if (AfterDelete != null)
         AfterDelete(treeList1, newobj);
 }
Пример #5
0
        public static int ExportToExcel(string title, string dw, sdjls_sbpjb pj17) {
            string fname = Application.StartupPath + "\\00记录模板\\送管22送电线路设备评级表.xls";
            DSOFramerControl dsoFramerWordControl1 = new DSOFramerControl();
            string outfname = Path.GetTempFileName() + ".xls";
            File.Copy(fname, outfname);
            dsoFramerWordControl1.FileOpen(outfname);
            Microsoft.Office.Interop.Excel.Worksheet xx;
            Excel.Workbook wb = dsoFramerWordControl1.AxFramerControl.ActiveDocument as Excel.Workbook;        
            ExcelAccess ex = new ExcelAccess();
            ex.MyWorkBook = wb;
            ex.MyExcel = wb.Application;
            sd_xl xl = MainHelper.PlatformSqlMap.GetOne<sd_xl>(" where LineCode='" + pj17.LineCode + "'");
            try {
                if (xl == null) {
                    MsgBox.ShowWarningMessageBox("数据出错,没找到线路");
                    return -1;
                }
                string strLinexh = xl.WireType;//导线型号
                
                //IList<sd_gt> gtlis = Client.ClientHelper.PlatformSqlMap.GetList<sd_gt>(" Where LineCode='" + xl.LineCode + "' order by gtcode");
                int gtcount = Client.ClientHelper.PlatformSqlMap.GetRowCount<sd_gt>(" Where LineCode='" + xl.LineCode + "'");
                ex.ActiveSheet(1);
                //设置线路值
                ex.SetCellValue(xl.LineName, 3, 3);
                ex.SetCellValue(xl.LineVol, 3, 8);
                ex.SetCellValue(xl.WireLength.ToString(), 3, 11);
                ex.SetCellValue(xl.InDate.Year + "年" + xl.InDate.Month + "月", 3, 13);
                //ex.SetCellValue(xl.InDate.Year.ToString(), 4, 9);
                //ex.SetCellValue(xl.InDate.Month.ToString(), 4, 11);
                //评级日期
                ex.SetCellValue(DateTime.Now.Year + "年" + DateTime.Now.Month + "月" + DateTime.Now.Day + "日", 4, 3);

                //杆塔
                ex.SetCellValue(gtcount.ToString(), 5, 3);//合计
                ex.SetCellValue(gtcount.ToString(), 6, 3);//一类
                //导地线
                ex.SetCellValue(xl.WireLength.ToString(), 9, 3);//合计
                ex.SetCellValue(xl.WireLength.ToString(), 10, 3);//一类
                //绝缘子
                string sql = "in (";
                //foreach (sd_gt gt in gtlis)
                //{ 
                //    sql+="'"+gt.gtID+"',";
                //}
                //sql = sql.Substring(0, sql.Length - 1) + ")";
                sql = "in (select gtid from sd_gt Where LineCode='" + xl.LineCode + "' )";
                string strSQL = "select  sbid from sd_gtsb Where  gtID " + sql;
                
                IList jdzzList = Client.ClientHelper.PlatformSqlMap.GetList("SelectOneStr", strSQL);
               
                   
                strSQL += "  and ("+getNamesql()+")";
                

                IList jyuzlist = Client.ClientHelper.PlatformSqlMap.GetList("SelectOneStr", strSQL);

                ex.SetCellValue(jyuzlist.Count.ToString(), 13, 3);
                ex.SetCellValue(jyuzlist.Count.ToString(), 14, 3);
                //接地装置
                ex.SetCellValue(jdzzList.Count.ToString(), 17, 3);
                ex.SetCellValue(jdzzList.Count.ToString(), 18, 3);

                //其它
                
                //评定等级
                ex.SetCellValue("一级", 24, 3);
                //评级负责人
                if (MainHelper.User != null)
                {
                    ex.SetCellValue(MainHelper.User.UserName, 25, 3);
                }
            } catch (Exception exmess) {
                MsgBox.ShowTipMessageBox(exmess.Message.ToString());
            }
            dsoFramerWordControl1.FileSave();
            pj17.BigData = dsoFramerWordControl1.FileDataGzip;
            dsoFramerWordControl1.FileClose();
            dsoFramerWordControl1.Dispose();
            //#endregion
            //System.Diagnostics.Process.Start(outfname);
            return 1;
        }
Пример #6
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);

                }
            }

        }