예제 #1
0
		public TeacherOnDutyInfo()
		{
			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();

			// TODO: Add any initialization after the InitForm call

			getStuInfoByCondition = new GetStuInfoByCondition();
			rolesSystem = new RolesSystem();

			dateEdit_TeaDutyDetailsSearByStartTime.EditValue = DateTime.Now;
			dateEdit_TeaDutyDetailsSearByEndTime.EditValue = DateTime.Now;
			dateEdit1.EditValue = DateTime.Now;
			dateEdit2.EditValue = DateTime.Now;
			dateEdit_DutyHistory.EditValue = DateTime.Now;

			LoadGradeClassInfo();

			DutyInfo = new DutySystem().GetDutyInfoList();

			BindDutyData();

			dataNavigator_DutyDetails.DataSource = DutyInfo.Tables[0];

			if(!Thread.CurrentPrincipal.IsInRole("园长") && Thread.CurrentPrincipal.Identity.Name.ToLower() != "admin" )
			{
				DataSet dsRolesDuty = rolesSystem.GetRolesDuty(Convert.ToInt32(Thread.CurrentPrincipal.Identity.Name));
				string gradeName = dsRolesDuty.Tables[0].Rows[0][0].ToString();
				string className = dsRolesDuty.Tables[0].Rows[0][1].ToString();

				comboBoxEdit_TeaDutyDetailsSearByGrade.Properties.Items.Clear();
				comboBoxEdit_TeaDutyDetailsSearByGrade.Properties.Items.AddRange(new object[]{gradeName});
				comboBoxEdit_TeaDutyDetailsSearByGrade.SelectedItem = gradeName;
				comboBoxEdit_TeaDutyDetailsSearByClass.Properties.Items.Clear();
				comboBoxEdit_TeaDutyDetailsSearByClass.Properties.Items.AddRange(new object[]{className});
				comboBoxEdit_TeaDutyDetailsSearByClass.SelectedItem = className;
			
				textEdit_TeaDutyDetailsSearByName.Text = new HealthManagementSystem().GetTeaName(Thread.CurrentPrincipal.Identity.Name);
				textEdit_TeaDutyDetailsSearByName.Properties.ReadOnly = true;
				textEdit_TeaDutyDetailsSearByID.Text = Thread.CurrentPrincipal.Identity.Name;
				textEdit_TeaDutyDetailsSearByID.Properties.ReadOnly = true;

				simpleButton_SaveDutyAsign.Enabled = false;

				dataNavigator_DutyDetails.Buttons.Append.Visible = false;
				dataNavigator_DutyDetails.Buttons.Remove.Visible = false;
				dataNavigator_DutyDetails.Buttons.EndEdit.Visible = false;
				xtraTabPage_TeaOnDutyReports.PageVisible = false;
	
				this.gridColumn4.OptionsColumn.AllowEdit = false;
				this.gridColumn5.OptionsColumn.AllowEdit = false;
				this.gridColumn6.OptionsColumn.AllowEdit = false;
				this.gridColumn7.OptionsColumn.AllowEdit = false;
				this.gridColumn8.OptionsColumn.AllowEdit = false;
				this.gridColumn9.OptionsColumn.AllowEdit = false;
				this.gridColumn10.OptionsColumn.AllowEdit = false;

			}
			if ( Thread.CurrentPrincipal.Identity.Name.ToLower() == "admin" )
			{
				simpleButton_SearTeaDutyDetails.Enabled = false;
				simpleButton3.Enabled = false;
				simpleButton_LoadHisDuty.Enabled = false;
				simpleButton_TeaDutySave.Enabled = false;
			}

			simpleButton3.Enabled = false;

			LoadSelectTeaDutyInfo();

			simpleButton1_Click(null,null);

			#region 帮助
			helpProvider_DutyInfo.HelpNamespace = System.IO.Path.GetDirectoryName(Application.ExecutablePath)
				+ CPTT.SystemFramework.Util.HELP_FILE_NAME;

			this.helpProvider_DutyInfo.SetHelpKeyword(this.xtraTabPage_TeaDutyDetails,"班次管理");
			this.helpProvider_DutyInfo.SetHelpNavigator(this.xtraTabPage_TeaDutyDetails, System.Windows.Forms.HelpNavigator.KeywordIndex);
			this.helpProvider_DutyInfo.SetHelpString(this.xtraTabPage_TeaDutyDetails, "");
			this.helpProvider_DutyInfo.SetShowHelp(this.xtraTabPage_TeaDutyDetails, true);

			this.helpProvider_DutyInfo.SetHelpKeyword(this.xtraTabPage_TeaOnDutyInfo,"出勤信息");
			this.helpProvider_DutyInfo.SetHelpNavigator(this.xtraTabPage_TeaOnDutyInfo, System.Windows.Forms.HelpNavigator.KeywordIndex);
			this.helpProvider_DutyInfo.SetHelpString(this.xtraTabPage_TeaOnDutyInfo, "");
			this.helpProvider_DutyInfo.SetShowHelp(this.xtraTabPage_TeaOnDutyInfo, true);

			this.helpProvider_DutyInfo.SetHelpKeyword(this.xtraTabPage_TeaOnDutyReports,"出勤信息分析");
			this.helpProvider_DutyInfo.SetHelpNavigator(this.xtraTabPage_TeaOnDutyReports, System.Windows.Forms.HelpNavigator.KeywordIndex);
			this.helpProvider_DutyInfo.SetHelpString(this.xtraTabPage_TeaOnDutyReports, "");
			this.helpProvider_DutyInfo.SetShowHelp(this.xtraTabPage_TeaOnDutyReports, true);
			#endregion
		}