Chuyên đề Phân tích, thiết kế phần mềm tính lương tạ công ty TNHH Nissei Electric Hanoi

Hiện nay, sự đòi hỏi về tin học hoá hoạt động quản lý ngày càng lớn. Sức ép cạnh tranh luôn buộc các nhà quản lý tìm kiếm những phương thức quản lý tiên tiến, tận dụng được tối đa các nguồn lực sẵn có, tiết kiệm chi phí và nhân lực, nhưng vẫn đạt được kết quả tối ưu. Với Công ty trách nhiệm hữu hạn Nissei Electric Hà Nội, phần mềm Quản lý nhân sự và tính lương đã được Ban Giám Đốc quan tâm và đầu tư vì đây là một trong những lĩnh vực quan trọng góp phần nâng cao chất lượng quản lý của Công ty. Cùng với nhóm EZManage của Công ty TNHH Fujitsu Việt Nam, tôi đã tiến hành nghiên cứu đề tài trên cả góc độ lý thuyết và thực hành, tập trung vào module Tính lương. Các kết quả đề tài đã đạt được bao gồm: 1. Trên cơ sở nghiên cứu các yêu cầu quản lý, chuyên đề đã nêu sự cần thiết khách quan của việc ứng dụng tin học vào hỗ trợ công tác quản lý và tính lương của Công ty và đề xuất phương án triển khai khả thi. 2. Chuyên đề đã nêu lên một số vấn đề liên quan đến công nghệ phần mềm, đề xuất quy trình phát triển một phần mềm tính lương. 3. Chuyên đề đã nghiên cứu phân tích, thiết kế phần mềm tính lương tại Công ty TNHH Nissei Electric Hà Nội.

