[WebMethod] //密码申诉的方法 public static string Password_appeal(string studentnum, string reason, string password) { Method m = new Method(); Party_InformationDataContext pidc = new Party_InformationDataContext(); string result = "true"; if (studentnum != "" && password != "") { Update_Data ud = new Update_Data(); ud.Update1 = studentnum; ud.Update_Reason = reason; ud.Update3 = m.MD5(password); ud.Update_Status = 0; ud.Update_Type = 3; ud.Update_Time = DateTime.Now; ud.Update_Theme = studentnum + "密码申诉"; pidc.Update_Data.InsertOnSubmit(ud); pidc.SubmitChanges(); result = "true"; } else { result = "false"; } return(result); }
protected void Sure_Update_Click(object sender, EventArgs e) { if (Session["StudentNum"] != null) { Party_InformationDataContext pidc = new Party_InformationDataContext(); if (pidc.Update_Data.FirstOrDefault(p => p.Update1 == Session["StudentNum"].ToString() && p.Update_Type == 1 && p.Update_Status == 0) == null) { Update_Data ud = new Update_Data(); ud.Update_Type = 1; ud.Update_Theme = "修改个人信息"; ud.Update1 = StudentNum.Text; ud.Update2 = placeOfOrigin1.Value; ud.Update3 = telephone1.Value; ud.Update4 = Address1.Value; ud.Update_Time = DateTime.Now; pidc.Update_Data.InsertOnSubmit(ud); pidc.SubmitChanges(); m.MessageBox(this, "修改已提交"); } else { m.MessageBox(this, "已经提交过修改个人信息申请"); } } }
public static string check_studentnum(string studentnum) { string result = "true"; Party_InformationDataContext pidc = new Party_InformationDataContext(); PartyData pd = pidc.PartyData.FirstOrDefault(p => p.StudentNum == studentnum); if (pd != null) { result = "false"; } return(result); }
public static string check_class(string classno) { Party_InformationDataContext pidc = new Party_InformationDataContext(); string result = "true"; if (classno != "") { Class c = pidc.Class.FirstOrDefault(p => p.ClassID == Convert.ToInt32(classno)); if (c == null) { result = "false"; } } return(result); }
protected void Data_Show_ItemCommand(object sender, RepeaterCommandEventArgs e) { if (e.CommandName == "download") { string fileName = ""; string filePath = Server.MapPath(e.CommandArgument.ToString()); for (int i = 0; i < e.CommandArgument.ToString().Split('/').Length; i++) { fileName = e.CommandArgument.ToString().Split('/')[i]; } if (new FileInfo(filePath).Exists) { FileInfo fileInfo = new FileInfo(filePath); Response.Clear(); Response.ClearContent(); Response.ClearHeaders(); Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName); Response.AddHeader("Content-Length", fileInfo.Length.ToString()); Response.AddHeader("Content-Transfer-Encoding", "binary"); Response.ContentType = "application/octet-stream"; Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312"); Response.WriteFile(fileInfo.FullName); int Datum_ID = Convert.ToInt32((e.Item.FindControl("Datum_ID") as HiddenField).Value); Party_InformationDataContext ptdc = new Party_InformationDataContext(); Datum d = ptdc.Datum.FirstOrDefault(p => p.Datum_ID == Datum_ID); if (d != null) { d.Download_Num = d.Download_Num + 1; ptdc.SubmitChanges(); } Response.Flush(); Response.End(); } else { Response.Write("<script>alert('不存在该文件')</script>"); } } }