을 사용하여 전체 달력 v 1.5.3을 MS SQL Server에 연결하는 방법 asp.net webforms 및 vb.net을 사용하여 SQL Server에 FullCalendar v1.4.2를 성공적으로 연결했습니다. v1.5.3으로 업데이트하고 싶지만 원래의 통합 코드가 더 이상 작동하지 않으며 수정 방법을 볼 수 없습니다.asp.net C#/VB
둘째, 끌어서 놓기 기능을 추가하여 asp.net에서 끌어서 놓기 데이터베이스를 업데이트 할 수 있도록 도와 드리고 싶습니다. 그러나 그 위치를 시작할 위치가 확실하지 않습니다. 다음과 같이
즉 V 1.4.2 근무 내가 가진 코드는 다음과 같습니다 나는이와 사투를 벌인거야
<script type="text/javascript" language="javascript">
$(document).ready(function() {
$('#calendar').fullCalendar({
header: {
left: 'prev, next today',
center: 'title',
right: 'month, basicWeek, basicDay'
},
events: "Calendar.asmx/EventList"
});
});
</script>
Imports System
Imports System.Data
Imports System.Web.Services
Imports System.Data.SqlClient
Imports System.Web.Services.Protocols
Imports System.ComponentModel
Imports System.Collections.Generic
Imports System.Web.UI.Page
<System.Web.Script.Services.ScriptService()> _
<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class Calendar
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function EventList(ByVal startDate As String, ByVal endDate As String) As String
' List to hold events
Dim events As List(Of CalendarDTO) = New List(Of CalendarDTO)()
Dim WebConfigConnection As String = ConfigurationManager.ConnectionStrings("FresheyeTimeTrackerConnectionString").ConnectionString
Dim query As String = "SELECT * FROM CORE_PROJECT"
Dim conn As New SqlConnection(WebConfigConnection)
Dim cmd As New SqlCommand(query, conn)
Dim da As New SqlDataAdapter(cmd)
Dim ds As New DataSet()
da.Fill(ds)
'If startDate > ToUnixTimespan(DateTime.Now) Then
'GoTo x
'End If
Dim starting As DateTime = FromUnixTimespan(startDate)
' Loop through events to be added
For i As Integer = 0 To ds.Tables(0).Rows.Count - 1
If String.IsNullOrEmpty(ds.Tables(0).Rows(i)("ProjectDeliveryDate").ToString()) Then
Else
' Create a new event and start to populate
Dim value As CalendarDTO = New CalendarDTO()
' Date is required to be in a unix format
value.StartDate = ToUnixTimespan(DateTime.Parse(ds.Tables(0).Rows(i)("ProjectAddedDate").ToString))
value.id = ds.Tables(0).Rows(i)("ProjectID").ToString()
value.title = ds.Tables(0).Rows(i)("ProjectTitle").ToString()
value.EndDate = ToUnixTimespan(DateTime.Parse(ds.Tables(0).Rows(i)("ProjectDeliveryDate").ToString))
events.Add(value)
End If
Next
' Serialize the return value so it can be decoded in java.
x:
Dim js As New System.Web.Script.Serialization.JavaScriptSerializer
Return js.Serialize(events)
End Function
Private Function ToUnixTimespan(ByVal d As DateTime) As Int64
Dim time As New TimeSpan()
time = d.ToUniversalTime().Subtract(New DateTime(1970, 1, 1, 0, 0, 0))
Return CType(Math.Truncate(time.TotalSeconds), Int64)
End Function
Private Function FromUnixTimespan(ByVal s As String) As DateTime
Dim time As DateTime = New DateTime(1970, 1, 1, 0, 0, 0)
Return time.AddSeconds(s)
End Function
End Class
@ 브라이언 ....에 게시 대답 몇 찾고 있어요 - 나 아니었지만, 나는 몇 가지 이유를 제시 할 수있는 이유 중 하나 might : 산문에서 문장이 없습니다. 코드 서식이 구문 형광펜을 손상 시켰습니다. vb.net 관련 질문에 대한 C# 태그. 이 질문에 여분의 불필요한 코드가 포함되어 있습니다. 고맙게도, 나는 그 대부분을 수정하기 위해 편집 할 수 있습니다. –
C# 또는 VB 언어로이 솔루션을 원했기 때문에 저는 C# 태그를 배치 했습니까? – user1243663