doc185 trang | Chia sẻ: aloso | Lượt xem: 1971 | Lượt tải: 0download
Bạn đang xem trước 20 trang tài liệu Chuyên đề Phân tích, thiết kế phần mềm tính lương tạ công ty TNHH Nissei Electric Hanoi, để xem tài liệu hoàn chỉnh bạn click vào nút DOWNLOAD ở trên
("resource.MaxLength8"))); this.xcbYear.Properties.PopupBorderStyle = ((DevExpress.XtraEditors.Controls.PopupBorderStyles)(resources.GetObject("resource.PopupBorderStyle4"))); this.xcbYear.Properties.PopupControlsBorderStyle = ((DevExpress.XtraEditors.Controls.BorderStyles)(resources.GetObject("resource.PopupControlsBorderStyle4"))); this.xcbYear.Properties.ReadOnly = ((bool)(resources.GetObject("resource.ReadOnly10"))); this.xcbYear.Properties.ShowDropDown = ((DevExpress.XtraEditors.Controls.ShowDropDown)(resources.GetObject("resource.ShowDropDown4"))); this.xcbYear.Properties.ShowPopupShadow = ((bool)(resources.GetObject("resource.ShowPopupShadow4"))); this.xcbYear.Properties.SyncButtonsBorderStyleWithPopupControls = ((bool)(resources.GetObject("resource.SyncButtonsBorderStyleWithPopupControls4"))); this.xcbYear.Properties.TextEditStyle = ((DevExpress.XtraEditors.Controls.TextEditStyles)(resources.GetObject("resource.TextEditStyle8"))); this.xcbYear.Properties.UseCtrlScroll = ((bool)(resources.GetObject("resource.UseCtrlScroll"))); this.xcbYear.Properties.XPThemeSupport = ((DevExpress.Utils.XPThemeSupport)(resources.GetObject("resource.XPThemeSupport10"))); this.xcbYear.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("xcbYear.RightToLeft"))); this.xcbYear.Size = ((System.Drawing.Size)(resources.GetObject("xcbYear.Size"))); this.xcbYear.TabIndex = ((int)(resources.GetObject("xcbYear.TabIndex"))); this.xcbYear.TabStop = ((bool)(resources.GetObject("xcbYear.TabStop"))); this.xcbYear.Text = resources.GetString("xcbYear.Text"); this.xcbYear.Visible = ((bool)(resources.GetObject("xcbYear.Visible"))); // // xcbMonth // this.xcbMonth.AccessibleDescription = resources.GetString("xcbMonth.AccessibleDescription"); this.xcbMonth.AccessibleName = resources.GetString("xcbMonth.AccessibleName"); this.xcbMonth.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("xcbMonth.Anchor"))); this.xcbMonth.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("xcbMonth.Dock"))); this.xcbMonth.Enabled = ((bool)(resources.GetObject("xcbMonth.Enabled"))); this.xcbMonth.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("xcbMonth.ImeMode"))); this.xcbMonth.Location = ((System.Drawing.Point)(resources.GetObject("xcbMonth.Location"))); this.xcbMonth.Name = "xcbMonth"; this.xcbMonth.Properties.ActionButtonIndex = ((int)(resources.GetObject("resource.ActionButtonIndex5"))); this.xcbMonth.Properties.AllowFocused = ((bool)(resources.GetObject("resource.AllowFocused11"))); this.xcbMonth.Properties.AutoComplete = ((bool)(resources.GetObject("resource.AutoComplete5"))); this.xcbMonth.Properties.AutoHeight = ((bool)(resources.GetObject("resource.AutoHeight11"))); this.xcbMonth.Properties.BorderSides = ((DevExpress.XtraEditors.Controls.BorderSide)(resources.GetObject("resource.BorderSides11"))); this.xcbMonth.Properties.BorderStyle = ((DevExpress.XtraEditors.Controls.BorderStyles)(resources.GetObject("resource.BorderStyle11"))); this.xcbMonth.Properties.Buttons.Add(new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)); this.xcbMonth.Properties.ButtonsBorderStyle = ((DevExpress.XtraEditors.Controls.BorderStyles)(resources.GetObject("resource.ButtonsBorderStyle5"))); this.xcbMonth.Properties.CaseSensitive = ((bool)(resources.GetObject("resource.CaseSensitive1"))); this.xcbMonth.Properties.CharacterCasing = ((System.Windows.Forms.CharacterCasing)(resources.GetObject("resource.CharacterCasing9"))); this.xcbMonth.Properties.CloseUpKey = ((System.Windows.Forms.Keys)(resources.GetObject("resource.CloseUpKey5"))); this.xcbMonth.Properties.CycleOnDblClick = ((bool)(resources.GetObject("resource.CycleOnDblClick1"))); this.xcbMonth.Properties.DropDownRows = ((int)(resources.GetObject("resource.DropDownRows5"))); this.xcbMonth.Properties.Enabled = ((bool)(resources.GetObject("resource.Enabled11"))); this.xcbMonth.Properties.FormatString = resources.GetString("resource.FormatString11"); this.xcbMonth.Properties.HideSelection = ((bool)(resources.GetObject("resource.HideSelection9"))); this.xcbMonth.Properties.ImmediatePopup = ((bool)(resources.GetObject("resource.ImmediatePopup5"))); this.xcbMonth.Properties.Items.Add(new DevExpress.XtraEditors.Controls.ComboBoxItem("1")); this.xcbMonth.Properties.Items.Add(new DevExpress.XtraEditors.Controls.ComboBoxItem("2")); this.xcbMonth.Properties.Items.Add(new DevExpress.XtraEditors.Controls.ComboBoxItem("3")); this.xcbMonth.Properties.Items.Add(new DevExpress.XtraEditors.Controls.ComboBoxItem("4")); this.xcbMonth.Properties.Items.Add(new DevExpress.XtraEditors.Controls.ComboBoxItem("5")); this.xcbMonth.Properties.Items.Add(new DevExpress.XtraEditors.Controls.ComboBoxItem("6")); this.xcbMonth.Properties.Items.Add(new DevExpress.XtraEditors.Controls.ComboBoxItem("7")); this.xcbMonth.Properties.Items.Add(new DevExpress.XtraEditors.Controls.ComboBoxItem("8")); this.xcbMonth.Properties.Items.Add(new DevExpress.XtraEditors.Controls.ComboBoxItem("9")); this.xcbMonth.Properties.Items.Add(new DevExpress.XtraEditors.Controls.ComboBoxItem("10")); this.xcbMonth.Properties.Items.Add(new DevExpress.XtraEditors.Controls.ComboBoxItem("11")); this.xcbMonth.Properties.Items.Add(new DevExpress.XtraEditors.Controls.ComboBoxItem("12")); this.xcbMonth.Properties.MaskData.BeepOnError = ((bool)(resources.GetObject("resource.BeepOnError9"))); this.xcbMonth.Properties.MaskData.Blank = resources.GetString("resource.Blank9"); this.xcbMonth.Properties.MaskData.EditMask = resources.GetString("resource.EditMask9"); this.xcbMonth.Properties.MaskData.IgnoreMaskBlank = ((bool)(resources.GetObject("resource.IgnoreMaskBlank9"))); this.xcbMonth.Properties.MaskData.MaskType = ((DevExpress.XtraEditors.Controls.MaskType)(resources.GetObject("resource.MaskType9"))); this.xcbMonth.Properties.MaskData.SaveLiteral = ((bool)(resources.GetObject("resource.SaveLiteral9"))); this.xcbMonth.Properties.MaxLength = ((int)(resources.GetObject("resource.MaxLength9"))); this.xcbMonth.Properties.PopupBorderStyle = ((DevExpress.XtraEditors.Controls.PopupBorderStyles)(resources.GetObject("resource.PopupBorderStyle5"))); this.xcbMonth.Properties.PopupControlsBorderStyle = ((DevExpress.XtraEditors.Controls.BorderStyles)(resources.GetObject("resource.PopupControlsBorderStyle5"))); this.xcbMonth.Properties.ReadOnly = ((bool)(resources.GetObject("resource.ReadOnly11"))); this.xcbMonth.Properties.ShowDropDown = ((DevExpress.XtraEditors.Controls.ShowDropDown)(resources.GetObject("resource.ShowDropDown5"))); this.xcbMonth.Properties.ShowPopupShadow = ((bool)(resources.GetObject("resource.ShowPopupShadow5"))); this.xcbMonth.Properties.SyncButtonsBorderStyleWithPopupControls = ((bool)(resources.GetObject("resource.SyncButtonsBorderStyleWithPopupControls5"))); this.xcbMonth.Properties.TextEditStyle = ((DevExpress.XtraEditors.Controls.TextEditStyles)(resources.GetObject("resource.TextEditStyle9"))); this.xcbMonth.Properties.UseCtrlScroll = ((bool)(resources.GetObject("resource.UseCtrlScroll1"))); this.xcbMonth.Properties.XPThemeSupport = ((DevExpress.Utils.XPThemeSupport)(resources.GetObject("resource.XPThemeSupport11"))); this.xcbMonth.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("xcbMonth.RightToLeft"))); this.xcbMonth.Size = ((System.Drawing.Size)(resources.GetObject("xcbMonth.Size"))); this.xcbMonth.TabIndex = ((int)(resources.GetObject("xcbMonth.TabIndex"))); this.xcbMonth.TabStop = ((bool)(resources.GetObject("xcbMonth.TabStop"))); this.xcbMonth.Text = resources.GetString("xcbMonth.Text"); this.xcbMonth.Visible = ((bool)(resources.GetObject("xcbMonth.Visible"))); // // label1 // this.label1.AccessibleDescription = resources.GetString("label1.AccessibleDescription"); this.label1.AccessibleName = resources.GetString("label1.AccessibleName"); this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("label1.Anchor"))); this.label1.AutoSize = ((bool)(resources.GetObject("label1.AutoSize"))); this.label1.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("label1.Dock"))); this.label1.Enabled = ((bool)(resources.GetObject("label1.Enabled"))); this.label1.Font = ((System.Drawing.Font)(resources.GetObject("label1.Font"))); this.label1.Image = ((System.Drawing.Image)(resources.GetObject("label1.Image"))); this.label1.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("label1.ImageAlign"))); this.label1.ImageIndex = ((int)(resources.GetObject("label1.ImageIndex"))); this.label1.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("label1.ImeMode"))); this.label1.Location = ((System.Drawing.Point)(resources.GetObject("label1.Location"))); this.label1.Name = "label1"; this.label1.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("label1.RightToLeft"))); this.label1.Size = ((System.Drawing.Size)(resources.GetObject("label1.Size"))); this.label1.TabIndex = ((int)(resources.GetObject("label1.TabIndex"))); this.label1.Text = resources.GetString("label1.Text"); this.label1.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("label1.TextAlign"))); this.label1.Visible = ((bool)(resources.GetObject("label1.Visible"))); // // label2 // this.label2.AccessibleDescription = resources.GetString("label2.AccessibleDescription"); this.label2.AccessibleName = resources.GetString("label2.AccessibleName"); this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("label2.Anchor"))); this.label2.AutoSize = ((bool)(resources.GetObject("label2.AutoSize"))); this.label2.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("label2.Dock"))); this.label2.Enabled = ((bool)(resources.GetObject("label2.Enabled"))); this.label2.Font = ((System.Drawing.Font)(resources.GetObject("label2.Font"))); this.label2.Image = ((System.Drawing.Image)(resources.GetObject("label2.Image"))); this.label2.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("label2.ImageAlign"))); this.label2.ImageIndex = ((int)(resources.GetObject("label2.ImageIndex"))); this.label2.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("label2.ImeMode"))); this.label2.Location = ((System.Drawing.Point)(resources.GetObject("label2.Location"))); this.label2.Name = "label2"; this.label2.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("label2.RightToLeft"))); this.label2.Size = ((System.Drawing.Size)(resources.GetObject("label2.Size"))); this.label2.TabIndex = ((int)(resources.GetObject("label2.TabIndex"))); this.label2.Text = resources.GetString("label2.Text"); this.label2.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("label2.TextAlign"))); this.label2.Visible = ((bool)(resources.GetObject("label2.Visible"))); // // dgrSalError // this.dgrSalError.AccessibleDescription = resources.GetString("dgrSalError.AccessibleDescription"); this.dgrSalError.AccessibleName = resources.GetString("dgrSalError.AccessibleName"); this.dgrSalError.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("dgrSalError.Anchor"))); this.dgrSalError.BackgroundColor = System.Drawing.Color.White; this.dgrSalError.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("dgrSalError.BackgroundImage"))); this.dgrSalError.CaptionFont = ((System.Drawing.Font)(resources.GetObject("dgrSalError.CaptionFont"))); this.dgrSalError.CaptionText = resources.GetString("dgrSalError.CaptionText"); this.dgrSalError.CaptionVisible = false; this.dgrSalError.DataMember = ""; this.dgrSalError.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("dgrSalError.Dock"))); this.dgrSalError.Enabled = ((bool)(resources.GetObject("dgrSalError.Enabled"))); this.dgrSalError.Font = ((System.Drawing.Font)(resources.GetObject("dgrSalError.Font"))); this.dgrSalError.HeaderForeColor = System.Drawing.SystemColors.ControlText; this.dgrSalError.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("dgrSalError.ImeMode"))); this.dgrSalError.Location = ((System.Drawing.Point)(resources.GetObject("dgrSalError.Location"))); this.dgrSalError.Name = "dgrSalError"; this.dgrSalError.ReadOnly = true; this.dgrSalError.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("dgrSalError.RightToLeft"))); this.dgrSalError.Size = ((System.Drawing.Size)(resources.GetObject("dgrSalError.Size"))); this.dgrSalError.TabIndex = ((int)(resources.GetObject("dgrSalError.TabIndex"))); this.dgrSalError.Visible = ((bool)(resources.GetObject("dgrSalError.Visible"))); // // groupBox3 // this.groupBox3.AccessibleDescription = resources.GetString("groupBox3.AccessibleDescription"); this.groupBox3.AccessibleName = resources.GetString("groupBox3.AccessibleName"); this.groupBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("groupBox3.Anchor"))); this.groupBox3.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("groupBox3.BackgroundImage"))); this.groupBox3.Controls.Add(this.chkReCalIns); this.groupBox3.Controls.Add(this.rdbSalCalculation); this.groupBox3.Controls.Add(this.rdbInsCalculation); this.groupBox3.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("groupBox3.Dock"))); this.groupBox3.Enabled = ((bool)(resources.GetObject("groupBox3.Enabled"))); this.groupBox3.Font = ((System.Drawing.Font)(resources.GetObject("groupBox3.Font"))); this.groupBox3.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("groupBox3.ImeMode"))); this.groupBox3.Location = ((System.Drawing.Point)(resources.GetObject("groupBox3.Location"))); this.groupBox3.Name = "groupBox3"; this.groupBox3.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("groupBox3.RightToLeft"))); this.groupBox3.Size = ((System.Drawing.Size)(resources.GetObject("groupBox3.Size"))); this.groupBox3.TabIndex = ((int)(resources.GetObject("groupBox3.TabIndex"))); this.groupBox3.TabStop = false; this.groupBox3.Text = resources.GetString("groupBox3.Text"); this.groupBox3.Visible = ((bool)(resources.GetObject("groupBox3.Visible"))); // // chkReCalIns // this.chkReCalIns.AccessibleDescription = resources.GetString("chkReCalIns.AccessibleDescription"); this.chkReCalIns.AccessibleName = resources.GetString("chkReCalIns.AccessibleName"); this.chkReCalIns.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("chkReCalIns.Anchor"))); this.chkReCalIns.Appearance = ((System.Windows.Forms.Appearance)(resources.GetObject("chkReCalIns.Appearance"))); this.chkReCalIns.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("chkReCalIns.BackgroundImage"))); this.chkReCalIns.CheckAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("chkReCalIns.CheckAlign"))); this.chkReCalIns.Checked = true; this.chkReCalIns.CheckState = System.Windows.Forms.CheckState.Checked; this.chkReCalIns.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("chkReCalIns.Dock"))); this.chkReCalIns.Enabled = ((bool)(resources.GetObject("chkReCalIns.Enabled"))); this.chkReCalIns.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("chkReCalIns.FlatStyle"))); this.chkReCalIns.Font = ((System.Drawing.Font)(resources.GetObject("chkReCalIns.Font"))); this.chkReCalIns.Image = ((System.Drawing.Image)(resources.GetObject("chkReCalIns.Image"))); this.chkReCalIns.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("chkReCalIns.ImageAlign"))); this.chkReCalIns.ImageIndex = ((int)(resources.GetObject("chkReCalIns.ImageIndex"))); this.chkReCalIns.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("chkReCalIns.ImeMode"))); this.chkReCalIns.Location = ((System.Drawing.Point)(resources.GetObject("chkReCalIns.Location"))); this.chkReCalIns.Name = "chkReCalIns"; this.chkReCalIns.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("chkReCalIns.RightToLeft"))); this.chkReCalIns.Size = ((System.Drawing.Size)(resources.GetObject("chkReCalIns.Size"))); this.chkReCalIns.TabIndex = ((int)(resources.GetObject("chkReCalIns.TabIndex"))); this.chkReCalIns.Text = resources.GetString("chkReCalIns.Text"); this.chkReCalIns.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("chkReCalIns.TextAlign"))); this.chkReCalIns.Visible = ((bool)(resources.GetObject("chkReCalIns.Visible"))); // // rdbSalCalculation // this.rdbSalCalculation.AccessibleDescription = resources.GetString("rdbSalCalculation.AccessibleDescription"); this.rdbSalCalculation.AccessibleName = resources.GetString("rdbSalCalculation.AccessibleName"); this.rdbSalCalculation.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("rdbSalCalculation.Anchor"))); this.rdbSalCalculation.Appearance = ((System.Windows.Forms.Appearance)(resources.GetObject("rdbSalCalculation.Appearance"))); this.rdbSalCalculation.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("rdbSalCalculation.BackgroundImage"))); this.rdbSalCalculation.CheckAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("rdbSalCalculation.CheckAlign"))); this.rdbSalCalculation.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("rdbSalCalculation.Dock"))); this.rdbSalCalculation.Enabled = ((bool)(resources.GetObject("rdbSalCalculation.Enabled"))); this.rdbSalCalculation.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("rdbSalCalculation.FlatStyle"))); this.rdbSalCalculation.Font = ((System.Drawing.Font)(resources.GetObject("rdbSalCalculation.Font"))); this.rdbSalCalculation.Image = ((System.Drawing.Image)(resources.GetObject("rdbSalCalculation.Image"))); this.rdbSalCalculation.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("rdbSalCalculation.ImageAlign"))); this.rdbSalCalculation.ImageIndex = ((int)(resources.GetObject("rdbSalCalculation.ImageIndex"))); this.rdbSalCalculation.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("rdbSalCalculation.ImeMode"))); this.rdbSalCalculation.Location = ((System.Drawing.Point)(resources.GetObject("rdbSalCalculation.Location"))); this.rdbSalCalculation.Name = "rdbSalCalculation"; this.rdbSalCalculation.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("rdbSalCalculation.RightToLeft"))); this.rdbSalCalculation.Size = ((System.Drawing.Size)(resources.GetObject("rdbSalCalculation.Size"))); this.rdbSalCalculation.TabIndex = ((int)(resources.GetObject("rdbSalCalculation.TabIndex"))); this.rdbSalCalculation.Text = resources.GetString("rdbSalCalculation.Text"); this.rdbSalCalculation.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("rdbSalCalculation.TextAlign"))); this.rdbSalCalculation.Visible = ((bool)(resources.GetObject("rdbSalCalculation.Visible"))); // // rdbInsCalculation // this.rdbInsCalculation.AccessibleDescription = resources.GetString("rdbInsCalculation.AccessibleDescription"); this.rdbInsCalculation.AccessibleName = resources.GetString("rdbInsCalculation.AccessibleName"); this.rdbInsCalculation.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("rdbInsCalculation.Anchor"))); this.rdbInsCalculation.Appearance = ((System.Windows.Forms.Appearance)(resources.GetObject("rdbInsCalculation.Appearance"))); this.rdbInsCalculation.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("rdbInsCalculation.BackgroundImage"))); this.rdbInsCalculation.CheckAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("rdbInsCalculation.CheckAlign"))); this.rdbInsCalculation.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("rdbInsCalculation.Dock"))); this.rdbInsCalculation.Enabled = ((bool)(resources.GetObject("rdbInsCalculation.Enabled"))); this.rdbInsCalculation.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("rdbInsCalculation.FlatStyle"))); this.rdbInsCalculation.Font = ((System.Drawing.Font)(resources.GetObject("rdbInsCalculation.Font"))); this.rdbInsCalculation.Image = ((System.Drawing.Image)(resources.GetObject("rdbInsCalculation.Image"))); this.rdbInsCalculation.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("rdbInsCalculation.ImageAlign"))); this.rdbInsCalculation.ImageIndex = ((int)(resources.GetObject("rdbInsCalculation.ImageIndex"))); this.rdbInsCalculation.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("rdbInsCalculation.ImeMode"))); this.rdbInsCalculation.Location = ((System.Drawing.Point)(resources.GetObject("rdbInsCalculation.Location"))); this.rdbInsCalculation.Name = "rdbInsCalculation"; this.rdbInsCalculation.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("rdbInsCalculation.RightToLeft"))); this.rdbInsCalculation.Size = ((System.Drawing.Size)(resources.GetObject("rdbInsCalculation.Size"))); this.rdbInsCalculation.TabIndex = ((int)(resources.GetObject("rdbInsCalculation.TabIndex"))); this.rdbInsCalculation.Text = resources.GetString("rdbInsCalculation.Text"); this.rdbInsCalculation.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("rdbInsCalculation.TextAlign"))); this.rdbInsCalculation.Visible = ((bool)(resources.GetObject("rdbInsCalculation.Visible"))); // // Calculate // this.AccessibleDescription = resources.GetString("$this.AccessibleDescription"); this.AccessibleName = resources.GetString("$this.AccessibleName"); this.AutoScaleBaseSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScaleBaseSize"))); this.AutoScroll = ((bool)(resources.GetObject("$this.AutoScroll"))); this.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMargin"))); this.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMinSize"))); this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage"))); this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize"))); this.Controls.Add(this.dgrSalError); this.Controls.Add(this.lblCalculation); this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox1); this.Controls.Add(this.groupBox5); this.Controls.Add(this.groupBox2); this.Enabled = ((bool)(resources.GetObject("$this.Enabled"))); this.Font = ((System.Drawing.Font)(resources.GetObject("$this.Font"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode"))); this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location"))); this.MaximizeBox = false; this.MaximumSize = ((System.Drawing.Size)(resources.GetObject("$this.MaximumSize"))); this.MinimizeBox = false; this.MinimumSize = ((System.Drawing.Size)(resources.GetObject("$this.MinimumSize"))); this.Name = "Calculate"; this.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("$this.RightToLeft"))); this.StartPosition = ((System.Windows.Forms.FormStartPosition)(resources.GetObject("$this.StartPosition"))); this.Text = resources.GetString("$this.Text"); this.Controls.SetChildIndex(this.pnlFWCommand, 0); this.Controls.SetChildIndex(this.lblFWDecorateingLine, 0); this.Controls.SetChildIndex(this.groupBox2, 0); this.Controls.SetChildIndex(this.groupBox5, 0); this.Controls.SetChildIndex(this.groupBox1, 0); this.Controls.SetChildIndex(this.groupBox3, 0); this.Controls.SetChildIndex(this.lblCalculation, 0); this.Controls.SetChildIndex(this.dgrSalError, 0); this.pnlFWCommand.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.xleGroup)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xleSection)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xleDepartment)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xteFullName)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xleIndividual)).EndInit(); this.groupBox5.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.xtePasswordConfirm)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xchUnlock)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xchLock)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xtePassword)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xteName)).EndInit(); this.groupBox1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.xcbYear)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.xcbMonth)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dgrSalError)).EndInit(); this.groupBox3.ResumeLayout(false); this.ResumeLayout(false); } #endregion #region PRIVATE private void getSalaryPeriod() { try { DBEngine.exec("Get_SalaryPeriod","@Month", m_iCurMonth,"@Year", m_iCurYear); m_dSalStart = Convert.ToDateTime(DBEngine.getParamValue("@FromDate").ToString()); m_dSalStop = Convert.ToDateTime(DBEngine.getParamValue("@ToDate").ToString()); } catch(Exception ex) { throw(ex); } } private void filterEmployee(DateTime SalFrom, DateTime SalTo) { try { string sEmpFilter = "HireDate<=#" + SalTo.ToString("MM/dd/yyyy") + "#" + " AND (TerminateDate IS NULL OR (TerminateDate>#" + SalFrom.ToString("MM/dd/yyyy") + "#))" + " AND EmployeeStatusID 30"; m_dvEmployee.RowFilter = sEmpFilter; xleIndividual.Properties.LookUpData.DataSource = m_dvEmployee; xleIndividual.Properties.LookUpData.KeyValue = null; xteFullName.Text = ""; } catch(Exception ex) { throw(ex); } } private bool ProtectCalculation() { try { if (bLocked ==false) { //UIMessage.ShowMessage(1155,MessageBoxButtons.OK,MessageBoxIcon.Exclamation); //UIMessage.ShowMessage(); return true; } else { if ((sUserName == xteName.Text) && (sPassword == xtePassword.Text)) { return true; } else { UIMessage.ShowMessage("Salary of this month has already locked. You must input correct user name & password to re-calculate locked salary month",MessageBoxButtons.OK,MessageBoxIcon.Exclamation); return false; } } } catch (Exception e) { throw e; //return false; } //return true; } private void EnableControls() { switch(m_iCurSelection) { case 0: // selected to calculate All xleDepartment.Properties.Enabled = false; xleDepartment.Properties.LookUpData.KeyValue = -1; xleSection.Properties.Enabled = false; xleSection.Properties.LookUpData.KeyValue = -1; xleGroup.Properties.Enabled = false; xleGroup.Properties.LookUpData.KeyValue = -1; xleIndividual.Properties.Enabled = false; xleIndividual.Properties.LookUpData.KeyValue = null; xteFullName.Text = ""; break; case 1 : // selected to calculate for Department/ xleDepartment.Properties.Enabled = true; xleSection.Properties.Enabled = true; xleGroup.Properties.Enabled = true; xleIndividual.Properties.Enabled = false; xleIndividual.Properties.LookUpData.KeyValue = null; xteFullName.Text = ""; if(Convert.ToInt32(xleDepartment.Properties.LookUpData.KeyValue)== -1) { xleSection.Enabled =false; } if(Convert.ToInt32(xleSection.Properties.LookUpData.KeyValue)== -1) { xleGroup.Enabled = false; } break; case 5 : // selected to calculate for Individual xleDepartment.Properties.Enabled = false; xleDepartment.Properties.LookUpData.KeyValue = -1; xleSection.Properties.Enabled = false; xleSection.Properties.LookUpData.KeyValue = -1; xleGroup.Properties.Enabled = false; xleGroup.Properties.LookUpData.KeyValue = -1; xleIndividual.Properties.Enabled = true; break; } } private void myEvents() { xcbMonth.ValueChanged+=new EventHandler(xcbMonth_ValueChanged); xcbYear.ValueChanged+=new EventHandler(xcbYear_ValueChanged); rdbAll.CheckedChanged+=new EventHandler(rdbAll_CheckedChanged); rdbDepartment.CheckedChanged+=new EventHandler(rdbDepartment_CheckedChanged); rdbIndividual.CheckedChanged+=new EventHandler(rdbIndividual_CheckedChanged); xleDepartment.ValueChanged+=new EventHandler(xleDepartment_ValueChanged); xleSection.ValueChanged+=new EventHandler(xleSection_ValueChanged); xleIndividual.ValueChanged+=new EventHandler(xleIndividual_ValueChanged); btnStartCalculate.Click+=new EventHandler(btnStartCalculate_Click); //btnStop.Click+=new EventHandler(btnStop_Click); xchLock.ValueChanged+=new EventHandler(xchLock_ValueChanged); xchLock.ValueChanging+=new DevExpress.XtraEditors.Controls.ChangingEventHandler(xchLock_ValueChanging); xchUnlock.ValueChanging+=new DevExpress.XtraEditors.Controls.ChangingEventHandler(xchUnlock_ValueChanging); rdbInsCalculation.CheckedChanged+=new EventHandler(rdbInsCalculation_CheckedChanged); rdbSalCalculation.CheckedChanged+=new EventHandler(rdbSalCalculation_CheckedChanged); } // private DataRow[] getCalculatedList() // { // try // { // DataRow[] arrdr = null; // string sParam=""; // m_sDepartmentID = Convert.ToString(xleDepartment.Properties.LookUpData.KeyValue); // m_sSectionID = Convert.ToString(xleSection.Properties.LookUpData.KeyValue); // m_sGroupID = Convert.ToString(xleGroup.Properties.LookUpData.KeyValue); // m_sEmployeeID = Convert.ToString(xleIndividual.Properties.LookUpData.KeyValue); // // switch(m_iCurSelection) // { // case 1: //by Department // if ((m_sGroupID != null) && (m_sGroupID != "-1")) // { // sParam += "GroupID = '" + m_sGroupID + "'"; // } // else if ((m_sSectionID != null) && (m_sSectionID != "-1")) // { // sParam += "SectionID = '" + m_sSectionID + "'"; // } // else if ((m_sDepartmentID != null) &&(m_sDepartmentID != "-1")) // { // sParam = "DepartmentID = '" + m_sDepartmentID + "'"; // } // break; // case 3: //by Individual // sParam = "EmployeeID = '" + m_sEmployeeID + "'"; // break; // } // // if(m_iCurSelection != 0) // { // sParam += " AND (HireDate <=#" + m_dSalStop.ToString("MM/dd/yyyy") + "#" // + " AND (TerminateDate IS NULL OR TerminateDate>#" + m_dSalStart.ToString("MM/dd/yyyy") + "#)" // + " AND EmployeeStatusID 30)"; // } // else // { // sParam += " HireDate <=#" + m_dSalStop.ToString("MM/dd/yyyy") + "#" // + " AND (TerminateDate IS NULL OR TerminateDate>#" + m_dSalStart.ToString("MM/dd/yyyy") + "#)" // + " AND EmployeeStatusID 30"; // } // // //get applied list to an array of DataRow // arrdr = m_dtEmployee.Select(sParam); // return arrdr; // // } // catch(Exception ex) // { // Helper.ShowException(ex,this.Name + ".getAppliedList()",null); // return null; // } // } private void getCalculatedOption(out int iFilterOption, out string sFilterValue , out bool bSalCal , out bool bInsReCal) { //init output parameters iFilterOption = -1; sFilterValue = ""; bSalCal = false; bInsReCal = false; try { //string sParam=""; m_sDepartmentID = Convert.ToString(xleDepartment.Properties.LookUpData.KeyValue); m_sSectionID = Convert.ToString(xleSection.Properties.LookUpData.KeyValue); m_sGroupID = Convert.ToString(xleGroup.Properties.LookUpData.KeyValue); m_sEmployeeID = Convert.ToString(xleIndividual.Properties.LookUpData.KeyValue); //Get Applied/Filter option & value if (rdbAll.Checked == true) { iFilterOption = 0; // No filter sFilterValue = ""; } else if (rdbDepartment.Checked == true) { //default value for this option iFilterOption = 1; if((m_sGroupID != null) && (m_sGroupID != "-1")) { iFilterOption = 3; // Filter by group sFilterValue = m_sGroupID; } else if ((m_sSectionID != null) && (m_sSectionID != "-1")) { iFilterOption = 2; sFilterValue = m_sSectionID; } else if ((m_sDepartmentID != null) &&(m_sDepartmentID != "-1")) { iFilterOption = 1; sFilterValue = m_sDepartmentID; } } else if (rdbIndividual.Checked == true) { iFilterOption = 5; sFilterValue = m_sEmployeeID; } //Get calculation option if (rdbInsCalculation.Checked == true) { bSalCal = false; bInsReCal = false; } else if (rdbSalCalculation.Checked == true) { bSalCal = true; bInsReCal = chkReCalIns.Checked; } //return sParam; } catch(Exception ex) { Helper.ShowException(ex,this.Name + ".getCalculatedOption()",null); //return null; } } private void getSalCalculationError() { m_dtSalError = DBEngine.execReturnDataTable("PR_SalCal_GetError", "@Month", m_iCurMonth, "@Year", m_iCurYear, "@FilterOption", m_iCurSelection, "@FilterValue", m_sParam); //xgcSalError.DataSource = m_dtSalError; //lsbSalError.Items.AddRange(m_dtSalError.Rows); dgrSalError.DataSource = m_dtSalError; } private void setLockControl(bool locked) { try { if (locked == false) { xchLock.CheckState = CheckState.Unchecked; //xchLock.Enabled = true; xchLock.Properties.ReadOnly = false; xchUnlock.CheckState = CheckState.Checked; //xchUnlock.Enabled = false; xchUnlock.Properties.ReadOnly = true; xtePasswordConfirm.Enabled = true; } else { xchLock.CheckState = CheckState.Checked; //xchLock.Enabled = false; xchLock.Properties.ReadOnly = true; xchUnlock.CheckState = CheckState.Unchecked; //xchUnlock.Enabled = true; xchUnlock.Properties.ReadOnly = false; xtePasswordConfirm.Enabled = false; } xteName.Text = ""; xtePassword.Text = ""; xtePasswordConfirm.Text = ""; } catch(Exception ex) { throw(ex); } } private void getLockProperty( out bool bLocked, out string sUserName, out string sPassword) { m_dtSalLock = new DataTable(); m_dtSalLock = DBEngine.execReturnDataTable("PR_Sal_Lock_List","@month",m_iCurMonth,"@year",m_iCurYear); if ((m_dtSalLock == null)||(m_dtSalLock.Rows.Count == 0)) { bLocked = false; sUserName = ""; sPassword = ""; } else { bLocked = true; sUserName = m_dtSalLock.Rows[0]["UserName"].ToString(); sPassword = m_dtSalLock.Rows[0]["Password"].ToString(); } } #endregion #region EVENTS HANDLE private void xcbYear_ValueChanged(object sender, EventArgs e) { try { m_iCurYear = Convert.ToInt32(xcbYear.EditValue); //get Salary period getSalaryPeriod(); //filter Employee list filterEmployee(m_dSalStart,m_dSalStop); //get Lock property & set control according to the lock property getLockProperty(out bLocked,out sUserName, out sPassword); setLockControl(bLocked); } catch(Exception ex) { Helper.ShowException(ex,this.Name + ".xcbYear_ValueChanged()",null); return; } } private void xcbMonth_ValueChanged(object sender, EventArgs e) { try { m_iCurMonth = Convert.ToInt32(xcbMonth.EditValue); //get Salary period getSalaryPeriod(); //filter Employee list filterEmployee(m_dSalStart,m_dSalStop); //get Lock property & set control according to the lock property getLockProperty(out bLocked,out sUserName, out sPassword); setLockControl(bLocked); } catch(Exception ex) { Helper.ShowException(ex,this.Name + ".xcbMonth_ValueChanged()",null); return; } } private void btnStartCalculate_Click(object sender, System.EventArgs e) { try { getCalculatedOption(out m_iCurSelection, out m_sParam, out m_bSalCal, out m_bReCalIns); if(!OnValidate()) return; if(!ProtectCalculation()) return; btnStartCalculate.Enabled = false; //Now calculate this.Cursor = Cursors.WaitCursor ; DBEngine.beginTransaction(); if (m_bSalCal == true) { DBEngine.exec("SALCAL", "@Month", m_iCurMonth, "@Year",m_iCurYear, "@FilterOption", m_iCurSelection, "@FilterValue", m_sParam, "@ReCalIns",m_bReCalIns ); } else if (m_bSalCal == false) { DBEngine.exec("SALCAL_INSURANCE", "@Month", m_iCurMonth, "@Year",m_iCurYear, "@FilterOption", m_iCurSelection, "@FilterValue", m_sParam); } DBEngine.commit(); this.Cursor = Cursors.Default; if (m_bSalCal == true) { getSalCalculationError(); if (m_dtSalError.Rows.Count == 0) { UIMessage.ShowMessage("Salary calculation successfully without error!",System.Windows.Forms.MessageBoxButtons.OK,System.Windows.Forms.MessageBoxIcon.Information); } else { UIMessage.ShowMessage("Salary calculation successfully with some error. Please see the log list.",System.Windows.Forms.MessageBoxButtons.OK,System.Windows.Forms.MessageBoxIcon.Warning); } } else if (m_bSalCal == false) { UIMessage.ShowMessage("Insurance calculation is finished!",System.Windows.Forms.MessageBoxButtons.OK,System.Windows.Forms.MessageBoxIcon.Information); } // DataRow[] arrdr = null; // arrdr = getCalculatedList(); // if ((arrdr != null) && (arrdr.Length != 0)) // { // this.Cursor = Cursors.WaitCursor ; // // xpbCalculationProgress.Properties.Maximum = arrdr.Length; // foreach(DataRow dr in arrdr ) // { // // process data // lblCalculation.Text = dr["EmployeeID"].ToString() + " " + dr["FullName"].ToString(); // if (b_Calculate) // { // DBEngine.exec("SALCAL", // "@EmployeeID", dr["EmployeeID"].ToString(), // //"@FromDate",FromDate, // //"@ToDate",ToDate, // "@Year",m_iCurYear, // "@Month",m_iCurMonth); // } // else // { // b_Calculate = true; // this.Cursor = Cursors.Default; // UIMessage.ShowMessage("Salary calculation stopped by user!",System.Windows.Forms.MessageBoxButtons.OK,System.Windows.Forms.MessageBoxIcon.Information); // lblCalculation.Text = ""; // btnStartCalculate.Enabled = true; // btnStop.Enabled = false; // return; // } // xpbCalculationProgress.Increment(1); // //xpbProcecess.PerformStep(); // xpbCalculationProgress.Update(); // Application.DoEvents(); // } // this.Cursor = Cursors.Default; // UIMessage.ShowMessage("Salary calculation successfully!",System.Windows.Forms.MessageBoxButtons.OK,System.Windows.Forms.MessageBoxIcon.Information); // } // else // { // UIMessage.ShowMessage("No employee selected to calculate salary!",MessageBoxButtons.OK,MessageBoxIcon.Exclamation); // } //lblCalculation.Text = ""; btnStartCalculate.Enabled = true; //btnStop.Enabled = false; } catch (Exception ex) { Helper.ShowException(ex, this.Name + ".StartCalculate()", null); return; } //PrintReport(HRReportName.HRPersonalInfoByDept); } private void rdbAll_CheckedChanged(object sender, System.EventArgs e) { try { m_iCurSelection = 0; // selected to process all employees. EnableControls(); } catch(Exception ex) { Helper.ShowException(ex,this.Name + ".rdbAll_CheckedChanged()",null); return; } } private void rdbDepartment_CheckedChanged(object sender, System.EventArgs e) { try { m_iCurSelection = 1; // selected to process by department. EnableControls(); } catch(Exception ex) { Helper.ShowException(ex,this.Name + ".rdbDepartment_CheckedChanged()",null); return; } } private void rdbIndividual_CheckedChanged(object sender, System.EventArgs e) { try { m_iCurSelection = 5; // selected to process by individual. EnableControls(); } catch(Exception ex) { Helper.ShowException(ex,this.Name + ".rdbIndividual_CheckedChanged()",null); return; } } private void xleIndividual_ValueChanged(object sender, System.EventArgs e) { m_sSelEmployee = ""; try { if(xleIndividual.Properties.LookUpData.KeyValue != null) { m_sSelEmployee = xleIndividual.Properties.LookUpData.KeyValue.ToString(); // m_sParam = "EmployeeID = '" + m_sSelEmployee + "'"; DataRow dr = m_dtEmployee.Rows.Find(xleIndividual.Properties.LookUpData.KeyValue); if(dr != null) { xteFullName.Text = dr["FullName"].ToString(); } } } catch(Exception ex) { Helper.ShowException(ex,this.Name + ".xleIndividual_ValueChanged()",null); return; } } private void xleSection_ValueChanged(object sender, System.EventArgs e) { if (xleSection.Properties.LookUpData.KeyValue == null) return; try { //get selected Section //m_sSectionID = xleSection.Properties.LookUpData.KeyValue.ToString(); EnableControls(); m_dvGroup.RowFilter = "SectionID = " + xleSection.Properties.LookUpData.KeyValue.ToString() + " or GroupID = -1"; xleGroup.Properties.LookUpData.DataSource = m_dvGroup; xleGroup.Properties.LookUpData.KeyValue = -1; } catch(Exception ex) { Helper.ShowException(ex,this.Name + ".xleSection_ValueChanged()", null); return; } } private void xleDepartment_ValueChanged(object sender, System.EventArgs e) { if (xleDepartment.Properties.LookUpData.KeyValue == null) return; try { EnableControls(); m_dvSection.RowFilter = "DepartmentID = " + xleDepartment.Properties.LookUpData.KeyValue.ToString() + " or SectionID = -1"; xleSection.Properties.LookUpData.DataSource = m_dvSection; xleSection.Properties.LookUpData.KeyValue = -1; } catch(Exception ex) { Helper.ShowException(ex,this.Name + ".xleDepartment_ValueChanged()", null); return; } } // private void btnStop_Click(object sender, System.EventArgs e) // { // b_Calculate = false; // } private void xchLock_ValueChanged(object sender, EventArgs e) { try { if ((bLocked==false) && (xchLock.CheckState == CheckState.Checked)) { if (xteName.Text.Length ==0) { UIMessage.ShowMessage(1157,MessageBoxButtons.OK,MessageBoxIcon.Exclamation); return; } if (xtePassword.Text.Length == 0) { UIMessage.ShowMessage("Password for lock cannot be blank",MessageBoxButtons.OK,MessageBoxIcon.Exclamation); return; } if (xtePassword.Text != xtePasswordConfirm.Text) { UIMessage.ShowMessage("Please confirm password correctly!",MessageBoxButtons.OK,MessageBoxIcon.Exclamation); return; } DBEngine.exec("PR_Sal_Lock_Update", "@UserName",xteName.Text, "@Password",xtePassword.Text, "@Month", Convert.ToInt32(xcbMonth.EditValue), "@Year", Convert.ToInt32(xcbYear.EditValue)); bLocked = true; sUserName = xteName.Text; sPassword = xtePassword.Text; setLockControl(bLocked); } } catch(Exception ex) { throw(ex); } } private void xchLock_ValueChanging(object sender, DevExpress.XtraEditors.Controls.ChangingEventArgs e) { if ((bLocked==false) && (Convert.ToBoolean(e.NewValue) == true)) { if (xteName.Text.Length ==0) { //UIMessage.ShowMessage(1157,MessageBoxButtons.OK,MessageBoxIcon.Exclamation); UIMessage.ShowMessage("Staff name cannot be blank. Please input for locking.",MessageBoxButtons.OK,MessageBoxIcon.Exclamation); e.Cancel = true; return; } if (xtePassword.Text.Length == 0) { UIMessage.ShowMessage("Password for locking cannot be blank.",MessageBoxButtons.OK,MessageBoxIcon.Exclamation); e.Cancel = true; return; } if (xtePassword.Text != xtePasswordConfirm.Text) { UIMessage.ShowMessage("Please confirm password correctly!",MessageBoxButtons.OK,MessageBoxIcon.Exclamation); e.Cancel = true; return; } } } private void xchUnlock_ValueChanging(object sender, DevExpress.XtraEditors.Controls.ChangingEventArgs e) { try { if ((bLocked == true) && (Convert.ToBoolean(e.NewValue) == true)) { int iUnlock = 0; DBEngine.exec("PR_Sal_Lock_Delete" ,"@UserName", xteName.Text ,"@Password", xtePassword.Text ,"@Month", Convert.ToInt32(xcbMonth.EditValue) ,"@Year", Convert.ToInt32(xcbYear.EditValue) ); iUnlock = Convert.ToInt16(DBEngine.getParamValue("@RetVal")); if (iUnlock == 0) { UIMessage.ShowMessage("Staff name and/or Password is not correct!",MessageBoxButtons.OK,MessageBoxIcon.Exclamation); e.Cancel = true; return; } else { bLocked = false; sUserName = ""; sPassword = ""; setLockControl(bLocked); } } } catch(Exception ex) { throw(ex); } } private void rdbInsCalculation_CheckedChanged(object sender, EventArgs e) { if (rdbInsCalculation.Checked == true) { chkReCalIns.Enabled = false; } else { //chkReCalIns.CheckState = CheckState.Unchecked; chkReCalIns.Enabled = true; } } private void rdbSalCalculation_CheckedChanged(object sender, EventArgs e) { if (rdbSalCalculation.Checked == true) { chkReCalIns.Enabled = true; } } #endregion #region OVERWRITE public override bool InitializeData() { try { m_dtDepartment = new DataTable(); m_dtSection = new DataTable(); m_dtGroup = new DataTable(); m_dtEmployee = new DataTable(); m_dvSection = new DataView(); m_dvGroup = new DataView(); m_dvEmployee = new DataView(); DataTable dt = null; DataRow dr = null; //-------load data dt = DBEngine.execReturnDataTable("Gen_Department_List"); dr = dt.NewRow(); dr["DepartmentID"] = "-1"; dr["DepartmentName"] = "(None)"; dt.Rows.Add(dr); dt.DefaultView.Sort = "[DepartmentCode] ASC"; m_dtDepartment = dt; dt.TableName = "m_dtDepartment"; dt = DBEngine.execReturnDataTable("Gen_Section_List"); dr = dt.NewRow(); dr["SectionID"] = "-1"; dr["SectionName"] = "(None)"; dt.Rows.Add(dr); dt.DefaultView.Sort = "[SectionCode] ASC"; m_dtSection = dt; dt.TableName = "m_dtSection"; m_dvSection = m_dtSection.DefaultView; dt = DBEngine.execReturnDataTable("Gen_Group_List"); dr = dt.NewRow(); dr["GroupID"] = "-1"; dr["GroupName"] = "(None)"; dt.Rows.Add(dr); dt.DefaultView.Sort = "[GroupCode] ASC"; m_dtGroup = dt; dt.TableName = "m_dtGroup"; m_dvGroup = m_dtGroup.DefaultView; DataColumn[] colKey = new DataColumn[1]; m_dtEmployee = DBEngine.execReturnDataTable("Employee_List_Code_WithStatus"); colKey[0] = m_dtEmployee.Columns["EmployeeID"]; m_dtEmployee.PrimaryKey = colKey; m_dvEmployee=m_dtEmployee.DefaultView; m_dvEmployee.RowFilter = ""; //------- binding : xleDepartment.Properties.LookUpData.DataSource = m_dtDepartment; xleSection.Properties.LookUpData.DataSource = m_dvSection; xleGroup.Properties.LookUpData.DataSource = m_dvGroup; xleIndividual.Properties.LookUpData.DataSource = m_dvEmployee; //------- manual events handler myEvents(); //------- init some values : m_iCurMonth = DateTime.Now.Month ; m_iCurYear = DateTime.Now.Year ; xcbMonth.EditValue = m_iCurMonth; xcbYear.EditValue = m_iCurYear; xleDepartment.Properties.LookUpData.KeyValue = -1; xleSection.Properties.LookUpData.KeyValue = -1; xleGroup.Properties.LookUpData.KeyValue = -1; m_iCurSelection = 0; rdbAll.Checked = true; rdbSalCalculation.Checked = true; chkReCalIns.Checked = true; //enable/disable some controls in form EnableControls(); //set focus xcbMonth.Focus(); } catch (Exception e) { Helper.ShowException(e, this.Name + ".InitializeData()", null); return false; } return true; } public override bool OnValidate() { try { if(xcbMonth.Text == "" || xcbYear.Text=="") { UIMessage.ShowMessage(1152,MessageBoxButtons.OK,MessageBoxIcon.Exclamation); return false; } if(xteName==null || xtePassword ==null) { UIMessage.ShowMessage(1153,MessageBoxButtons.OK,MessageBoxIcon.Exclamation); return false; } //Check for null data switch (m_iCurSelection) { case 0: // all employees break; case 1: // by department if((m_sDepartmentID == null) ||(m_sDepartmentID == "-1")) { UIMessage.ShowMessage("Please choose a department for calculation.",MessageBoxButtons.OK,MessageBoxIcon.Exclamation); return false; } break; case 2: // by section if((m_sSectionID == null) ||(m_sSectionID == "-1")) { UIMessage.ShowMessage("Please choose a section for calculation.",MessageBoxButtons.OK,MessageBoxIcon.Exclamation); return false; } break; case 3: // by Group if((m_sGroupID == null) ||(m_sGroupID == "-1")) { UIMessage.ShowMessage("Please choose a group for calculation.",MessageBoxButtons.OK,MessageBoxIcon.Exclamation); return false; } break; case 5: // by individual emp. if((m_sEmployeeID == null) ||(m_sEmployeeID == "")) { UIMessage.ShowMessage("Please choose an employee for calculation.",MessageBoxButtons.OK,MessageBoxIcon.Exclamation); return false; } break; default: return false; } // TODO - add code here to validate data before saving } catch (Exception e) { Helper.ShowException(e, this.Name + ".OnValidate()", null); return false; } return true; } #endregion #region VARIABLES private DataTable m_dtDepartment; private DataTable m_dtSection; private DataTable m_dtGroup; private DataTable m_dtEmployee; private DataView m_dvSection; private DataView m_dvGroup; private DataView m_dvEmployee; private DataTable m_dtSalLock = null; private DataTable m_dtSalError; private string m_sEmployeeID,m_sDepartmentID, m_sSectionID, m_sGroupID; private string m_sParam = ""; private string m_sSelEmployee = ""; private int m_iCurSelection = -1; private bool m_bSalCal, m_bReCalIns; //private string // private bool b_Calculate = true; private int m_iCurMonth, m_iCurYear; private DateTime m_dSalStart,m_dSalStop; //for Lock property bool bLocked = false; string sUserName = "", sPassword = ""; #endregion } } TÀI LIỆU THAM KHẢO PGS. TS Nguyễn Văn Ba (2005), Phân tích và thiết kế hệ thống thông tin có cấu trúc, Nhà xuất bản Đại học Quốc gia Hà Nội. Catherin A. Creary, Christopher Allen, Simon Chatwin (2004), Nhập môn về cơ sở dữ liệu quan hệ và lập trình SQL, Nhà xuất bản Thống kê. PGS. TS Hàn Viết Thuận (2007), Bài giảng Công nghệ phần mềm, Khoa Tin học Kinh tế, Đại học Kinh tế Quốc dân. PGS. TS Hàn Viết Thuận (2005), Giáo trình Cấu trúc dữ liệu và giải thuật, Nhà xuất bản Đại học Kinh tế Quốc dân. TS. Trương Văn Tú & TS. Trần Thị Song Minh (2005), Hệ thống thông tin quản lý, Nhà xuất bản Đại học Kinh tế Quốc dân. PGS. TS Nguyễn Văn Vỵ (2004), Giáo trình phân tích thiết kế hệ thống thông tin, Nhà xuất bản Hà Nội. Roger S. Pressman (2001), Kỹ nghệ phần mềm – Cách tiếp cận của người thực hành, Tập 1-2-3, Nhà xuất bản giáo dục. www. zensoft. com www.vnzoom.com.vn www.wikipedia.com

Các file đính kèm theo tài liệu này:

  • doc20745.doc