Song.Site/Manage/Student/Info.aspx.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WeiSha.Common;
using Song.ServiceInterfaces;

namespace Song.Site.Manage.Student
{
    public partial class Info : Extend.CustomPage
    {
        private int id = WeiSha.Common.Request.QueryString["id"].Int32 ?? 0;
        private string _uppath = "Student";
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Form.DefaultButton = this.btnEnter.UniqueID;
            if (!IsPostBack)
            {
                fill();
            }
        }

        private void fill()
        {
            Song.Entities.Student th = id == 0 ? Extend.LoginState.Student.CurrentUser : Business.Do<IStudent>().StudentSingle(id);
            if (th == null) return;
            this.EntityBind(th);           
            //出生年月
            St_Birthday.Text = th.St_Birthday < DateTime.Now.AddYears(-100) ? "" : th.St_Birthday.ToString("yyyy-MM-dd");
            //个人照片
            if (!string.IsNullOrEmpty(th.St_Photo) && th.St_Photo.Trim() != "")
            {               
                this.imgShow.Src = Upload.Get[_uppath].Virtual + th.St_Photo;
            }
        }
        protected void btnEnter_Click(object sender, EventArgs e)
        {
            Song.Entities.Student th = Extend.LoginState.Student.CurrentUser;
            th = this.EntityFill(th) as Song.Entities.Student;
            if (th.St_Birthday > DateTime.Now.AddYears(-100))
            {
                th.St_Age = Convert.ToInt32((DateTime.Now - th.St_Birthday).TotalDays / 365);
                //th.St_Age = DateTime.Now.Year - th.St_Birthday.Year;
            }
            //图片
            if (fuLoad.PostedFile.FileName != "")
            {
                fuLoad.UpPath = _uppath;
                fuLoad.IsMakeSmall = false;
                fuLoad.IsConvertJpg = true;
                fuLoad.SaveAndDeleteOld(th.St_Photo);
                fuLoad.File.Server.ChangeSize(150, 200, false);
                th.St_Photo = fuLoad.File.Server.FileName;
                //
                imgShow.Src = fuLoad.File.Server.VirtualPath;
            }
            try
            {
后面还有 12 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。