private bool m_mthGetParentNode(TreeNode tn) { clsDataBase Objtemp = tn.Tag as clsDataBase; if (Objtemp.ParentNodeName.Trim() == "") { return(true); } for (int i = 0; i < this.m_objViewer.treeView1.Nodes.Count; i++) { if (this.m_objViewer.treeView1.Nodes[i].Text.Trim() == Objtemp.ParentNodeName.Trim()) { this.m_objViewer.treeView1.Nodes[i].Nodes.Add(tn); return(false); } } TreeNode TempNode = new TreeNode(Objtemp.ParentNodeName.Trim()); TempNode.Nodes.Add(tn); this.m_objViewer.treeView1.Nodes.Add(TempNode); return(false); }
public bool insertData(DataRow r, ref string msg) { var sqlobj = new clsDataBase(); try { if (!sqlobj.SetbolConnection(this.conMiraiDBStr, ref msg)) { return(false); } var insertStr = ""; insertStr += " INSERT INTO [dbo].[Mirai_手動登録] "; insertStr += " ( "; insertStr += " [グループ] "; insertStr += " ,[有効] "; insertStr += " ,[予約日時] "; insertStr += " ,[予約Lat世界度] "; insertStr += " ,[予約Lon世界度] "; insertStr += " ,[No] "; insertStr += " ,[案内Lat世界度] "; insertStr += " ,[案内Lon世界度] "; insertStr += " ,[案内先到着日時] "; insertStr += " ,[予約住所] "; insertStr += " ,[案内住所] "; insertStr += " ,[案内名称] "; insertStr += " ) VALUES ( "; insertStr += " ' 4 '"; //[グループ] "; insertStr += " , ' 1 '"; //[有効] "; var YoyakuDateTime = (DateTime)r["YoyakuDateTime"]; var AnnaiDateTime = (DateTime)r["AnnaiYoyakudateTime"]; insertStr += " , '" + YoyakuDateTime + "'";//[予約日時] "; var KokLat = ((int)r["KokLatitude"]) / 36000.0; var KokLng = ((int)r["KokLongitude"]) / 36000.0; var AnnaiLat = ((int)r["AnnaiLatitude"]) / 36000.0; var AnnaiLng = ((int)r["AnnaiLongitude"]) / 36000.0; var KokLatW = 0.0; var KokLngW = 0.0; var AnnaiLatW = 0.0; var AnnaiLngW = 0.0; if (!vb_dll.cls緯度経度変換.bol緯度経度変換_日本to世界(KokLat, KokLng, ref KokLatW, ref KokLngW)) { //messageLog("緯度経度変換に失敗しました。:lat=" + KokLat + ", lng=" + KokLng); return(false); } if (!vb_dll.cls緯度経度変換.bol緯度経度変換_日本to世界(AnnaiLat, AnnaiLng, ref AnnaiLatW, ref AnnaiLngW)) { //messageLog("緯度経度変換に失敗しました。:lat=" + KokLat + ", lng=" + KokLng); return(false); } KokLatW = Math.Round(KokLatW, 6); KokLngW = Math.Round(KokLngW, 6); AnnaiLatW = Math.Round(AnnaiLatW, 6); AnnaiLngW = Math.Round(AnnaiLngW, 6); insertStr += " , '" + KokLatW + "'"; //[予約Lat世界度] "; insertStr += " , '" + KokLngW + "'"; //[案内住所] "; insertStr += " , " + r["cd_key"]; insertStr += " , '" + AnnaiLatW + "'"; insertStr += " , '" + AnnaiLngW + "'"; insertStr += " , '" + AnnaiDateTime + "'"; insertStr += " , '" + r["KokAddress"] + "'"; insertStr += " , '" + r["AnnaiAddress"] + "'"; insertStr += " , '" + r["AnnaiBuil"] + "'"; insertStr += " ) "; var inserres = sqlobj.GetshoExecuteNonQuery(insertStr, ref msg); if (sqlobj.prpbolError == false)//error { msg = "sqlobj.prpbolError == false"; return(false); } return(true); } catch (Exception ex) { return(false); } finally { sqlobj.SetEndConnection(); } }
public bool getData(ref string msg, string from, string to) { var sqlobjMIRAI = new clsDataBase(); try { if (!sqlobjMIRAI.SetbolConnection(this.conTsubameCTI, ref msg)) { msg = "アップロードに失敗しました"; return(false); } // from = "2017-09-13 06:40:00"; // to = "2017-09-13 06:41:00"; var sqlStr = "select y.cd_key,YoyakuDateTime,KokLatitude,KokLongitude,AnnaiLatitude,AnnaiLongitude,AnnaiYoyakudateTime,a.AnnaiAddress,a.AnnaiBuil,y.KokAddress" + " from tempAnnai a inner join yoyaku y on a.cd_key=y.AnnaiCd_key where AnnaiLatitude is not null and AnnaiLongitude is not null and YoyakuDateTime between '" + from + "' and '" + to + "'"; var tbl = sqlobjMIRAI.GetdtTableSelectData(sqlStr, ref msg); if (tbl == null) { msg = "予約データがありません"; return(false); } if (!sqlobjMIRAI.prpbolError) { msg = "アップロードに失敗しました"; return(false); } if (tbl.Rows.Count == 0) { msg = "予約データがありません"; return(false); } var errcount = 0; for (int i = 0; i < tbl.Rows.Count; i++) { var msgimport = ""; if (!insertData(tbl.Rows[i], ref msgimport)) { msg = "アップロードに失敗しました"; errcount++; continue; } } msg = "アップロードしました"; return(true); } catch (Exception) { msg = "アップロードに失敗しました"; return(false); } finally { sqlobjMIRAI.SetEndConnection(); } }
public void m_mthDoubleClick() { try { this.m_objViewer.Cursor = Cursors.WaitCursor; this.m_objViewer.btOpenImage.Tag = null; if (this.m_objViewer.treeView1.SelectedNode.Parent == null && this.m_objViewer.treeView1.SelectedNode.Parent.Tag == null) { return; } if (this.m_objViewer.treeView1.SelectedNode.Tag == null) { return; } objMain = this.m_objViewer.treeView1.SelectedNode.Parent.Tag as clsDataBase; objMD = this.m_objViewer.treeView1.SelectedNode.Tag as clsMainData_VO; if (objMain is clsPacssReport) { clsPacssReport objPacss = (clsPacssReport)objMain; this.m_objViewer.btOpenImage.Tag = objPacss.objItem; this.m_objViewer.printPreviewControl.Document = objPacss.m_mthGetPrintDocument(objMD); return; } if (objMain is clsLIS) { clsLIS objLis = (clsLIS)objMain; objLis.Document = this.m_objViewer.printDocument1; objLis.m_mthBeginPrint(objMD, null); } if (objMD != null && objMD.strRemark == "pacs" && !string.IsNullOrEmpty(objMD.strID)) { this.m_objViewer.webBrowser.Visible = true; this.m_objViewer.webBrowser.Dock = DockStyle.Fill; this.m_objViewer.printPreviewControl.Visible = false; this.m_objViewer.fpnlBL.Visible = false; if (string.IsNullOrEmpty(objMD.strName)) { this.m_objViewer.webBrowser.Navigate(string.Empty); this.m_objViewer.lblPacsHint.Visible = true; } else { this.m_objViewer.webBrowser.Navigate(objMD.strName); this.m_objViewer.lblPacsHint.Visible = false; } this.m_objViewer.webBrowser.Tag = objMD.strID; } else if (objMD != null && objMD.strRemark == "病理" && !string.IsNullOrEmpty(objMD.strID)) { if (dicBL.ContainsKey(objMD.strID)) { this.m_objViewer.webBrowser.Visible = false; this.m_objViewer.printPreviewControl.Visible = false; this.m_objViewer.fpnlBL.Dock = DockStyle.Fill; this.m_objViewer.fpnlBL.Visible = true; Image img = dicBL[objMD.strID]; this.m_objViewer.picBL.Image = img; this.m_objViewer.picBL.Width = img.Width; this.m_objViewer.picBL.Height = img.Height; } } else { this.m_objViewer.printPreviewControl.Visible = true; this.m_objViewer.printPreviewControl.Dock = DockStyle.Fill; this.m_objViewer.webBrowser.Visible = false; this.m_objViewer.lblPacsHint.Visible = false; this.m_objViewer.fpnlBL.Visible = false; this.m_objViewer.printPreviewControl.Document = this.m_objViewer.printDocument1; } } catch { } finally { this.m_objViewer.Cursor = Cursors.Default; } }