Subversion Repository Public Repository

17001_SKYPRO

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 240 vs 241 for /trunk/03.Source/SkySolution/Sky.Reports/Forms/frmScheduler.cs

Diff revisions: vs.
  @@ -27,10 +27,14 @@
27 27 schedulerControl1.DayView.TimeScale = new TimeSpan(0, 15, 0);
28 28 schedulerControl1.DayView.VisibleTime = new TimeOfDayInterval(new TimeSpan(8, 00, 0), new TimeSpan(22, 00, 0));
29 29 schedulerControl1.Start = DateTime.Now;
30 + // show date from now to now + 7
31 + schedulerControl1.LimitInterval = new TimeInterval(DateTime.Now, DateTime.Now.AddDays(7));
30 32 DayView view = (DayView)this.schedulerControl1.ActiveView;
31 33 view.TimeRulers[0].ShowMinutes = true;
32 34 //schedulerControl1.CustomizeDateNavigationBarCaption += scheduler_CustomizeDateNavigationBarCaption;
33 35 schedulerStorage1.Appointments.CustomFieldMappings.Add(new AppointmentCustomFieldMapping("ApptAddInfo", "AdditionalInfo", FieldValueType.String));
36 + schedulerStorage1.Appointments.CustomFieldMappings.Add(new AppointmentCustomFieldMapping("ServiceInfo", "ServiceAddInfo", FieldValueType.String));
37 + schedulerStorage1.Appointments.CustomFieldMappings.Add(new AppointmentCustomFieldMapping("TimeInfo", "TimeAddInfo", FieldValueType.String));
34 38 schedulerControl1.ActiveView.LayoutChanged();
35 39 }
36 40
  @@ -70,7 +74,7 @@
70 74 //this.schedulerControl1.Storage.Resources.Mappings.
71 75
72 76 // Appointment
73 - sql = "select * from Solichhen ";
77 + sql = "select x.*, y.Ten from Solichhen x join DM_HangHoa y on x.DichVuHenCode = y.Code ";
74 78 ds = cnndata.getData(sql);
75 79 List<EFAppointment> listAP = new List<EFAppointment>();
76 80 EFAppointment itemAP = null;
  @@ -86,6 +90,7 @@
86 90 itemAP.Location = row["DiaDiem"].ToString();
87 91 itemAP.Subject = row["Chung_Tu"].ToString();
88 92 itemAP.Customer = row["KhachHang"].ToString();
93 + itemAP.Services = row["Ten"].ToString();
89 94 itemAP.Time = row["GioHen"].ToString();
90 95 string[] gioS= itemAP.Time.Split(',');
91 96 itemAP.StartDate = Convert.ToDateTime(row["NgayHen"].ToString().Split(' ')[0] + " " + gioS[0]);
  @@ -99,10 +104,11 @@
99 104 {
100 105 apt = schedulerControl1.Storage.CreateAppointment(AppointmentType.Normal);
101 106 //apt.Subject = listAP[i].Subject;
102 - apt.CustomFields["ApptAddInfo"] = "Data custom field";
103 - apt.Location = listAP[i].Location;
107 + apt.CustomFields["ApptAddInfo"] = "Địa điểm: " +listAP[i].Location;
108 + apt.CustomFields["ServiceInfo"] = "DV: " + listAP[i].Services;
109 + //apt.Location = listAP[i].Location;
104 110 apt.Start = listAP[i].StartDate;
105 - apt.Description = "Thời gian: "+listAP[i].Time;
111 + apt.CustomFields["TimeInfo"] = "Thời gian: "+listAP[i].Time;
106 112 apt.End = listAP[i].EndDate;
107 113 apt.Subject ="KH: "+ listAP[i].Customer;
108 114 apt.ResourceId = listAP[i].ResourceID;
  @@ -182,16 +188,35 @@
182 188 private void MyMenuItemClick(object sender, EventArgs e)
183 189 {
184 190 //MessageBox.Show.(schedulerControl1)
191 + Appointment apt = sender as Appointment;
192 + //MessageBox.Show ("hop.nt: " + apt.Description);
185 193 String sql = "update SoLichHen set DaDen = '1' where ";
186 194 }
187 195
188 196 private void schedulerControl1_InitAppointmentDisplayText(object sender, AppointmentDisplayTextEventArgs e)
189 197 {
198 +
190 199 if (e.ViewInfo is VerticalAppointmentViewInfo && e.Appointment.CustomFields["ApptAddInfo"] != null)
191 200 {
192 201 e.Text = e.Appointment.Subject + "\r\n";
193 202 e.Text += "------\r\n";e.Text += e.Appointment.CustomFields["ApptAddInfo"].ToString();
194 203 }
204 +
205 + if (e.ViewInfo is VerticalAppointmentViewInfo && e.Appointment.CustomFields["ServiceInfo"] != null)
206 + {
207 + e.Text = e.Appointment.Subject + "\r\n";
208 + e.Text += "------\r\n"; e.Text += e.Appointment.CustomFields["ServiceInfo"].ToString();
209 + }
210 + if (e.ViewInfo is VerticalAppointmentViewInfo && e.Appointment.CustomFields["TimeInfo"] != null)
211 + {
212 + e.Text = e.Appointment.Subject + "\r\n";
213 + e.Text += "-----------\r\n"; e.Text += e.Appointment.CustomFields["TimeInfo"].ToString();
214 + }
215 + }
216 +
217 + private void schedulerControl1_AllowAppointmentEdit(object sender, AppointmentOperationEventArgs e)
218 + {
219 + MessageBox.Show("Custom!!!");
195 220 }
196 221
197 222 //public static void scheduler_CustomizeDateNavigationBarCaption(object sender, CustomizeDateNavigationBarCaptionEventArgs e)
  @@ -220,7 +245,7 @@
220 245 public int Status { get; set; }
221 246 public string Customer { get; set; }
222 247 public string Time { get; set; }
223 - //public string ResourceIDs { get; set; }
248 + public string Services { get; set; }
224 249 public long ResourceID { get; set; }
225 250 public string ReminderInfo { get; set; }
226 251 public string RecurrenceInfo { get; set; }