Esempio n. 1
0
        public void SetStudent(JHStudentRecord student)
        {
            ClearField();

            JHParentRecord  parent  = JHParent.SelectByStudent(student);
            JHPhoneRecord   phone   = JHPhone.SelectByStudent(student);
            JHAddressRecord address = JHAddress.SelectByStudent(student);
            string          base64  = K12.Data.Photo.SelectGraduatePhoto(student.ID);

            _data["姓名"]   = student.Name;
            _data["性別"]   = student.Gender;
            _data["身分證號"] = student.IDNumber;
            _data["學號"]   = student.StudentNumber;
            _data["班級"]   = (student.Class != null ? student.Class.Name : "");
            _data["座號"]   = "" + student.SeatNo;
            //_data["出生日期"] = Common.CDate(student.Birthday.HasValue ? student.Birthday.Value.ToShortDateString() : "");
            //_data["國籍"] = student.Nationality;
            //_data["家長或監護人"] = (parent != null) ? parent.Custodian.Name : "";
            //_data["關係"] = (parent != null) ? parent.Custodian.Relationship : "";
            //_data["行動電話"] = (phone != null) ? phone.Cell : "";
            //_data["戶籍電話"] = (phone != null) ? phone.Permanent : "";
            _data["戶籍地址"] = (address != null) ? address.Permanent.ToString() : "";
            //_data["聯絡電話"] = (phone != null) ? phone.Contact : "";
            //_data["聯絡地址"] = (address != null) ? address.Mailing.ToString() : "";
            //_data["證書字號"] = ""; //先放著…
            _data["照片粘貼處"] = base64;
        }
        public void SetStudent(JHStudentRecord student, List <SemesterHistoryItem> semesterHistoryList)
        {
            ClearField();
            // 學期歷程
            _semesterHistoryList = semesterHistoryList;
            //ParentRecord parent = student.GetParent();
            //PhoneRecord phone = student.GetPhone();
            //AddressRecord address = student.GetAddress();

            JHParentRecord  parent  = JHParent.SelectByStudent(student);
            JHPhoneRecord   phone   = JHPhone.SelectByStudent(student);
            JHAddressRecord address = JHAddress.SelectByStudent(student);
            string          base64  = K12.Data.Photo.SelectGraduatePhoto(student.ID);

            // 畢業資訊
            JHLeaveInfoRecord GradeInfo = JHLeaveIfno.SelectByStudentID(student.ID);

            string EnrollSchoolYear = "";

            foreach (JHUpdateRecordRecord rec in JHUpdateRecord.SelectByStudentID(student.ID))
            {
                if (rec.UpdateCode == "1")
                {
                    int sc;
                    if (rec.EnrollmentSchoolYear.Length == 6)
                    {
                        int.TryParse(rec.EnrollmentSchoolYear.Substring(0, 4), out sc);
                        EnrollSchoolYear = (sc - 1911) + rec.EnrollmentSchoolYear.Substring(4, 2);
                    }
                }
            }

            _data["姓名"]     = student.Name;
            _data["性別"]     = student.Gender;
            _data["身分證號"]   = student.IDNumber;
            _data["學號"]     = student.StudentNumber;
            _data["出生日期"]   = Global.CDate(student.Birthday.HasValue ? student.Birthday.Value.ToShortDateString() : "");
            _data["國籍"]     = student.Nationality;
            _data["家長或監護人"] = (parent != null) ? parent.Custodian.Name : "";
            _data["關係"]     = (parent != null) ? parent.Custodian.Relationship : "";
            _data["行動電話"]   = (phone != null) ? phone.Cell : "";
            _data["戶籍電話"]   = (phone != null) ? phone.Permanent : "";
            _data["戶籍地址"]   = (address != null) ? address.Permanent.ToString() : "";
            _data["聯絡電話"]   = (phone != null) ? phone.Contact : "";
            _data["聯絡地址"]   = (address != null) ? address.Mailing.ToString() : "";
            _data["證書字號"]   = GradeInfo.DiplomaNumber;
            _data["入學年月"]   = EnrollSchoolYear;
            _data["照片"]     = base64;

            // 處理服務學習時數
            if (Global._SLRDict.ContainsKey(student.ID))
            {
                foreach (SemesterHistoryItem shi in _semesterHistoryList)
                {
                    string key = shi.SchoolYear + "_" + shi.Semester;
                    if (Global._SLRDict[student.ID].ContainsKey(key))
                    {
                        string val = Global._SLRDict[student.ID][key];

                        if ((shi.GradeYear == 1 || shi.GradeYear == 7) && shi.Semester == 1)
                        {
                            _data["SLR1A"] = val;
                        }

                        if ((shi.GradeYear == 1 || shi.GradeYear == 7) && shi.Semester == 2)
                        {
                            _data["SLR1B"] = val;
                        }

                        if ((shi.GradeYear == 2 || shi.GradeYear == 8) && shi.Semester == 1)
                        {
                            _data["SLR2A"] = val;
                        }

                        if ((shi.GradeYear == 2 || shi.GradeYear == 8) && shi.Semester == 2)
                        {
                            _data["SLR2B"] = val;
                        }

                        if ((shi.GradeYear == 3 || shi.GradeYear == 9) && shi.Semester == 1)
                        {
                            _data["SLR3A"] = val;
                        }

                        if ((shi.GradeYear == 3 || shi.GradeYear == 9) && shi.Semester == 2)
                        {
                            _data["SLR3B"] = val;
                        }
                    }
                }
            }
        }
