void SetupCurrentInfo(Pabo.Calendar.MonthCalendar cal) { //DateTime dt = new DateTime( ); month_schedule.Clear(); foreach (DataRow row in Local.session_schedule.Rows) { object o = row[2]; if (o.GetType() != typeof(DateTime)) { continue; } DateTime dt = (DateTime)o; MonthDayInfo mdi = new MonthDayInfo(); mdi.date = (DateTime)row[2]; mdi.session_sales_info_id = (int)row[3]; mdi.dr = row; DataRow[] session_sales_images = Local.session_info.images.Select("session_sales_info_id=" + mdi.session_sales_info_id); if (session_sales_images.Length > 0) { mdi.session_image_index = Local.imageList1.Images.IndexOfKey((string)session_sales_images[0][1]); // lookup name to get image index... } else { mdi.session_image_index = -1; } session_sales_images = Local.session_info.Select("session_sales_info_id=" + mdi.session_sales_info_id); mdi.session_sales_name = (string)session_sales_images[0][1]; month_schedule.Add(mdi); } }
void monthCalendar1_DayRender(object sender, Pabo.Calendar.DayRenderEventArgs e) { Pabo.Calendar.MonthCalendar cal = (Pabo.Calendar.MonthCalendar)sender; //GetDateInfo(); //e.OwnerDraw = true; e.Graphics.DrawString("session 1", cal.Font, new SolidBrush(Color.Black), new Point(10, 10)); e.Graphics.DrawString("session 1", cal.Font, new SolidBrush(Color.Black), new Point(10, 20)); //throw new Exception( "The method or operation is not implemented." ); }
private void monthCalendar1_DaySelected(object sender, DaySelectedEventArgs e) { // don't edit unless edit is enabled. if (!EditEnable.Checked) { return; } Pabo.Calendar.MonthCalendar month = (Pabo.Calendar.MonthCalendar)sender; SelectedDatesCollection m_dates = month.SelectedDates; //current_date = Convert.ToDateTime( e.Days[0] ); for (int n = 0; n < m_dates.Count; n++) { DateTime dt = m_dates[n]; current_date = dt; int index = month_schedule.FindIndex(IsDate); MonthDayInfo day; if (index < 0) { day = new MonthDayInfo(); day.dr = Local.session_schedule.NewRow(); //day.dr[1] = current_session_sales[1]; day.dr["bingoday"] = current_date; Local.session_schedule.Rows.Add(day.dr); day.date = current_date; month_schedule.Add(day); } else { day = month_schedule[index]; } day.session_sales_info_id = current_session_sales_index; day.session_image_index = current_image_index; day.session_sales_name = current_session_name; day.dr["session_sales_info_id"] = current_session_sales_index; } DateItem[] di = month.Dates.DateInfo(Convert.ToDateTime(e.Days[0])); //Console.WriteLine( e.Days ); //SelectedDatesCollection m_dates = month.SelectedDates; }
private void monthCalendar1_DayQueryInfo_1(object sender, DayQueryInfoEventArgs e) { Pabo.Calendar.MonthCalendar month = (Pabo.Calendar.MonthCalendar)sender; //if( e.Date == current_date ) { current_date = e.Date; int day = month_schedule.FindIndex(IsDate); if (day >= 0) { if (month_schedule[day].session_image_index >= 0) { e.Info.ImageListIndex = month_schedule[day].session_image_index; } e.Info.Text = month_schedule[day].session_sales_name; } e.OwnerDraw = true; } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.monthCalendar = new Pabo.Calendar.MonthCalendar(); this.SuspendLayout(); // // monthCalendar // this.monthCalendar.ActiveMonth.Month = 2; this.monthCalendar.ActiveMonth.Year = 2006; this.monthCalendar.Culture = new System.Globalization.CultureInfo("en-US"); this.monthCalendar.Footer.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold); this.monthCalendar.Header.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold); this.monthCalendar.Header.TextColor = System.Drawing.Color.White; this.monthCalendar.ImageList = null; this.monthCalendar.Location = new System.Drawing.Point(88, 24); this.monthCalendar.MaxDate = new System.DateTime(2016, 2, 21, 12, 6, 57, 390); this.monthCalendar.MinDate = new System.DateTime(1996, 2, 21, 12, 6, 57, 390); this.monthCalendar.Month.BackgroundImage = null; this.monthCalendar.Month.Colors.FocusBackground = System.Drawing.Color.White; this.monthCalendar.Month.Colors.FocusDate = System.Drawing.Color.Black; this.monthCalendar.Month.Colors.FocusText = System.Drawing.Color.Black; this.monthCalendar.Month.Colors.SelectedDate = System.Drawing.Color.Black; this.monthCalendar.Month.Colors.SelectedText = System.Drawing.Color.Black; this.monthCalendar.Month.DateFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.monthCalendar.Month.TextFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.monthCalendar.Name = "monthCalendar"; this.monthCalendar.SelectionMode = Pabo.Calendar.mcSelectionMode.MultiExtended; this.monthCalendar.Size = new System.Drawing.Size(368, 224); this.monthCalendar.TabIndex = 0; this.monthCalendar.Weekdays.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.monthCalendar.Weeknumbers.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); this.ClientSize = new System.Drawing.Size(608, 296); this.Controls.Add(this.monthCalendar); this.Name = "Form1"; this.Text = "Form1"; this.Load += new System.EventHandler(this.Form1_Load); this.ResumeLayout(false); }
void monthCalendar1_MonthChanged(object sender, MonthChangedEventArgs e) { Pabo.Calendar.MonthCalendar cal = (Pabo.Calendar.MonthCalendar)sender; SetupCurrentInfo(cal); }
private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.btnClose = new System.Windows.Forms.Button(); this.btnUpdate = new System.Windows.Forms.Button(); this.btnHelp = new System.Windows.Forms.Button(); this.monthCalendar1 = new Pabo.Calendar.MonthCalendar(); this.groupBox4 = new System.Windows.Forms.GroupBox(); this.groupBox5 = new System.Windows.Forms.GroupBox(); this.departmentTreeView = new EVSoft.HRMS.Controls.DepartmentTreeView(); this.btnCancel = new System.Windows.Forms.Button(); this.cboShift = new System.Windows.Forms.LookupComboBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.rbtOverTime = new System.Windows.Forms.RadioButton(); this.rbtHoliday = new System.Windows.Forms.RadioButton(); this.lblShift = new System.Windows.Forms.Label(); this.rbtWorkingDay = new System.Windows.Forms.RadioButton(); this.rbtNonWorkingDay = new System.Windows.Forms.RadioButton(); this.lblWorkingDay = new System.Windows.Forms.Label(); this.lblNonWorkingDay = new System.Windows.Forms.Label(); this.lblNonWorkingDayLegend = new System.Windows.Forms.Label(); this.lblWorkingDayLegend = new System.Windows.Forms.Label(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.lblOverTime = new System.Windows.Forms.Label(); this.lblOverTimeLegend = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.lblHolidayLegend = new System.Windows.Forms.Label(); this.lvwListEmployee = new XPTable.Models.Table(); this.columnModel1 = new XPTable.Models.ColumnModel(); this.cSTT = new XPTable.Models.NumberColumn(); this.cCardID = new XPTable.Models.TextColumn(); this.cEmployeeName = new XPTable.Models.TextColumn(); this.tableModel1 = new XPTable.Models.TableModel(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.btnSelectAll = new System.Windows.Forms.Button(); this.btnSelectNone = new System.Windows.Forms.Button(); this.groupBox4.SuspendLayout(); this.groupBox5.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.lvwListEmployee)).BeginInit(); this.groupBox1.SuspendLayout(); this.SuspendLayout(); // // btnClose // this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnClose.FlatStyle = System.Windows.Forms.FlatStyle.System; this.btnClose.Location = new System.Drawing.Point(792, 568); this.btnClose.Name = "btnClose"; this.btnClose.Size = new System.Drawing.Size(75, 23); this.btnClose.TabIndex = 7; this.btnClose.Text = "Đóng"; this.btnClose.Click += new System.EventHandler(this.btnClose_Click); // // btnUpdate // this.btnUpdate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnUpdate.FlatStyle = System.Windows.Forms.FlatStyle.System; this.btnUpdate.Location = new System.Drawing.Point(632, 568); this.btnUpdate.Name = "btnUpdate"; this.btnUpdate.Size = new System.Drawing.Size(75, 23); this.btnUpdate.TabIndex = 6; this.btnUpdate.Text = "Cập nhật"; this.btnUpdate.Click += new System.EventHandler(this.btnUpdate_Click); // // btnHelp // this.btnHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnHelp.FlatStyle = System.Windows.Forms.FlatStyle.System; this.btnHelp.Location = new System.Drawing.Point(8, 568); this.btnHelp.Name = "btnHelp"; this.btnHelp.Size = new System.Drawing.Size(75, 23); this.btnHelp.TabIndex = 8; this.btnHelp.Text = "Trợ giúp"; this.btnHelp.Click += new System.EventHandler(this.btnHelp_Click); // // monthCalendar1 // this.monthCalendar1.ActiveMonth.Month = 6; this.monthCalendar1.ActiveMonth.RaiseEvent = true; this.monthCalendar1.ActiveMonth.Year = 2006; this.monthCalendar1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.monthCalendar1.BorderColor = System.Drawing.SystemColors.ActiveBorder; this.monthCalendar1.Culture = new System.Globalization.CultureInfo(""); this.monthCalendar1.Footer.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold); this.monthCalendar1.Header.BackColor = System.Drawing.SystemColors.ActiveCaption; this.monthCalendar1.Header.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold); this.monthCalendar1.Header.TextColor = System.Drawing.Color.White; this.monthCalendar1.ImageList = null; this.monthCalendar1.Location = new System.Drawing.Point(8, 16); this.monthCalendar1.MaxDate = new System.DateTime(2020, 11, 9, 0, 0, 0, 0); this.monthCalendar1.MinDate = new System.DateTime(1995, 11, 9, 19, 19, 39, 781); this.monthCalendar1.Month.Colors.Background = System.Drawing.Color.GhostWhite; this.monthCalendar1.Month.Colors.FocusBackground = System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(122)))), ((int)(((byte)(255))))); this.monthCalendar1.Month.Colors.FocusBorder = System.Drawing.SystemColors.ActiveCaption; this.monthCalendar1.Month.Colors.FocusDate = System.Drawing.Color.Black; this.monthCalendar1.Month.Colors.FocusText = System.Drawing.Color.Black; this.monthCalendar1.Month.Colors.SelectedBackground = System.Drawing.SystemColors.ActiveCaption; this.monthCalendar1.Month.Colors.SelectedBorder = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(69)))), ((int)(((byte)(185))))); this.monthCalendar1.Month.Colors.SelectedDate = System.Drawing.Color.Black; this.monthCalendar1.Month.Colors.SelectedText = System.Drawing.Color.Black; this.monthCalendar1.Month.Colors.WeekendBackground = System.Drawing.Color.MistyRose; this.monthCalendar1.Month.Colors.WeekendDate = System.Drawing.Color.DarkRed; this.monthCalendar1.Month.DateFont = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(163))); this.monthCalendar1.Month.TextFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.monthCalendar1.Name = "monthCalendar1"; this.monthCalendar1.SelectionMode = Pabo.Calendar.mcSelectionMode.MultiExtended; this.monthCalendar1.SelectTrailingDates = false; this.monthCalendar1.ShowTrailingDates = false; this.monthCalendar1.Size = new System.Drawing.Size(552, 456); this.monthCalendar1.TabIndex = 67; this.monthCalendar1.WeekDays.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.monthCalendar1.WeekDays.TextColor = System.Drawing.SystemColors.ActiveCaption; this.monthCalendar1.WeekNumbers.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F); this.monthCalendar1.WeekNumbers.TextColor = System.Drawing.SystemColors.ActiveCaption; this.monthCalendar1.DaySelected += new Pabo.Calendar.DaySelectedEventHandler(this.monthCalendar1_DaySelected); this.monthCalendar1.MonthChanged += new Pabo.Calendar.MonthChangedEventHandler(this.monthCalendar1_MonthChanged); // // groupBox4 // this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBox4.Controls.Add(this.monthCalendar1); this.groupBox4.FlatStyle = System.Windows.Forms.FlatStyle.System; this.groupBox4.Location = new System.Drawing.Point(296, 80); this.groupBox4.Name = "groupBox4"; this.groupBox4.Size = new System.Drawing.Size(568, 480); this.groupBox4.TabIndex = 75; this.groupBox4.TabStop = false; this.groupBox4.Text = "Lịch làm việc"; // // groupBox5 // this.groupBox5.Controls.Add(this.departmentTreeView); this.groupBox5.FlatStyle = System.Windows.Forms.FlatStyle.System; this.groupBox5.Location = new System.Drawing.Point(8, 8); this.groupBox5.Name = "groupBox5"; this.groupBox5.Size = new System.Drawing.Size(280, 240); this.groupBox5.TabIndex = 76; this.groupBox5.TabStop = false; this.groupBox5.Text = "Danh sách phòng ban"; // // departmentTreeView // this.departmentTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.departmentTreeView.BackColor = System.Drawing.Color.GhostWhite; this.departmentTreeView.DepartmentDataSet = null; this.departmentTreeView.ImageIndex = 0; this.departmentTreeView.Location = new System.Drawing.Point(8, 16); this.departmentTreeView.Name = "departmentTreeView"; this.departmentTreeView.SelectedImageIndex = 0; this.departmentTreeView.Size = new System.Drawing.Size(264, 216); this.departmentTreeView.TabIndex = 4; this.departmentTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.departmentTreeView_AfterSelect); // // btnCancel // this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; this.btnCancel.Location = new System.Drawing.Point(712, 568); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(75, 23); this.btnCancel.TabIndex = 77; this.btnCancel.Text = "Bỏ qua"; this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); // // cboShift // this.cboShift.AllowTypeAllSymbols = false; this.cboShift.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.cboShift.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cboShift.DropDownWidth = 200; this.cboShift.ItemHeight = 13; this.cboShift.Location = new System.Drawing.Point(184, 16); this.cboShift.Name = "cboShift"; this.cboShift.Size = new System.Drawing.Size(152, 21); this.cboShift.TabIndex = 0; this.cboShift.SelectedIndexChanged += new System.EventHandler(this.cboShift_SelectedIndexChanged); // // groupBox2 // this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBox2.Controls.Add(this.rbtOverTime); this.groupBox2.Controls.Add(this.rbtHoliday); this.groupBox2.Controls.Add(this.lblShift); this.groupBox2.Controls.Add(this.rbtWorkingDay); this.groupBox2.Controls.Add(this.rbtNonWorkingDay); this.groupBox2.Controls.Add(this.cboShift); this.groupBox2.FlatStyle = System.Windows.Forms.FlatStyle.System; this.groupBox2.Location = new System.Drawing.Point(296, 8); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(344, 72); this.groupBox2.TabIndex = 79; this.groupBox2.TabStop = false; this.groupBox2.Text = "Thiết lập ngày"; // // rbtOverTime // this.rbtOverTime.Location = new System.Drawing.Point(16, 40); this.rbtOverTime.Name = "rbtOverTime"; this.rbtOverTime.Size = new System.Drawing.Size(112, 24); this.rbtOverTime.TabIndex = 76; this.rbtOverTime.Text = "Làm thêm (HS1)"; this.rbtOverTime.CheckedChanged += new System.EventHandler(this.rbtOverTime_CheckedChanged); // // rbtHoliday // this.rbtHoliday.Location = new System.Drawing.Point(240, 40); this.rbtHoliday.Name = "rbtHoliday"; this.rbtHoliday.Size = new System.Drawing.Size(96, 24); this.rbtHoliday.TabIndex = 75; this.rbtHoliday.Text = "Ngày lễ (HS3)"; this.rbtHoliday.CheckedChanged += new System.EventHandler(this.rbtHoliday_CheckedChanged); // // lblShift // this.lblShift.Location = new System.Drawing.Point(128, 16); this.lblShift.Name = "lblShift"; this.lblShift.Size = new System.Drawing.Size(56, 23); this.lblShift.TabIndex = 72; this.lblShift.Text = "Chọn ca:"; this.lblShift.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // rbtWorkingDay // this.rbtWorkingDay.Location = new System.Drawing.Point(16, 16); this.rbtWorkingDay.Name = "rbtWorkingDay"; this.rbtWorkingDay.Size = new System.Drawing.Size(112, 24); this.rbtWorkingDay.TabIndex = 70; this.rbtWorkingDay.Text = "Ngày làm việc"; this.rbtWorkingDay.CheckedChanged += new System.EventHandler(this.rbtWorkingDay_CheckedChanged); // // rbtNonWorkingDay // this.rbtNonWorkingDay.Location = new System.Drawing.Point(128, 40); this.rbtNonWorkingDay.Name = "rbtNonWorkingDay"; this.rbtNonWorkingDay.Size = new System.Drawing.Size(112, 24); this.rbtNonWorkingDay.TabIndex = 71; this.rbtNonWorkingDay.Text = "Ngày nghỉ (HS2)"; this.rbtNonWorkingDay.CheckedChanged += new System.EventHandler(this.rbtNonWorkingDay_CheckedChanged); // // lblWorkingDay // this.lblWorkingDay.Location = new System.Drawing.Point(40, 16); this.lblWorkingDay.Name = "lblWorkingDay"; this.lblWorkingDay.Size = new System.Drawing.Size(80, 23); this.lblWorkingDay.TabIndex = 0; this.lblWorkingDay.Text = "Ngày làm việc"; this.lblWorkingDay.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // lblNonWorkingDay // this.lblNonWorkingDay.Location = new System.Drawing.Point(40, 40); this.lblNonWorkingDay.Name = "lblNonWorkingDay"; this.lblNonWorkingDay.Size = new System.Drawing.Size(80, 23); this.lblNonWorkingDay.TabIndex = 1; this.lblNonWorkingDay.Text = "Ngày nghỉ"; this.lblNonWorkingDay.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // lblNonWorkingDayLegend // this.lblNonWorkingDayLegend.BackColor = System.Drawing.Color.MistyRose; this.lblNonWorkingDayLegend.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.lblNonWorkingDayLegend.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(163))); this.lblNonWorkingDayLegend.ForeColor = System.Drawing.Color.DarkRed; this.lblNonWorkingDayLegend.Location = new System.Drawing.Point(8, 40); this.lblNonWorkingDayLegend.Name = "lblNonWorkingDayLegend"; this.lblNonWorkingDayLegend.Size = new System.Drawing.Size(32, 23); this.lblNonWorkingDayLegend.TabIndex = 4; this.lblNonWorkingDayLegend.Text = "15"; this.lblNonWorkingDayLegend.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // lblWorkingDayLegend // this.lblWorkingDayLegend.BackColor = System.Drawing.Color.PaleTurquoise; this.lblWorkingDayLegend.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.lblWorkingDayLegend.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(163))); this.lblWorkingDayLegend.ForeColor = System.Drawing.Color.Navy; this.lblWorkingDayLegend.Location = new System.Drawing.Point(8, 16); this.lblWorkingDayLegend.Name = "lblWorkingDayLegend"; this.lblWorkingDayLegend.Size = new System.Drawing.Size(32, 23); this.lblWorkingDayLegend.TabIndex = 3; this.lblWorkingDayLegend.Text = "1"; this.lblWorkingDayLegend.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // groupBox3 // this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.groupBox3.Controls.Add(this.lblOverTime); this.groupBox3.Controls.Add(this.lblOverTimeLegend); this.groupBox3.Controls.Add(this.label2); this.groupBox3.Controls.Add(this.lblHolidayLegend); this.groupBox3.Controls.Add(this.lblNonWorkingDay); this.groupBox3.Controls.Add(this.lblNonWorkingDayLegend); this.groupBox3.Controls.Add(this.lblWorkingDay); this.groupBox3.Controls.Add(this.lblWorkingDayLegend); this.groupBox3.FlatStyle = System.Windows.Forms.FlatStyle.System; this.groupBox3.Location = new System.Drawing.Point(648, 8); this.groupBox3.Name = "groupBox3"; this.groupBox3.Size = new System.Drawing.Size(216, 72); this.groupBox3.TabIndex = 79; this.groupBox3.TabStop = false; this.groupBox3.Text = "Quy ước mầu"; // // lblOverTime // this.lblOverTime.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.lblOverTime.Location = new System.Drawing.Point(152, 16); this.lblOverTime.Name = "lblOverTime"; this.lblOverTime.Size = new System.Drawing.Size(56, 23); this.lblOverTime.TabIndex = 7; this.lblOverTime.Text = "Làm thêm"; this.lblOverTime.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // lblOverTimeLegend // this.lblOverTimeLegend.BackColor = System.Drawing.Color.CornflowerBlue; this.lblOverTimeLegend.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.lblOverTimeLegend.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(163))); this.lblOverTimeLegend.ForeColor = System.Drawing.Color.DarkBlue; this.lblOverTimeLegend.Location = new System.Drawing.Point(120, 16); this.lblOverTimeLegend.Name = "lblOverTimeLegend"; this.lblOverTimeLegend.Size = new System.Drawing.Size(32, 23); this.lblOverTimeLegend.TabIndex = 8; this.lblOverTimeLegend.Text = "7"; this.lblOverTimeLegend.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // label2 // this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.label2.Location = new System.Drawing.Point(152, 40); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(56, 23); this.label2.TabIndex = 5; this.label2.Text = "Ngày lễ"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // lblHolidayLegend // this.lblHolidayLegend.BackColor = System.Drawing.Color.Salmon; this.lblHolidayLegend.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.lblHolidayLegend.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(163))); this.lblHolidayLegend.ForeColor = System.Drawing.Color.Maroon; this.lblHolidayLegend.Location = new System.Drawing.Point(120, 40); this.lblHolidayLegend.Name = "lblHolidayLegend"; this.lblHolidayLegend.Size = new System.Drawing.Size(32, 23); this.lblHolidayLegend.TabIndex = 6; this.lblHolidayLegend.Text = "31"; this.lblHolidayLegend.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // lvwListEmployee // this.lvwListEmployee.AlternatingRowColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(237)))), ((int)(((byte)(245))))); this.lvwListEmployee.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.lvwListEmployee.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(242)))), ((int)(((byte)(249))))); this.lvwListEmployee.ColumnModel = this.columnModel1; this.lvwListEmployee.EnableToolTips = true; this.lvwListEmployee.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(66)))), ((int)(((byte)(121))))); this.lvwListEmployee.FullRowSelect = true; this.lvwListEmployee.GridColor = System.Drawing.SystemColors.ControlDark; this.lvwListEmployee.GridLines = XPTable.Models.GridLines.Both; this.lvwListEmployee.GridLineStyle = XPTable.Models.GridLineStyle.Dot; this.lvwListEmployee.HeaderFont = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); this.lvwListEmployee.Location = new System.Drawing.Point(8, 16); this.lvwListEmployee.MultiSelect = true; this.lvwListEmployee.Name = "lvwListEmployee"; this.lvwListEmployee.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(169)))), ((int)(((byte)(183)))), ((int)(((byte)(201))))); this.lvwListEmployee.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(66)))), ((int)(((byte)(121))))); this.lvwListEmployee.SelectionStyle = XPTable.Models.SelectionStyle.Grid; this.lvwListEmployee.Size = new System.Drawing.Size(264, 280); this.lvwListEmployee.SortedColumnBackColor = System.Drawing.Color.Transparent; this.lvwListEmployee.TabIndex = 80; this.lvwListEmployee.TableModel = this.tableModel1; this.lvwListEmployee.UnfocusedSelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(210)))), ((int)(((byte)(221))))); this.lvwListEmployee.UnfocusedSelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(66)))), ((int)(((byte)(121))))); this.lvwListEmployee.Click += new System.EventHandler(this.lvwListEmployee_Click); this.lvwListEmployee.SelectionChanged += new XPTable.Events.SelectionEventHandler(this.lvwListEmployee_SelectionChanged); // // columnModel1 // this.columnModel1.Columns.AddRange(new XPTable.Models.Column[] { this.cSTT, this.cCardID, this.cEmployeeName}); // // cSTT // this.cSTT.Text = "STT"; this.cSTT.Width = 45; // // cCardID // this.cCardID.Text = "Mã thẻ"; // // cEmployeeName // this.cEmployeeName.Text = "Tên nhânviên"; this.cEmployeeName.Width = 120; // // groupBox1 // this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left))); this.groupBox1.Controls.Add(this.lvwListEmployee); this.groupBox1.Location = new System.Drawing.Point(8, 256); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(280, 304); this.groupBox1.TabIndex = 81; this.groupBox1.TabStop = false; this.groupBox1.Text = "Danh sách nhân viên"; // // btnSelectAll // this.btnSelectAll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnSelectAll.FlatStyle = System.Windows.Forms.FlatStyle.System; this.btnSelectAll.Location = new System.Drawing.Point(88, 568); this.btnSelectAll.Name = "btnSelectAll"; this.btnSelectAll.Size = new System.Drawing.Size(75, 23); this.btnSelectAll.TabIndex = 82; this.btnSelectAll.Text = "Chọn tất"; this.btnSelectAll.Click += new System.EventHandler(this.btnSelectAll_Click); // // btnSelectNone // this.btnSelectNone.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.btnSelectNone.FlatStyle = System.Windows.Forms.FlatStyle.System; this.btnSelectNone.Location = new System.Drawing.Point(168, 568); this.btnSelectNone.Name = "btnSelectNone"; this.btnSelectNone.Size = new System.Drawing.Size(75, 23); this.btnSelectNone.TabIndex = 83; this.btnSelectNone.Text = "Bỏ chọn"; this.btnSelectNone.Click += new System.EventHandler(this.btnSelectNone_Click); // // frmRegWorkingTime // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(872, 598); this.Controls.Add(this.btnSelectNone); this.Controls.Add(this.btnSelectAll); this.Controls.Add(this.groupBox1); this.Controls.Add(this.groupBox2); this.Controls.Add(this.btnCancel); this.Controls.Add(this.groupBox5); this.Controls.Add(this.groupBox4); this.Controls.Add(this.btnHelp); this.Controls.Add(this.btnClose); this.Controls.Add(this.btnUpdate); this.Controls.Add(this.groupBox3); this.Name = "frmRegWorkingTime"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Đăng ký lịch làm việc"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.Load += new System.EventHandler(this.frmRegWorkingTime_Load); this.groupBox4.ResumeLayout(false); this.groupBox5.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox3.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.lvwListEmployee)).EndInit(); this.groupBox1.ResumeLayout(false); this.ResumeLayout(false); }
private void BuildCalendar(int year) { //variables int height = 0; ShowPanel.FlowDirection = FlowDirection.TopDown; int math = 1; //pannel for year select Panel yearSelect = new Panel(); yearSelect.AutoSize = false; //labeo year Label lbYear = new Label(); lbYear.AutoSize = true; //button left Button btLeftYear = new Button(); btLeftYear.Size = new Size(16, 16); //read image for button var fs = new FileStream(@"Imagens\leftarrow.png", FileMode.Open, FileAccess.Read); var img = Image.FromStream(fs); btLeftYear.Image = img; btLeftYear.Name = "btLeftYear"; btLeftYear.Padding = new Padding(0); btLeftYear.FlatStyle = FlatStyle.Flat; //button right Button btRightArrow = new Button();; btRightArrow.Name = "btRightArrow"; btRightArrow.Image = img; btRightArrow.Padding = new Padding(0); btRightArrow.FlatStyle = FlatStyle.Flat; btRightArrow.Size = new Size(16, 16); FileStream fs2 = new FileStream(@"Imagens\rightarrow.png", FileMode.Open, FileAccess.Read); Image img2 = Image.FromStream(fs2); btRightArrow.Image = img2; var auxmargin = lbYear.Margin; auxmargin.All = 0; btLeftYear.Margin = auxmargin; //deal with space var margin = lbYear.Margin; btLeftYear.Padding = new Padding(0); lbYear.Text = year.ToString(); lbYear.Font = new Font("Times New Roman", 10.0f, FontStyle.Bold); lbYear.ForeColor = Color.Black; yearSelect.Margin = auxmargin; yearSelect.Padding = new Padding(0); yearSelect.BackColor = ColorTranslator.FromHtml("#CF6766"); yearSelect.Controls.Add(btLeftYear); yearSelect.Controls.Add(lbYear); yearSelect.Controls.Add(btRightArrow); yearSelect.Controls.SetChildIndex(btLeftYear, 2); yearSelect.Controls.SetChildIndex(lbYear, 1); //YearSelect.Controls.SetChildIndex(btRightArrow, 2); ShowPanel.Controls.Add(yearSelect); //divide months into panels for stacking horizontally and vertically //4 panels with 3 calendars or 3 with 4 dunno yet for (int c = 1; c <= 3; c++) { //panel colum FlowLayoutPanel rowMonthPanel = new FlowLayoutPanel(); rowMonthPanel.FlowDirection = FlowDirection.LeftToRight; rowMonthPanel.Tag = $"Row{c + 1}"; //add 4 months to row panel for (int i = 1; i <= 4; i++) { MonthCalendar calendar = new MonthCalendar(); calendar.Tag = $"month{math}"; calendar.Name = math.ToString(); //add date value to calendar //shows calendar month as well //sets all settings of calendars calendar.ActiveMonth.Year = year; calendar.ActiveMonth.Month = math; calendar.Header.ShowMonth = false; calendar.Header.Text = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(math); calendar.Footer.ShowToday = false; calendar.Header.MonthSelectors = false; calendar.Header.BackColor1 = ColorTranslator.FromHtml("#CF6766"); calendar.Weekdays.TextColor = ColorTranslator.FromHtml("#0E1116"); calendar.KeyboardEnabled = false; calendar.Weekdays.Font = new Font("Arial", 7); DateItem[] d = new DateItem[5]; d.Initialize(); for (int k = 0; k < 5; k++) { d[k] = new DateItem(); } height = calendar.Height; rowMonthPanel.Controls.Add(calendar); math++; } //RowMonthPanel.BackColor = ColorTranslator.FromHtml("#D8DBE2"); yearSelect.Dock = DockStyle.Top; rowMonthPanel.Size = new Size(ShowPanel.Width, height + 3); //year top panel settings yearSelect.MaximumSize = new Size(rowMonthPanel.Width - 45, 16); btLeftYear.Dock = DockStyle.Left; //last part of dealing with label position lbYear.Dock = DockStyle.Fill; lbYear.AutoSize = false; lbYear.TextAlign = ContentAlignment.MiddleCenter; btRightArrow.Dock = DockStyle.Right; //btRightArrow.Click += new EventHandler(this.YearChange); //btLeftYear.Click += new EventHandler(this.YearChange); ShowPanel.BackColor = ColorTranslator.FromHtml("#D8DBE2"); ShowPanel.Controls.Add(rowMonthPanel); } btLeftYear.Click += delegate { YearChange(-1); }; btRightArrow.Click += delegate { YearChange(1); }; }
private void LoadFuncFerias(FeriasColletionItem feriasCol) { int auxMonthS = 0; int auxMonthE = 0; Control tagFound = new Control(); Control row1 = ShowPanel.Controls[1]; Control row2 = ShowPanel.Controls[2]; Control row3 = ShowPanel.Controls[3]; foreach (FeriasItem feriasItem in feriasCol.ListaFerias) { //auxiliary variables DateTime currentDate = new DateTime(); //get first and last vacation days auxMonthS = feriasItem.InicioFerias.Month; auxMonthE = feriasItem.FimFerias.Month; //calculates the number of days int numberOfDaysFerias = Math.Abs((feriasItem.InicioFerias - feriasItem.FimFerias).Days); //calculates number of months int numberOfMonths = auxMonthE - auxMonthS + 1; //inicialize dateitems for calendar //DateItem[] d = new DateItem[NumberOfDaysFerias]; //d.Initialize(); //for (int j = 0; j < NumberOfDaysFerias; j++) // d[j] = new DateItem(); int auxCounter = 0; List <DateItem> listD = new List <DateItem>(); //repeat if more then 1 month for (int m = 1; m <= numberOfMonths; m++) { Control calendarControl = new Control(); if (auxMonthS != 0) { if (auxMonthS > 0 && auxMonthS < 5) { calendarControl = HelperClass.FindTag(row1.Controls, $"month{auxMonthS}"); } else if (auxMonthS > 4 && auxMonthS < 9) { calendarControl = HelperClass.FindTag(row2.Controls, $"month{auxMonthS}"); } else { calendarControl = HelperClass.FindTag(row3.Controls, $"month{auxMonthS}"); } } MonthCalendar calendarToAdd = (MonthCalendar)calendarControl ?? throw new Exception("Algo deu ruim no calendario"); //cast dates to dateitems for (int i = auxCounter; i <= numberOfDaysFerias; i++) { //compare current months currentDate = feriasItem.InicioFerias.AddDays(i); //make sure same month if (auxMonthS == currentDate.Month) { DateItem d = new DateItem(); //add date to dateitem d.Date = currentDate; FileStream fs = new FileStream(@"Imagens\sunny.png", FileMode.Open, FileAccess.Read); Image img = Image.FromStream(fs); Bitmap objBitmap = new Bitmap(img, new Size(10, 10)); ImageList list = new ImageList(); d.Image = objBitmap; fs.Close(); d.BackColor1 = Color.Red; listD.Add(d); } else { auxMonthS += 1; break; } auxCounter++; } DateItem[] e = new DateItem[listD.Count()]; e.Initialize(); for (int i = 0; i < listD.Count(); i++) { e[i] = listD[i]; } calendarToAdd.AddDateInfo(e); } } }