您目前尚未登陆,请选择【登陆】或【注册
首页->全站代码->特瑞飞家教信息平台源码>>DataBusiness/StudentMembership.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:特瑞飞家教信息平台源码
当前文件:文件类型 HomeTeachingNet/DataBusiness/StudentMembership.cs打开代码结构图
普通视图
		            
1using System; 2using System.Collections.Generic; 3using System.Text; 4using System.Web.Security; 5using System.Data; 6using System.Data.SqlClient; 7///Asp.net源码下载专业站 8namespace DataBusiness 9{ 10 public partial class Student 11 { 12 public bool DeleteStudentInBothSide(object UserGuid) 13 { 14 bool rt = true; 15 //1) 先从Membership中删除 16 MembershipUser sysUser = Membership.GetUser(UserGuid); 17 if (sysUser != null) 18 { 19 rt = Membership.DeleteUser(sysUser.UserName); 20 if (!rt) 21 { 22 return false; 23 } 24 } 25 26 // 2) 从扩展数据表中删除 27 rt = this.DeleteStudentByGuid(UserGuid.ToString()); 28 29 return rt; 30 } 31 32 public int GetStudentIDByGuid(string user_guid) 33 { 34 SqlParameter[] para = { 35 new SqlParameter("@user_guid", user_guid), 36 }; 37 38 DataSet ds = DataExecute.ExecuteDataset(DataExecute.CONN_STRING, CommandType.StoredProcedure, 39 "GetStudentIDByGuid", para); 40 41 if (ds == null) 42 { 43 return 0; 44 } 45 if (ds.Tables[0].Rows.Count == 0) 46 { 47 return 0; 48 } 49 int nID = int.Parse(ds.Tables[0].Rows[0][0].ToString()); 50 51 return nID; 52 } 53 54 private bool DeleteStudentByGuid(string szUserGuid) 55 { 56 SqlParameter[] para = { 57 new SqlParameter("@UserGuid", szUserGuid) 58 }; 59 int nAffect = DataExecute.ExecuteNonQuery(DataExecute.CONN_STRING, 60 CommandType.StoredProcedure, 61 "DeleteStudentByUserGuid", 62 para); 63 return (nAffect == 1); 64 } 65 } 66} 67
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:特瑞飞家教信息平台源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号