Example #1
0
        public frmLeave(int nLeaveID, int nEmployeeID, DataRow employeeInfo)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            ACMS.XtraUtils.XtraEditors.SetDateEditFormat(this.Controls);
            this.nLeaveID = nLeaveID;
            this.nEmployeeID = nEmployeeID;
            myLeave = new ACMSLogic.Staff.Leave();
            myEmployeeInfo = employeeInfo;

            if (nLeaveID < 0)
            {
                this.Text = "Apply Leave";
                luedtLeaveType.Enabled = true;
            }
            else
            {
                this.Text = "Edit Leave";
                luedtLeaveType.Enabled = false;
            }

            new XtraUtils.LookupEditBuilder.LeaveCodeLookupEditBuilder(nEmployeeID,luedtLeaveType.Properties);

            DataTable leaveTypeTable = luedtLeaveType.Properties.DataSource as DataTable;

            if (!ACMS.Convert.ToBoolean(myEmployeeInfo["fMaternityLeave"]))
            {
                DataRow[] rows = leaveTypeTable.Select("strLeaveCode = 'MTL' OR strLeaveCode = 'MT3'");
                foreach (DataRow row in rows)
                {
                    row.Delete();
                }
            }

            if (!ACMS.Convert.ToBoolean(myEmployeeInfo["fChildCareLeave"]))
            {
                DataRow[] rows = leaveTypeTable.Select("strLeaveCode = 'CHD'");
                foreach (DataRow row in rows)
                {
                    row.Delete();
                }
            }

            leaveTypeTable.AcceptChanges();
        }
Example #2
0
        public frmLeave(int nLeaveID, int nEmployeeID, DataRow employeeInfo)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            ACMS.XtraUtils.XtraEditors.SetDateEditFormat(this.Controls);
            this.nLeaveID    = nLeaveID;
            this.nEmployeeID = nEmployeeID;
            myLeave          = new ACMSLogic.Staff.Leave();
            myEmployeeInfo   = employeeInfo;

            if (nLeaveID < 0)
            {
                this.Text = "Apply Leave";
                luedtLeaveType.Enabled = true;
            }
            else
            {
                this.Text = "Edit Leave";
                luedtLeaveType.Enabled = false;
            }

            new XtraUtils.LookupEditBuilder.LeaveCodeLookupEditBuilder(nEmployeeID, luedtLeaveType.Properties);

            DataTable leaveTypeTable = luedtLeaveType.Properties.DataSource as DataTable;

            if (!ACMS.Convert.ToBoolean(myEmployeeInfo["fMaternityLeave"]))
            {
                DataRow[] rows = leaveTypeTable.Select("strLeaveCode = 'MTL' OR strLeaveCode = 'MT3'");
                foreach (DataRow row in rows)
                {
                    row.Delete();
                }
            }

            if (!ACMS.Convert.ToBoolean(myEmployeeInfo["fChildCareLeave"]))
            {
                DataRow[] rows = leaveTypeTable.Select("strLeaveCode = 'CHD'");
                foreach (DataRow row in rows)
                {
                    row.Delete();
                }
            }

            leaveTypeTable.AcceptChanges();
        }
