protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //控制Tab的显示 string fragmentFlag = "1"; if (Request["fragment"] != null) { fragmentFlag = Request["fragment"]; } CommonUtility.ShowLiControl(fragmentFlag, liFragment1, liFragment2, liFragment3 , divFragment1, divFragment2, divFragment3); UserCookiesInfo UserCookiesInfo = BllOperationAboutUser.GetUserCookiesInfo(); if (UserCookiesInfo.userType == 1 || UserCookiesInfo.userType == 2) { DalOperationAboutTeacher DalOperationAboutTeacher = new DalOperationAboutTeacher(); TeachersList teacher = DalOperationAboutTeacher.GetTeacherById(UserCookiesInfo.userNo); ltlEmail.Text = teacher.emailAddress; txtOffice.Text = teacher.officeAddress; txtRemark.Text = teacher.remark; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string inSalaryItemIds = Request["inIds"]; string outSalaryItemIds = Request["outIds"]; string teacherNo = Request["tid"]; string cid = Request["cid"]; string acType = Request["acType"]; string teacherType = Request["teacherType"]; DalOperationAboutTeacherSalary dalts = new DalOperationAboutTeacherSalary(); string[] courseInfo = cid.Split('-'); cid = courseInfo[0]; TeacherSalary teacherSalary = dalts.GetTeacherSalaryByTidAndCidAndTermTag(teacherNo, cid, int.Parse(teacherType), null); List<SalaryItem> inSalaryItemList = GetInSalaryItemListByIdString(inSalaryItemIds, teacherSalary); List<SalaryItem> outSalaryItemList = GetOutSalaryItemListByIdString(outSalaryItemIds); if (inSalaryItemList.Count == 0) { Javascript.AlertAndRedirect("请至少选择一项待发薪酬项", "/Administrator/SelectSalaryItem.aspx?teacherNO=" + teacherNo, Page); } else { DalOperationAboutTeacher teacherDal = new DalOperationAboutTeacher(); TeachersList teacher = teacherDal.GetTeacherById(teacherNo); this.teacherNo.Value = teacher.teacherNo; this.teacherName.Text = teacher.teacherName; this.courseNo.Value = cid; this.atCourseType.Value = acType; this.teacherType.Value = teacherType; this.TeacherType_Literal.Text = CommonUtility.ConvertTeacherType2String(int.Parse(teacherType)); this.InSalaryItemList.DataSource = inSalaryItemList; this.InSalaryItemList.DataBind(); this.OutSalaryItemList.DataSource = outSalaryItemList; this.OutSalaryItemList.DataBind(); if (!string.IsNullOrWhiteSpace(cid)) { DalOperationAboutCourses dalc = new DalOperationAboutCourses(); Courses course = dalc.GetCoursesByNo(cid, null); this.Course_TR.Visible = true; this.CourseName_Literal.Text = course.courseName; this.Course_TR.Visible = true; this.CoursePeriod_TR.Visible = true; if (string.IsNullOrWhiteSpace(course.TestHours) || "0" == course.TestHours) { this.CoursePeriod_Literal.Text = course.period; } else { this.CoursePeriod_Literal.Text = course.period + "/" + course.TestHours; } } } } }
/// <summary> /// 从DataReader中转化并构造SalaryEntry记录集 /// </summary> /// <param name="dataReader"></param> /// <returns></returns> private void BuildSalaryEntry(IDataReader dataReader, List<SalaryEntry> salaryEntries) { DalOperationAboutTeacher dalt = new DalOperationAboutTeacher(); DalOperationAboutCourses dalc = new DalOperationAboutCourses(); if (dataReader != null) { while (dataReader.Read()) { SalaryEntry salaryEntry = new SalaryEntry(); salaryEntry.salaryEntryId = int.Parse(dataReader["salaryEntryId"].ToString().Trim()); TeachersList teacher = dalt.GetTeacherById(dataReader["teacherNo"].ToString().Trim()); salaryEntry.teacher = teacher; salaryEntry.teacherType = int.Parse(dataReader["teacherType"].ToString().Trim()); salaryEntry.termTag = dataReader["termTag"].ToString().Trim(); Courses course = dalc.GetCoursesByNo(dataReader["courseNo"].ToString().Trim(), salaryEntry.termTag); salaryEntry.course = course; salaryEntry.atCourseType = dataReader["atCourseType"].ToString().Trim(); salaryEntry.SetSalaryInItemValueList(dataReader["salaryInItemValueList"].ToString().Trim(), true); salaryEntry.SetSalaryOutItemValueList(dataReader["salaryOutItemValueList"].ToString().Trim(), true); if (dataReader["salaryInAdjustFactor"] != null) { salaryEntry.salaryInAdjustFactor = float.Parse(dataReader["salaryInAdjustFactor"].ToString().Trim()); } if (dataReader["salaryOutAdjustFactor"] != null) { salaryEntry.salaryOutAdjustFactor = float.Parse(dataReader["salaryOutAdjustFactor"].ToString().Trim()); } if (dataReader["teachPeriod"] != null) { salaryEntry.teachPeriod = int.Parse(dataReader["teachPeriod"].ToString().Trim()); } if (dataReader["teachAssiPeriod"] != null) { salaryEntry.teachAssiPeriod = int.Parse(dataReader["teachAssiPeriod"].ToString().Trim()); } salaryEntry.teacherCostWithTax = float.Parse(dataReader["teacherCostWithTax"].ToString().Trim()); salaryEntry.teacherCostWithoutTax = float.Parse(dataReader["teacherCostWithoutTax"].ToString().Trim()); salaryEntry.teacherTotalCost = float.Parse(dataReader["teacherTotalCost"].ToString().Trim()); salaryEntry.salaryMonth = dataReader["salaryMonth"].ToString().Trim(); salaryEntry.salaryEntryStatus = int.Parse(dataReader["salaryEntryStatus"].ToString()); salaryEntry.createdTime = DateTime.Parse(dataReader["createdTime"].ToString().Trim()); salaryEntry.memo = dataReader["memo"].ToString().Trim(); salaryEntries.Add(salaryEntry); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string tid = Request["teacherNO"]; string courseNo = Request["courseNo"]; if (tid == null || tid.Trim().Length == 0) { Javascript.Alert("请先选择教师后再进行此项操作", Page); Javascript.RefreshParentWindow("/Administrator/SalaryManage.aspx?fragment=1", Page); } else { DalOperationAboutTeacher teacherDal = new DalOperationAboutTeacher(); TeachersList teacher = teacherDal.GetTeacherById(tid); if (teacher == null) { Javascript.AlertAndRedirect("请先确定教师后再进行此项操作", "/Administrator.aspx?fragment=1", Page); } else { this.teacherName.Text = teacher.teacherName; this.teacherNo.Value = teacher.teacherNo; } int teacherType = 1; if ("本院" == teacher.teacherType) { teacherType = 1; } else { this.SelectCourse_Literal.Visible = true; this.SelectCourse.Visible = true; DalOperationAboutTeacher dalt = new DalOperationAboutTeacher(); DataTable dsTeacher = dalt.GetCoursesByTeacherAssistant(tid).Tables[0]; if (dsTeacher.Rows.Count == 0) { Javascript.Alert("该教师非院内教师并且本学期未待任何课程!", Page); Javascript.RefreshParentWindowReload(Page); } else { DataBindTeacherSalaryCourse(dsTeacher, courseNo); if (string.IsNullOrWhiteSpace(courseNo)) { courseNo = this.SelectCourse.SelectedValue; } string[] courseInfo = courseNo.Split('-'); int atCourseType = 1; if (courseInfo.Length > 1) { atCourseType = int.Parse(courseInfo[1].Trim()); } teacherType = CommonUtility.CheckTeacherType(teacher.teacherType, atCourseType); } } this.TeacherType_Literal.Text = CommonUtility.ConvertTeacherType2String(teacherType); this.teacherType.Value = teacherType.ToString(); DalOperationAboutSalaryItem dalsi = new DalOperationAboutSalaryItem(); List<SalaryItem> salaryItems = dalsi.GetAllSalaryItem(teacherType, 1); this.TeacherInSalaryItemList.DataSource = salaryItems; this.TeacherInSalaryItemList.DataBind(); this.TeacherOutSalaryItemList.DataSource = salaryItems; this.TeacherOutSalaryItemList.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string formatedTeacherSalaryCostWithTax = CommonUtility.ConvertFormatedFloat("{0:F2}", Request["withTax"].Trim()).ToString(); string formatedTeacherSalaryCostWithoutTax = CommonUtility.ConvertFormatedFloat("{0:F2}", Request["withoutTax"].Trim()).ToString(); string formatedTeacherTotalCost = CommonUtility.ConvertFormatedFloat("{0:F2}", Request["totalCost"].Trim()).ToString(); this.TeacherSalaryCostWithTax.Text = formatedTeacherSalaryCostWithTax; this.TeacherSalaryCostWithoutTax.Text = formatedTeacherSalaryCostWithoutTax; this.TeacherTotalCost.Text = formatedTeacherTotalCost; this.InSalaryItemValueList.Value = Request["inValueList"]; this.OutSalaryItemValueList.Value = Request["outValueList"]; SalaryEntry salaryEntry = new SalaryEntry(); salaryEntry.SetSalaryInItemValueList(Request["inValueList"], true); salaryEntry.SetSalaryOutItemValueList(Request["outValueList"], true); List<SalaryItemElement> inItemElements = salaryEntry.GetSalaryInItemElements(); List<SalaryItemElement> outItemElements = salaryEntry.GetSalaryOutItemElements(); FullFillSalaryItemElements(inItemElements); FullFillSalaryItemElements(outItemElements); this.ShowSalaryInItems.DataSource = inItemElements; this.ShowSalaryOutItems.DataSource = outItemElements; this.ShowSalaryInItems.DataBind(); this.ShowSalaryOutItems.DataBind(); DataBindSearchTermTagList(); this.TeacherId.Value = Request["tid"]; DalOperationAboutTeacher teacherDal = new DalOperationAboutTeacher(); TeachersList teacher = teacherDal.GetTeacherById(Request["tid"].Trim()); this.TeacherName.Text = teacher.teacherName; DateTime lastMonth = DateTime.Now.Date.AddMonths(-1); string lastMonthString = lastMonth.Month < 10 ? "0" + lastMonth.Month.ToString() : lastMonth.Month.ToString(); this.SalaryMonth.Value = lastMonth.Year + "-" + lastMonthString; this.CourseId.Value = Request["cid"]; this.atCourseType.Value = Request["acType"]; this.teacherType.Value = Request["teacherType"]; } }
protected void Page_Load(object sender, EventArgs e) { UserCookiesInfo userCookiesInfo = BllOperationAboutUser.GetUserCookiesInfo(); if (!isAuth(userCookiesInfo.userNo)) { Javascript.Alert("你无权查看此页面", Page); Javascript.RefreshParentWindow("/Common/NotifyList.aspx", Page); } else { //控制Tab的显示 string fragmentFlag = "2"; if (Request["fragment"] != null) { fragmentFlag = Request["fragment"]; } CommonUtility.ShowLiControl(fragmentFlag, liFragment1, liFragment2, liFragment3 , liFragment4, liFragment5, divFragment1, divFragment2, divFragment3, divFragment4, divFragment5); if (fragmentFlag.Equals("2")) { if (!IsPostBack) { DataListBindSalaryItem(); } } if (fragmentFlag.Equals("3")) { if (!IsPostBack) { string tid = Request["teacherNo"]; if (tid != null && tid.Trim().Length != 0) { DalOperationAboutTeacher teacherDal = new DalOperationAboutTeacher(); TeachersList teacher = teacherDal.GetTeacherById(tid); this.TeacherSalary_TeacherName.Text = teacher.teacherName; } DataListBindTeacherSalary(); } } if (fragmentFlag.Equals("4")) { if (!IsPostBack) { string tid = Request["teacherNo"]; if (tid == null || tid.Trim().Length == 0) { Javascript.AlertAndRedirect("请先选择教师再进行此项操作", "/Administrator/SalaryManage.aspx?fragmentFlag=1", Page); } else { Javascript.JavaScriptLocationHref("SelectSalaryItem.aspx?keepThis=true&tid=" + tid + "&TB_iframe=true&height=300&width=500", Page); } } } if (fragmentFlag.Equals("5")) { if (!IsPostBack) { string tid = Request["teacherNo"]; if (tid != null && tid.Trim().Length != 0) { DalOperationAboutTeacher teacherDal = new DalOperationAboutTeacher(); TeachersList teacher = teacherDal.GetTeacherById(tid); this.SalaryQuery_Name.Text = teacher.teacherName; } DataListBindSalaryEntry(); } } } }
/// <summary> /// 把从数据库中读出的数据转化为对象实例 /// </summary> /// <param name="reader"></param> /// <param name="salaries"></param> /// <returns></returns> private void buildTeacherSalarys(IDataReader reader, List<TeacherSalary> salaries) { DalOperationAboutCourses courseDal = new DalOperationAboutCourses(); DalOperationAboutTeacher teacherDal = new DalOperationAboutTeacher(); while (reader.Read()) { TeacherSalary salary = new TeacherSalary(); salary.teacherSalaryId = int.Parse(reader["teacherSalaryId"].ToString().Trim()); salary.teacher = teacherDal.GetTeacherById(reader["teacherNo"].ToString().Trim()); salary.teacherType = int.Parse(reader["teacherType"].ToString().Trim()); salary.termTag = reader["termTag"].ToString().Trim(); if (reader["courseNo"] != null && reader["courseNo"].ToString().Trim().Length > 0) { salary.course = courseDal.GetCoursesByNo(reader["courseNo"].ToString().Trim(), salary.termTag); salary.atCourseType = int.Parse(reader["atCourseType"].ToString().Trim()); salary.teachPeriod = int.Parse(reader["teachPeriod"].ToString().Trim()); salary.experPeriod = int.Parse(reader["experPeriod"].ToString().Trim()); } salary.SetSalaryInItemValueList(reader["salaryItemValueList"].ToString().Trim(), true); salary.totalTeachCost = float.Parse(reader["totalTeachCost"].ToString().Trim()); salary.isConfirm = bool.Parse(reader["isConfirm"].ToString().Trim()); salary.memo = reader["memo"].ToString().Trim(); salary.createdTime = DateTime.Parse(reader["createdTime"].ToString().Trim()); salaries.Add(salary); } }
protected void Page_Load(object sender, EventArgs e) { UserCookiesInfo userCookiesInfo = BllOperationAboutUser.GetUserCookiesInfo(); string tid = userCookiesInfo.userNo; if (tid == null || tid.Trim().Length == 0) { Javascript.AlertAndRedirect("你尚未登陆,请先登陆!", "/Common/NotifyList.aspx", Page); } else { //控制Tab的显示 string fragmentFlag = "1"; if (Request["fragment"] != null) { fragmentFlag = Request["fragment"]; } CommonUtility.ShowLiControl(fragmentFlag, liFragment1, liFragment2, divFragment1, divFragment2); if (fragmentFlag.Equals("1")) { if (!IsPostBack) { DalOperationAboutTeacher teacherDal = new DalOperationAboutTeacher(); TeachersList teacher = teacherDal.GetTeacherById(tid); this.TeacherSalary_Name.Text = teacher.teacherName; DataListBindTeacherSalary(tid); } } if (fragmentFlag.Equals("2")) { if (!IsPostBack) { DalOperationAboutTeacher teacherDal = new DalOperationAboutTeacher(); TeachersList teacher = teacherDal.GetTeacherById(tid); this.SalaryEntry_TeacherName.Text = teacher.teacherName; DataListBindSalaryEntry(tid); } } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string tid = Request["teacherNo"]; string courseNo = Request["cid"]; string teacherType = Request["teacherType"]; string atCourseType = Request["acType"]; if (tid == null || tid.Trim().Length == 0) { Javascript.Alert("请先选择教师再进行此项操作", Page); Javascript.RefreshParentWindow("/Administrator/SalaryManage.aspx?fragment=1", Page); } else { DalOperationAboutTeacher dal = new DalOperationAboutTeacher(); TeachersList teacher = dal.GetTeacherById(tid); if (teacher == null) { Javascript.AlertAndRedirect("请正确选择教师后再进行此操作", "/Administrator/SalaryManage.aspx?fragmentFlag=1", Page); } else { this.teacherName.Text = teacher.teacherName; this.teacherNo.Value = teacher.teacherNo; this.teacherType.Value = teacherType; } DataBindSearchTermTagList(this.TeacherSalary_TermTag.Items); if (!string.IsNullOrWhiteSpace(courseNo)) { DalOperationAboutCourses dalc = new DalOperationAboutCourses(); string[] courseInfo = courseNo.Split('-'); Courses course = dalc.GetCoursesByNo(courseInfo[0], null); this.Course_TR.Visible = true; string courseName = course.courseName + (atCourseType == "1" ? "(教师)" : "(助教)"); this.CourseName_Literal.Text = courseName; this.CourseId_hf.Value = course.courseNo; this.teachPeriod_TR.Visible = true; this.experPeriod_TR.Visible = true; this.atCourseType.Value = atCourseType; DataBindTeacherSalaryCourse(course); } this.teacherType_Literal.Text = CommonUtility.ConvertTeacherType2String(int.Parse(teacherType.Trim())); string inSalaryItemIds = Request["inIds"]; List<SalaryItem> inSalaryItemList = GetSalaryItemListByIdString(inSalaryItemIds); TeacherSalary_ItemList.DataSource = inSalaryItemList; TeacherSalary_ItemList.DataBind(); } } }