/// <summary> /// Delete user /// </summary> public static int DeleteUser(Users user) { SqlParameter prmUserID = new SqlParameter("@UserID", SqlDbType.Int, 4); prmUserID.Value = user.UID; return DataAccess.Execute("spDeleteUser", prmUserID); }
public virtual int Update(Users user) { return 0; }
/// <summary> /// Add new user /// </summary> /// <returns></returns> public static int AddNewUser(Users user) { SqlParameter prmUsername = new SqlParameter("@Username", SqlDbType.VarChar, 50); prmUsername.Value = user.Username; SqlParameter prmPassword = new SqlParameter("@Password", SqlDbType.VarChar, 50); prmPassword.Value = user.Password; SqlParameter prmEmail = new SqlParameter("@Email", SqlDbType.VarChar, 50); prmEmail.Value = user.Email; SqlParameter prmFirstName = new SqlParameter("@Firstname", SqlDbType.VarChar, 50); prmFirstName.Value = user.FirstName; SqlParameter prmLastName = new SqlParameter("@Lastname", SqlDbType.VarChar, 50); prmLastName.Value = user.LastName; SqlParameter prmCity = new SqlParameter("@City", SqlDbType.VarChar, 50); prmCity.Value = user.City; SqlParameter prmState = new SqlParameter("@State", SqlDbType.VarChar, 50); prmState.Value = user.State; SqlParameter prmCountry = new SqlParameter("@Country", SqlDbType.VarChar, 50); prmCountry.Value = user.Country; SqlParameter prmDOB = new SqlParameter("@DOB", SqlDbType.DateTime); prmDOB.Value = user.DOB; SqlParameter prmFavoriteFoods1 = new SqlParameter("@FavoriteFoods1", SqlDbType.VarChar, 50); prmFavoriteFoods1.Value = user.FavoriteFoods1; SqlParameter prmFavoriteFoods2 = new SqlParameter("@FavoriteFoods2", SqlDbType.VarChar, 50); prmFavoriteFoods2.Value = user.FavoriteFoods2; SqlParameter prmFavoriteFoods3 = new SqlParameter("@FavoriteFoods3", SqlDbType.VarChar, 50); prmFavoriteFoods3.Value = user.FavoriteFoods3; SqlParameter prmNewsletter = new SqlParameter("@Newsletter", SqlDbType.Int, 4); prmNewsletter.Value = user.NewsLetter; SqlParameter prmContactMe = new SqlParameter("@ContactMe", SqlDbType.Int, 4); prmContactMe.Value = user.ContactMe; SqlParameter prmWebsite = new SqlParameter("@Website", SqlDbType.VarChar, 100); prmWebsite.Value = user.Website; SqlParameter prmAboutMe = new SqlParameter("@AboutMe", SqlDbType.VarChar, 1000); prmAboutMe.Value = user.AboutMe; SqlParameter prmPhoto = new SqlParameter("@Photo", SqlDbType.VarChar, 50); prmPhoto.Value = user.Photo; SqlParameter prmGUID = new SqlParameter("@Guid", SqlDbType.VarChar, 100); prmGUID.Value = user.GUID; return DataAccess.Execute("spInsertUser", prmUsername, prmPassword, prmEmail, prmFirstName, prmLastName, prmCity, prmState, prmCountry, prmDOB, prmFavoriteFoods1, prmFavoriteFoods2, prmFavoriteFoods3, prmNewsletter, prmContactMe, prmWebsite, prmAboutMe, prmPhoto, prmGUID); }
public virtual int Add(Users user) { return 0; }
public virtual int Delete(Users user) { return 0; }
public ExtendedCollection<Users> GetAllUsers() { ExtendedCollection<Users> list = new ExtendedCollection<Users>(); IDataReader dr = GetData; while (dr.Read()) { Users item = new Users(); if (dr["UID"] != DBNull.Value) { item.UID = (int)dr["UID"]; } if (dr["UserName"] != DBNull.Value) { item.Username = (string)dr["UserName"]; } if (dr["Password"] != DBNull.Value) { item.Password = (string)dr["Password"]; } if (dr["Email"] != DBNull.Value) { item.Email = (string)dr["Email"]; } if (dr["FirstName"] != DBNull.Value) { item.FirstName = (string)dr["FirstName"]; } if (dr["LastName"] != DBNull.Value) { item.LastName = (string)dr["LastName"]; } if (dr["City"] != DBNull.Value) { item.City = (string)dr["City"]; } if (dr["State"] != DBNull.Value) { item.State = (string)dr["State"]; } if (dr["Country"] != DBNull.Value) { item.Country = (string)dr["Country"]; } if (dr["UserImage"] != DBNull.Value) { item.Photo = (string)dr["UserImage"]; } if (dr["isActive"] != DBNull.Value) { item.isActive = (int)dr["isActive"]; } if (dr["DateJoined"] != DBNull.Value) { item.DateJoined = (DateTime)dr["DateJoined"]; } if (dr["Activation"] != DBNull.Value) { item.Activation = (int)dr["Activation"]; } if (dr["Hits"] != DBNull.Value) { item.Hits = (int)dr["Hits"]; } if (dr["TotalSavedRecipe"] != DBNull.Value) { item.SavedrecipeCount = (int)dr["TotalSavedRecipe"]; } if (dr["TotalFriends"] != DBNull.Value) { item.FriendsCount = (int)dr["TotalFriends"]; } if (dr["TotalSubmittedRecipe"] != DBNull.Value) { item.PostedRecipeCount = (int)dr["TotalSubmittedRecipe"]; } if (dr["TotalSubmittedArticle"] != DBNull.Value) { item.PostedArticleCount = (int)dr["TotalSubmittedArticle"]; } if (dr["LastVisit"] != DBNull.Value) { item.LastVisit = (DateTime)dr["LastVisit"]; } if (dr["LastUpdated"] != DBNull.Value) { item.LastUpdated = (DateTime)dr["LastUpdated"]; } if (dr["UserLevel"] != DBNull.Value) { item.UserRole = (string)dr["UserLevel"]; } if (dr["ShowFriendsListinProfile"] != DBNull.Value) { item.ShowFriendsListinProfile = (int)dr["ShowFriendsListinProfile"]; } if (dr["ShowCookBookinProfile"] != DBNull.Value) { item.ShowCookBookinProfile = (int)dr["ShowCookBookinProfile"]; } if (dr["NumRecordsCookBookQuickView"] != DBNull.Value) { item.NumRecordsCookBookQuickView = (int)dr["NumRecordsCookBookQuickView"]; } if (dr["NumRecordsFriendsList"] != DBNull.Value) { item.NumRecordsFriendsList = (int)dr["NumRecordsFriendsList"]; } if (dr["PreferredLayout"] != DBNull.Value) { item.PreferredLayout = (int)dr["PreferredLayout"]; } if (dr["PreferredPageSize"] != DBNull.Value) { item.PreferredPageSize = (int)dr["PreferredPageSize"]; } if (dr["IsUserChoosePreferredLayout"] != DBNull.Value) { item.IsUserChoosePreferredLayout = (int)dr["IsUserChoosePreferredLayout"]; } if (dr["ReceivePM"] != DBNull.Value) { item.ReceivePM = (int)dr["ReceivePM"]; } if (dr["PMEmailNotification"] != DBNull.Value) { item.PMEmailNotification = (int)dr["PMEmailNotification"]; } if (dr["TotalCommentRecipe"] != DBNull.Value) { item.CommentRecipeCount = (int)dr["TotalCommentRecipe"]; } if (dr["TotalCommentArticle"] != DBNull.Value) { item.CommentArticleCount = (int)dr["TotalCommentArticle"]; } list.Add(item); } dr.Close(); return list; }
public ExtendedCollection<Users> GetUserSearchResult() { ExtendedCollection<Users> list = new ExtendedCollection<Users>(); IDataReader dr = GetData; while (dr.Read()) { Users item = new Users(); if (dr["UID"] != DBNull.Value) { item.UID = (int)dr["UID"]; } if (dr["UserName"] != DBNull.Value) { item.Username = (string)dr["UserName"]; } if (dr["FirstName"] != DBNull.Value) { item.FirstName = (string)dr["FirstName"]; } if (dr["LastName"] != DBNull.Value) { item.LastName = (string)dr["LastName"]; } if (dr["City"] != DBNull.Value) { item.City = (string)dr["City"]; } if (dr["State"] != DBNull.Value) { item.State = (string)dr["State"]; } if (dr["Country"] != DBNull.Value) { item.Country = (string)dr["Country"]; } if (dr["UserImage"] != DBNull.Value) { item.Photo = (string)dr["UserImage"]; } list.Add(item); } dr.Close(); return list; }
/// <summary> /// Perform Update /// </summary> /// <returns></returns> public override int Update(Users user) { return Blogic.UpdateUser(user); }
/// <summary> /// Perform Delete /// </summary> /// <returns></returns> public override int Delete(Users user) { return Blogic.DeleteUser(user); }
/// <summary> /// Perform Insert to Database /// </summary> /// <returns></returns> public override int Add(Users user) { return Blogic.AddNewUser(user); }