public static bool EditItemInEmailBook(Common.EmailBook emailBook) { Business.EmailBook emailBookController = new Business.EmailBook(); if (!emailBookController.CheckingName(emailBook.Name, emailBook.UserGuid)) return false; else return emailBookController.UpdateName(emailBook); }
public static Guid InsertItemInEmailBook(Common.EmailBook emailBook) { Business.EmailBook emailBookController = new Business.EmailBook(); if (emailBook.ParentGuid == Guid.Empty) emailBook.ParentGuid = Helper.GetGuid(emailBookController.GetRoot().Rows[0]["Guid"]); if (!emailBookController.CheckingName(emailBook.Name, emailBook.UserGuid)) return Guid.Empty; else { Business.User userController = new Business.User(); if (userController.IsAdminUser(emailBook.UserGuid)) emailBook.AdminGuid = emailBook.UserGuid; else emailBook.AdminGuid = userController.GetParentGuid(emailBook.UserGuid); emailBook.CreateDate = DateTime.Now; emailBook.UserGuid = emailBook.UserGuid; return emailBookController.Insert(emailBook); } }