public static void SetInstance(User_Class anInstance) { if (anInstance != null) { instance = anInstance; } }
public static DataTable GetUserType() { DataTable dt = new DataTable(); dt.Columns.Add("Name", typeof(string)); dt.Columns.Add("ID", typeof(string)); dt.Columns.Add("Popedoms", typeof(string)); dt.Columns.Add("Img", typeof(string)); User_Class uc = User_Class.GetUserClass(); try { foreach (User_Class.Rewrite _ManagerClass in uc.ManagerClass) { DataRow dr = dt.NewRow(); dr["Name"] = _ManagerClass.Name; dr["ID"] = _ManagerClass.Classid; dr["Popedoms"] = _ManagerClass.Popedoms; dr["Img"] = _ManagerClass.Img; dt.Rows.Add(dr); } dt.AcceptChanges(); } finally { uc = null; } return(dt); }
public static User_Class GetUserClass() { //if (instance == null) { // lock (lockHelper) { // if (instance == null) { instance = new User_Class(); } } } return(instance); }