NEWS

[DEVEXPRESS] Hướng dẫn sử dụng Schedule Control hiển thị giờ làm việc nhân viên VB.NET

[DEVEXPRESS] Hướng dẫn sử dụng Schedule Control hiển thị giờ làm việc nhân viên VB.NET
Đăng bởi: Thảo Meo - Lượt xem: 14449 22:42:39, 22/06/2017DEVEXPRESS   In bài viết

Bài viết hôm nay, mình sẽ hướng dẫn các bạn sử dụng công cụ Schedule Control trong Devexpress bằng ngôn ngữ VB.NET, để hiển thị giờ ra vào làm việc của nhân viên.

Chức năng này có thể giúp bạn phần nào hiển thị cho phần mềm nhân sự có thể xem theo tháng làm việc của từng nhân viên trong công ty của mình.

Giao diện demo của ứng dụng:

Schedule Control Devexpress Vb.net

Source code VB.NET

Imports System.ComponentModel
Imports System.Text
Imports DevExpress.XtraScheduler


Partial Public Class Form1
    Shared Sub New()
        DevExpress.UserSkins.BonusSkins.Register()
        DevExpress.Skins.SkinManager.EnableFormSkins()
    End Sub
    Public Sub New()
        InitializeComponent()
    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        SchedulerControl2.ActiveViewType = DevExpress.XtraScheduler.SchedulerViewType.Month
        SchedulerControl2.OptionsCustomization.AllowInplaceEditor = DevExpress.XtraScheduler.UsedAppointmentType.None
        ' đặt load đầu tháng 
        SchedulerControl2.Start = New DateTime(2017, 6, 1)
        ' Hiển thị lịch làm việc thời gian nhân viên
        For i As Integer = 0 To 29
            Dim app As Appointment = SchedulerStorage1.CreateAppointment(AppointmentType.Normal)
            Dim start As New DateTime(2017, 6, 1 + i, 7, 30, 0)
            Dim [end] As New DateTime(2017, 6, 1 + i, 11, 30, 0)
            app.Start = start
            app.[End] = [end]
            app.Description = "Ca sáng"
            'SchedulerStorage1.Appointments.Labels.Clear()
            app.LabelKey = 3
            app.StatusKey = 1
            app.AllDay = False
            SchedulerStorage1.Appointments.Add(app)

            ' thời điểm 2
            Dim app2 As Appointment = SchedulerStorage1.CreateAppointment(AppointmentType.Normal)
            Dim start2 As New DateTime(2017, 6, 1 + i, 12, 30, 0)
            Dim [end2] As New DateTime(2017, 6, 1 + i, 16, 30, 0)
            app2.Start = start2
            app2.[End] = [end2]
            app2.Description = "Ca chiều"
            app2.LabelKey = 1
            'SchedulerStorage1.Appointments.Labels.Clear()
            'app2.AllDay = False
            'SchedulerStorage1.Appointments.Labels.Add(System.Drawing.Color.FromArgb((CInt((CByte(255)))), (CInt((CByte(194)))), (CInt((CByte(190))))), "Important", "&Important")

            SchedulerStorage1.Appointments.Add(app2)


        Next

    End Sub
End Class

Và dưới đây là bảng màu để cho các bạn set color label

table color devexpress schedule control

CHÚC CÁC BẠN THÀNH CÔNG!

THÔNG TIN TÁC GIẢ

BÀI VIẾT LIÊN QUAN

[DEVEXPRESS] Hướng dẫn sử dụng Schedule Control hiển thị giờ làm việc nhân viên VB.NET
Đăng bởi: Thảo Meo - Lượt xem: 14449 22:42:39, 22/06/2017DEVEXPRESS   In bài viết

CÁC BÀI CÙNG CHỦ ĐỀ

Đọc tiếp
.