Exemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                int check = CheckControl();
                switch (check)
                {
                case 0:
                    DayTypeDO daytype = new DayTypeDO();
                    ContractID = Int16.Parse(((MTGCComboBoxItem)cboContract.SelectedItem).Col1);
                    int result = daytype.UpdateTypeSalary(SalaryID, txtName.Text, txtDescription.Text, ContractID, decimal.Parse(txtbasicsalary.Text));
                    if (result >= 2)
                    {
                        if (result == 2)
                        {
                            MessageBox.Show("Thêm thành công !", "Thông báo");
                        }
                        else if (result == 3)
                        {
                            MessageBox.Show("Cập nhật thành công !", "Thông báo");
                        }
                        frmParent.Init();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("Tên kiểu lương đã tồn tại trong hệ thống !", "Thông báo");
                    }

                    break;

                case 1:
                    MessageBox.Show("Vui lòng nhập vào tên kiểu lương !", "Thông báo");
                    break;

                case 2:
                    MessageBox.Show("Lương cơ bản > 0", "Thông báo");
                    break;

                case 3:
                    MessageBox.Show("Vui lòng nhập lương cơ bản !", "Thông báo");
                    break;
                }
            }
            catch
            {
            }
        }
Exemplo n.º 2
0
 private void frmDayType_Load(object sender, System.EventArgs e)
 {
     EVsoft.HRMS.Common.GeneralProcess.StandardFormControl(this);
     Refresh();
     dayTypeDO = new DayTypeDO();
     dtDayType = dsDayType.Tables[0];
     if (selectedRowIndex >= 0)           // chế độ sửa, hiển thị lại dữ liệu
     {
         string str = WorkingContext.LangManager.GetString("frmDayType_Text2");
         //this.Text = "Sửa kiểu ngày nghỉ";
         this.Text = str;
         LoadDayTypeData();
     }
     else
     {
         string str = WorkingContext.LangManager.GetString("frmDayType_Text");
         this.Text = str;
     }
 }