Esempio n. 3
0
        public void SetStudent(JHStudentRecord student, List <SemesterHistoryItem> semesterHistoryList)
        {
            ClearField();
            // 學期歷程
            _semesterHistoryList = semesterHistoryList;
            JHParentRecord  parent  = JHParent.SelectByStudent(student);
            JHPhoneRecord   phone   = JHPhone.SelectByStudent(student);
            JHAddressRecord address = JHAddress.SelectByStudent(student);
            string          tmpStr  = "      ";

            JHLeaveInfoRecord leave   = JHLeaveIfno.SelectByStudent(student);
            string            number1 = string.Empty;
            string            number2 = string.Empty;

            if (leave != null)
            {
                if (leave.Reason == "畢業")
                {
                    number1 = leave.DiplomaNumber;
                }
                else if (leave.Reason == "修業")
                {
                    number2 = leave.DiplomaNumber;
                }
            }

            string base64 = K12.Data.Photo.SelectGraduatePhoto(student.ID);

            _data["姓名"]      = student.Name;
            _data["性別"]      = student.Gender;
            _data["身分證字號"]   = student.IDNumber;
            _data["學號"]      = student.StudentNumber;
            _data["班級"]      = (student.Class != null ? student.Class.Name : "");
            _data["座號"]      = "" + student.SeatNo;
            _data["出生"]      = DateConvert.ChineseUnitDate(DateConvert.CDate(student.Birthday.HasValue ? student.Birthday.Value.ToShortDateString() : ""));
            _data["出生地"]     = student.BirthPlace;
            _data["家長或監護人"]  = (parent != null) ? parent.Custodian.Name : "";
            _data["關係"]      = (parent != null) ? parent.Custodian.Relationship : "";
            _data["聯絡電話"]    = (phone != null) ? "" + phone.Contact : "";
            _data["戶籍電話"]    = (phone != null) ? "" + phone.Permanent : "";
            _data["戶籍地址"]    = (address != null) ? address.Permanent.ToString() : "";
            _data["通訊處"]     = (address != null) ? address.Mailing.ToString() : "";
            _data["行動電話"]    = (phone != null) ? "" + phone.Cell : "";
            _data["畢業證書字號"]  = number1;
            _data["修業證明書字號"] = number2;
            _data["照片"]      = base64;
            _data["簽呈"]      = "承辦人員:" + Global.TransferName + tmpStr + "註冊組長:" + Global.RegManagerName + tmpStr + "教務主任:" + JHSchoolInfo.EduDirectorName + tmpStr + "校長:" + JHSchoolInfo.ChancellorChineseName;
            // 處理服務學習時數
            if (Global._SLRDict.ContainsKey(student.ID))
            {
                foreach (SemesterHistoryItem shi in _semesterHistoryList)
                {
                    string key = shi.SchoolYear + "_" + shi.Semester;
                    if (Global._SLRDict[student.ID].ContainsKey(key))
                    {
                        string val = Global._SLRDict[student.ID][key];

                        if ((shi.GradeYear == 1 || shi.GradeYear == 7) && shi.Semester == 1)
                        {
                            _data["SLR1A"] = val;
                        }

                        if ((shi.GradeYear == 1 || shi.GradeYear == 7) && shi.Semester == 2)
                        {
                            _data["SLR1B"] = val;
                        }

                        if ((shi.GradeYear == 2 || shi.GradeYear == 8) && shi.Semester == 1)
                        {
                            _data["SLR2A"] = val;
                        }

                        if ((shi.GradeYear == 2 || shi.GradeYear == 8) && shi.Semester == 2)
                        {
                            _data["SLR2B"] = val;
                        }

                        if ((shi.GradeYear == 3 || shi.GradeYear == 9) && shi.Semester == 1)
                        {
                            _data["SLR3A"] = val;
                        }

                        if ((shi.GradeYear == 3 || shi.GradeYear == 9) && shi.Semester == 2)
                        {
                            _data["SLR3B"] = val;
                        }
                    }
                }
            }
            _builder.Document.MailMerge.Execute(GetFieldName(), GetFieldValue());
        }
        public void SetStudent(JHStudentRecord student, List <SemesterHistoryItem> semesterHistoryList)
        {
            ClearField();
            // 學期歷程
            _semesterHistoryList = semesterHistoryList;

            JHParentRecord  parent  = JHParent.SelectByStudent(student);
            JHPhoneRecord   phone   = JHPhone.SelectByStudent(student);
            JHAddressRecord address = JHAddress.SelectByStudent(student);
            string          base64  = K12.Data.Photo.SelectGraduatePhoto(student.ID);

            _data["姓名"]   = student.Name;
            _data["性別"]   = student.Gender;
            _data["身分證號"] = student.IDNumber;
            _data["學號"]   = student.StudentNumber;
            _data["班級"]   = (student.Class != null ? student.Class.Name : "");
            _data["座號"]   = "" + student.SeatNo;

            // 處理服務學習時數
            if (Config._SLRDict.ContainsKey(student.ID))
            {
                foreach (SemesterHistoryItem shi in _semesterHistoryList)
                {
                    string key = shi.SchoolYear + "_" + shi.Semester;
                    if (Config._SLRDict[student.ID].ContainsKey(key))
                    {
                        string val = Config._SLRDict[student.ID][key];

                        int GradeYear = shi.GradeYear;

                        // 處理7,8,9 年級
                        if (GradeYear > 6)
                        {
                            GradeYear -= 6;
                        }

                        if (GradeYear == 1 && shi.Semester == 1)
                        {
                            _data["SLR1A"] = val;
                        }

                        if (GradeYear == 1 && shi.Semester == 2)
                        {
                            _data["SLR1B"] = val;
                        }

                        if (GradeYear == 2 && shi.Semester == 1)
                        {
                            _data["SLR2A"] = val;
                        }

                        if (GradeYear == 2 && shi.Semester == 2)
                        {
                            _data["SLR2B"] = val;
                        }

                        if (GradeYear == 3 && shi.Semester == 1)
                        {
                            _data["SLR3A"] = val;
                        }

                        if (GradeYear == 3 && shi.Semester == 2)
                        {
                            _data["SLR3B"] = val;
                        }
                    }
                }
            }

            //_data["出生日期"] = Common.CDate(student.Birthday.HasValue ? student.Birthday.Value.ToShortDateString() : "");
            //_data["國籍"] = student.Nationality;
            //_data["家長或監護人"] = (parent != null) ? parent.Custodian.Name : "";
            //_data["關係"] = (parent != null) ? parent.Custodian.Relationship : "";
            //_data["行動電話"] = (phone != null) ? phone.Cell : "";
            //_data["戶籍電話"] = (phone != null) ? phone.Permanent : "";
            _data["戶籍地址"] = (address != null) ? address.Permanent.ToString() : "";
            //_data["聯絡電話"] = (phone != null) ? phone.Contact : "";
            //_data["聯絡地址"] = (address != null) ? address.Mailing.ToString() : "";
            //_data["證書字號"] = ""; //先放著…
            _data["照片粘貼處"] = base64;
        }