takvim

mail@pastecode.io avatar
unknown
csharp
2 months ago
2.0 kB
3
Indexable
Never
 {
        private SchedulerStorage schedulerStorage1;

        public SL_Takvim()
        {
            InitializeComponent();

            CultureInfo culture = CultureInfo.CreateSpecificCulture("tr");
            Thread.CurrentThread.CurrentUICulture = culture;
            Thread.CurrentThread.CurrentCulture = culture; 

            schedulerStorage1 = new SchedulerStorage();
            schedulerControl1.Storage = schedulerStorage1;

            // Personel ve Randevu verilerini çek
            LoadPersonelData();
            //LoadRandevuData();
        }
        class CustomResourceItem : ResourceBase
        {
            public int Id { get; set; }
        }

    private void LoadPersonelData()
    {
        try
        {
            DataTable personelTable = DB.SelectSql("sl_personel", "UniqueID, ResourceID, ResourceName, Color", "GUZEL", null, null, null);

            foreach (DataRow row in personelTable.Rows)
            {
                int uniqueID = Convert.ToInt32(row["UniqueID"]);
                string resourceID = row["ResourceID"].ToString();
                string resourceName = row["ResourceName"].ToString();
                string color = row["Color"].ToString();
                   
                // Use ResourceItem directly for resources
                ResourceItem resourceItem = new ResourceItem();
                CustomResourceItem resourceItems = new CustomResourceItem();
                resourceItems.Id = uniqueID;
                resourceItem.Caption = resourceName;
                resourceItem.Color = System.Drawing.ColorTranslator.FromHtml(color);
                schedulerStorage1.Resources.Items.Add(resourceItem);
            }
        }
        catch (Exception ex)
        {
            MessageBox.Show("An error occurred while loading personnel data. Please contact support for assistance.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
    }
Leave a Comment