123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using Autofac;
- using EMIS.Entities;
- using EMIS.CommonLogic.CalendarManage;
- using EMIS.Utility;
- using System.Reflection;
- using EMIS.CommonLogic.EducationSchedule;
- using EMIS.DataLogic;
- using EMIS.CommonLogic.Students;
- using EMIS.ViewModel;
- using Bowin.Common;
- using System.Net;
- using System.IO;
- using EMIS.CommonLogic.UniversityManage.AdministrativeOrgan;
- using EMIS.CommonLogic.SystemServices;
- namespace EMIS.TestProject
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- //UnitOfWork uow = new UnitOfWork();
- //uow.BulkInsert(new List<Sys_Role>(), (x => x.Sys_FunctionCode));
- }
- private void button1_Click(object sender, EventArgs e)
- {
- using (var scope = AutofacHelper.Container.BeginLifetimeScope())
- {
- EMIS.CommonLogic.EducationSchedule.IScheduleServices ScheduleServices = scope.Resolve<EMIS.CommonLogic.EducationSchedule.IScheduleServices>();
- ScheduleServices.GenerateSchedule();
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- var result = this.folderBrowserDialog1.ShowDialog();
- if (result == DialogResult.OK)
- {
- using (var scope = AutofacHelper.Container.BeginLifetimeScope())
- {
- var rootPath = this.folderBrowserDialog1.SelectedPath;
- IStudentsServices StudentsServices = scope.Resolve<IStudentsServices>();
- List<Guid> clearPhotoUserID = new List<Guid>();
- var studentList = StudentsServices.GetStudentViewList(new ConfiguretView(), null, null, 2016, null, null, null, null, null, (int)CF_GeneralPurpose.IsYes,null,null,null,null,null,null).ToList();
- studentList.ForEach(x =>
- {
- WebClient conn = new WebClient();
- File.Delete(rootPath + "\\" + x.LoginID + ".jpg");
- string targetFile = x.PhotoUrl.Trim();
- if (!x.PhotoUrl.Trim().StartsWith("http://"))
- {
- targetFile = "http://jw.gdsspt.net";
- if (!x.PhotoUrl.StartsWith("/"))
- {
- targetFile += "/";
- }
- targetFile += x.PhotoUrl.Trim();
- }
- try
- {
- conn.DownloadFile(targetFile, rootPath + "\\" + x.LoginID + ".jpg");
- }
- catch
- {
- clearPhotoUserID.Add(x.UserID);
- }
- });
- StudentsServices.ClearPhotoUrl(clearPhotoUserID);
- MessageBox.Show("导出成功。");
- }
- }
- }
- private void button3_Click(object sender, EventArgs e)
- {
- using (var scop = AutofacHelper.Container.BeginLifetimeScope())
- {
- ISchoolYearServices SchoolYearServices = scop.Resolve<ISchoolYearServices>();
- SchoolYearServices.AutoCreateSchoolyearAndYearsSS();
- }
- }
- private void button4_Click(object sender, EventArgs e)
- {
- using (var scop = AutofacHelper.Container.BeginLifetimeScope())
- {
- IDepartmentServices DepartmentServices = scop.Resolve<IDepartmentServices>();
- IUserServices UserServices = scop.Resolve<IUserServices>();
- DepartmentServices.SynHRServices();
- UserServices.SynHRServices();
- }
- }
- }
- }
|