Example #3
0
        private void frmStaff_Load(object sender, System.EventArgs e)
        {
            barstaticCurrentLogin.Caption = string.Format(barstaticCurrentLogin.Caption, employee.StrEmployeeName, DateTime.Now.ToString("dd MMMM yyyy"));

            connectionString = (string)ConfigurationSettings.AppSettings["Main.ConnectionString"];
            connection = new SqlConnection(connectionString);

            myEmployeeInfo = Ultis.EmployeeInfo(employee.Id);
            myLeaveEmployeeInfo = myEmployeeInfo;

            TabStaff_init();

            int currentYear = DateTime.Now.Year;
            object[] years = new object[]{currentYear - 3, currentYear - 2, currentYear - 1, currentYear, currentYear + 1};
            cbServiceYear.Properties.Items.AddRange(years);
            cbServiceYear.EditValue = currentYear;
            cbServiceMonth.SelectedIndex = DateTime.Now.Month - 1;
            cbSalesYear.Properties.Items.AddRange(years);
            cbSalesYear.EditValue = currentYear;
            cbSalesMonth.SelectedIndex = DateTime.Now.Month - 1;
            cbTimesheetYear.Properties.Items.AddRange(years);
            cbTimesheetYear.EditValue = currentYear;
            cbTimesheetMonth.SelectedIndex = DateTime.Now.Month - 1;
            cbAppointmentYear.Properties.Items.AddRange(years);
            cbAppointmentYear.EditValue = currentYear;
            cbAppointmentMonth.SelectedIndex = DateTime.Now.Month - 1;
            cbOvertimeYear.Properties.Items.AddRange(years);
            cbOvertimeYear.EditValue = currentYear;
            cbOvertimeMonth.SelectedIndex = DateTime.Now.Month - 1;
            cbLatenessYear.Properties.Items.AddRange(years);
            cbLatenessYear.EditValue = currentYear;
            cbLatenessMonth.SelectedIndex = DateTime.Now.Month - 1;

            mySpaCommission = new CommissionSpaService();
            myPTCommission = new CommissionPTService();
            mySalesCommission = new SalesCommission();
            myCV = new ACMSLogic.Staff.CV();
            myMemo = new ACMSLogic.Staff.Memo();
            myReceipientGroup = new ACMSLogic.Staff.ReceipientGroup();
            myAppointment = new Appointment();
            myContacts = new Contacts();
            myTimesheet = new Timesheet();
            myLateness = new Lateness();
            myLeave = new Leave();

            timer1.Enabled = true;

            luedtSalesBranchCode.EditValue = terminalUser.Branch.Id;
            luedtCommissionServiceBranch.EditValue = terminalUser.Branch.Id;

            new ACMS.XtraUtils.LookupEditBuilder.BranchCodeLookupEditBuilder2(luedtSalesBranchCode.Properties);
            new ACMS.XtraUtils.LookupEditBuilder.BranchCodeLookupEditBuilder2(luedtCommissionServiceBranch.Properties);
            new ACMS.XtraUtils.LookupEditBuilder.EmployeeIDLookupEditBuilder(luedtLeaveEmployeeID.Properties);
            new ACMS.XtraUtils.LookupEditBuilder.EmployeeIDLookupEditBuilder(luedtMemoEmployeeID.Properties);
            new ACMS.XtraUtils.LookupEditBuilder.DepartmentLookupEditBuilder2(luedtCVAssignTo.Properties);

            //			employee.RightsLevel.Id = 103;
            if (employee.HasRight("AS_VIEW_ALL_CV"))
            {
                new ACMS.XtraUtils.LookupEditBuilder.EmployeeIDLookupEditBuilder(luedtCVSubmitter.Properties);
                //Add not filter row for Submiter
                DataTable tempTable = luedtCVSubmitter.Properties.DataSource as DataTable;
                DataRow tempRow = tempTable.NewRow();
                tempRow.BeginEdit();
                tempRow["nEmployeeID"] = DBNull.Value;
                tempRow["strEmployeeName"] = "<<No Filter>>";
                tempRow.EndEdit();
                tempTable.Rows.Add(tempRow);
                tempTable.AcceptChanges();
                luedtCVSubmitter.Visible = true;
                lblCVSubmitter.Visible = true;
            }
            else
            {
                luedtCVSubmitter.Visible = false;
                lblCVSubmitter.Visible = false;
            }
            //Add not filter row for AssignTo
            DataTable tempTable2 = luedtCVAssignTo.Properties.DataSource as DataTable;
            DataRow tempRow2 = tempTable2.NewRow();
            tempRow2.BeginEdit();
            tempRow2["nDepartmentID"] = DBNull.Value;
            tempRow2["strDescription"] = "<<No Filter>>";
            tempRow2.EndEdit();
            tempTable2.Rows.Add(tempRow2);
            tempTable2.AcceptChanges();

            startLeaveDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
            luedtLeaveEmployeeID.EditValue = employee.Id;

            //			employee.RightsLevel.Id = 105;
            if (!employee.HasRight("AS_LEAVE_SUPER_RIGHT"))
            {
                lblLeaveEmployeeID.Visible = false;
                luedtLeaveEmployeeID.Visible = false;
            }

            isFinishedMemoInit = false;
            isFinishedCVInit = false;
            luedtMemoEmployeeID.EditValue = employee.Id;
            isFinishedMemoInit = true;

            //			employee.RightsLevel.Id = 106;
            if (!employee.HasRight("AS_MEMO_SUPER_RIGHT"))
            {
                lblMemoEmployeeID.Visible = false;
                luedtMemoEmployeeID.Visible = false;
            }
            ListMemo();
            ListReceipientGroup();
        }