コード例 #1
0
ファイル: AddSalaryEntry.aspx.cs プロジェクト: skyaspnet/usta
        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;
                        }
                    }

                }
            }
        }