예제 #1
0
파일: frmStaff.cs 프로젝트: kimykunjun/test
        private void frmStaff_Load(object sender, System.EventArgs e)
        {
            // TODO: This line of code loads data into the 'aCMSDataSet.TblDeliverySchedule' table. You can move, or remove it, as needed.
            //this.tblDeliveryScheduleTableAdapter.Fill(this.aCMSDataSet.TblDeliverySchedule, oUser.NDepartmentID());
            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);

            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;
            cbAppointmentYear.Properties.Items.AddRange(years);
            cbAppointmentYear.EditValue = currentYear;
            cbAppointmentMonth.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(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();

            //			employee.RightsLevel.Id = 105;

            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();

            int_lblFour();
            lblFour_1.ForeColor = System.Drawing.Color.Firebrick;
            tabStaffFour.TabControl.SelectedTabPage = tabStaffFour;
            groupAppointment.Show();
        }
예제 #2
0
파일: frmStaff.cs 프로젝트: kimykunjun/test
        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();
        }