自定义日历+ SQL问题 [英] custom calendar + SQL problem

查看:86
本文介绍了自定义日历+ SQL问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿大师们,

我确实遇到了很大的问题,并一直在尝试解决日历问题,即无论何时选择日期,都会出现某种形式的弹出窗口或使用表格在约会说明和日期和时间上输入客户的姓名和姓氏.唯一的问题是我不知道该怎么做..我下载了Jose MenendezPóo的日历,该日历确实很吸引人,但无法启动sql _ modal/form弹出窗口.

我仅使用winforms并得出了查看新表格的结论,但是不知道如何在日历上显示该表格,因为我无法传递所选的日期和时间:S

谢谢你们!!!

Hey gurus,

I really have a huge problem and been trying to work my way around a calendar that whenever a date is picked a kinda of modalpop up or a form is used to enter the name and surname of the client on the description of appointment + date and time. The only problem is I have no idea how to do that .. I downloaded Jose Menendez Póo''s calendar which is fascinating really but cant get to work the sql _ modal / form pop up.

I am using winforms only and got to the conclusion where a new form is viewed but have no idea how to show it on it on the calendar as I cant pass the date and time selected :S

Thank you guys so much !!

推荐答案

出什么问题了?
在Winforms中,很容易出现模式弹出窗口:
What''s the problem?
In Winforms, a modal popup is easy:
MyForm f = new MyForm();
f.Date = myDateTimePicker.Value;
if (f.ShowDialog() == DialogResult.OK)
   {
   ...
   }

还是我误会了您要做什么?

Or am I misunderstanding what you are trying to do?


A您将使用的专业日历/议程视图 [ ^ ]是一篇很棒的文章.如果在我的程序之一中使用它,则需要解决一些错误,但总的来说,它确实很棒.

您必须在Calendar控件上收听LoadItems event,然后通过.SetViewRange(start, end)告诉控件您希望查看的日期范围.调用.SetViewRange时,将调用LoadItems事件.

在LoadItems事件中,根据需要将所有CalendarItem添加到Calendar控件.
查看文章中的下载源"链接.其中包含一个不错的演示"程序,可以使您很好地了解其工作原理.
A Professional Calendar/Agenda View That You Will Use[^] is a great article. If use it in one of my program, there are some bugs that need to be sorted out, but in general it works really great.

You have to listen for LoadItems event on the Calendar control and via .SetViewRange(start, end) you tell the control in what date range you wish to look at. When you call .SetViewRange the LoadItems event will be called.

In LoadItems event, you add all CalendarItem to the Calendar control as needed.
Look at the "Download source" link in the article. There is a good "Demo" program included, that should give you good idea of how it works.


calendar1.AllowItemEdit = true;
            calendar1.AllowNew = true;
            CalendarItem A;

            newAp ap = new newAp();

            ap.ShowDialog();


            if (ap.DialogResult == DialogResult.OK)
            {
                cha = ("Name: " + ap.Name + "\nSurname: " + ap.Name1 + "\n Description: " + ap.Description);
            }
            
            A = new CalendarItem(calendar1, e.Item.StartDate, e.Item.StartDate.AddMinutes(30d), cha);

            
            //class where I give the start date name etc and execute an SQL statement :)
            calendar1.Items.Add(A);
            calendar1.AllowItemEdit = false;
            e.Cancel = true;



我达到了我的期望:)无论如何,谢谢你们^^



I achieved what I was looking for :) thank you guys anyway ^^


这篇关于自定义日历+ SQL问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