Exemple #1
0
        //public static string GetPhoneBookName(Guid guid)
        //{
        //	Business.PhoneBook phoneBookController = new Business.PhoneBook();
        //	return phoneBookController.GetPhoneBookName(guid);
        //}

        public static Common.PhoneBook Load(Guid phoneBookGuid)
        {
            Business.PhoneBook phoneBookController = new Business.PhoneBook();
            Common.PhoneBook   phoneBook           = new Common.PhoneBook();
            phoneBookController.Load(phoneBookGuid, phoneBook);
            return(phoneBook);
        }
Exemple #2
0
        public static List <TreeNode> GetAllPhoneBookOfUser(Guid userGuid)
        {
            Business.PhoneBook phoneBookController = new Business.PhoneBook();
            try
            {
                List <DataRow> lstGroups = phoneBookController.GetPhoneBookUser(userGuid, Guid.Empty, string.Empty, true).AsEnumerable().ToList();
                List <DataRow> lstRoots  = lstGroups.Where(row => Helper.GetGuid(row["ParentGuid"]) == Guid.Empty).ToList();
                var            nodes     = new List <TreeNode>();

                foreach (DataRow row in lstRoots)
                {
                    var node = new TreeNode();
                    node.id         = string.Format("'{0}'", row["Guid"]);
                    node.state      = "open";
                    node.text       = row["Name"].ToString();
                    node.attributes = new { count = row["CountPhoneNumbers"].ToString(), type = Helper.GetInt(row["Type"], 1) };
                    node.children   = GenerateTree(lstGroups, Helper.GetGuid(row["Guid"]));
                    nodes.Add(node);
                }
                return(nodes);
            }
            catch
            {
                return(new List <TreeNode>());
            }
        }
Exemple #3
0
        public static void GetUserMaximumRecordInfo(Guid userGuid, ref int mobileCount, ref int emailCount)
        {
            Business.PhoneBook phoneBookController = new Business.PhoneBook();
            DataTable          dtInfo = phoneBookController.GetUserMaximumRecordInfo(userGuid);

            if (dtInfo.Rows.Count > 0)
            {
                mobileCount = Helper.GetInt(dtInfo.Rows[0]["MobileCount"]);
                emailCount  = Helper.GetInt(dtInfo.Rows[0]["EmailCount"]);
            }
        }
Exemple #4
0
 public static bool UnSubscribeService(string mobile, string serviceId, ref bool numberExist)
 {
     try
     {
         Business.PhoneBook phoneBookController = new Business.PhoneBook();
         return(phoneBookController.UnSubscribeService(mobile, serviceId, ref numberExist));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #5
0
        public static bool EditItemInPhoneBook(Common.PhoneBook phoneBook)
        {
            Business.PhoneBook phoneBookController = new Business.PhoneBook();
            try
            {
                if (!phoneBookController.UpdateName(phoneBook))
                {
                    throw new Exception(Language.GetString("ErrorRecord"));
                }

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #6
0
        public static Guid InsertItemInPhoneBook(Common.PhoneBook phoneBook)
        {
            Business.PhoneBook phoneBookController = new Business.PhoneBook();
            Business.User      userController      = new Business.User();
            Common.User        user = new Common.User();

            try
            {
                //if (!phoneBookController.CheckingName(phoneBook.Name, phoneBook.UserGuid))
                //	return Guid.Empty;
                userController.Load(phoneBook.UserGuid, user);

                phoneBook.AdminGuid  = user.IsAdmin ? phoneBook.UserGuid : user.ParentGuid;
                phoneBook.CreateDate = DateTime.Now;
                phoneBook.IsPrivate  = false;

                return(phoneBookController.Insert(phoneBook));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #7
0
        //public static bool ChangeParent(Guid phoneBookGuid, Guid parentGuid)
        //{
        //	Business.PhoneBook phoneBookController = new Business.PhoneBook();
        //	if (parentGuid == Guid.Empty)
        //		parentGuid = Helper.GetGuid(phoneBookController.GetRoot().Rows[0]["Guid"]);

        //	return phoneBookController.UpdateParent(phoneBookGuid, parentGuid);
        //}

        public static int GetCountNumberUser(Guid userGuid)
        {
            Business.PhoneBook phoneBookController = new Business.PhoneBook();
            return(phoneBookController.GetCountNumberUser(userGuid));
        }
Exemple #8
0
 public static Guid GetUserVasGroup(int groupId, string serviceId, Guid userGuid)
 {
     Business.PhoneBook phoneBookController = new Business.PhoneBook();
     return(phoneBookController.GetUserVasGroup(groupId, serviceId, userGuid));
 }
Exemple #9
0
 public static DataTable GetPhoneBookOfUser(Guid userGuid)
 {
     Business.PhoneBook phoneBookController = new Business.PhoneBook();
     return(phoneBookController.GetPhoneBookUser(userGuid));
 }
Exemple #10
0
 public static DataTable GetPhoneBookOfUser(Guid userGuid, Guid parentNodeGuid, string name, bool loadAllPhoneBook = false)
 {
     Business.PhoneBook phoneBookController = new Business.PhoneBook();
     return(phoneBookController.GetPhoneBookUser(userGuid, parentNodeGuid, name, loadAllPhoneBook));
 }
Exemple #11
0
 public static bool UpdateGroup(Guid phoneBookGuid, Business.PhoneBookGroupType type, string name)
 {
     Business.PhoneBook phoneBookController = new Business.PhoneBook();
     return(phoneBookController.UpdateGroup(phoneBookGuid, type, name));
 }
Exemple #12
0
 public static bool UpdateVasSetting(Common.PhoneBook phoneBook)
 {
     Business.PhoneBook phoneBookController = new Business.PhoneBook();
     return(phoneBookController.UpdateVasSetting(phoneBook));
 }
Exemple #13
0
 public static DataTable GetPhoneBookInfo(string phoneBookGuids)
 {
     Business.PhoneBook phoneBookController = new Business.PhoneBook();
     return(phoneBookController.GetPhoneBookInfo(phoneBookGuids));
 }
Exemple #14
0
 public static Guid RecipientIsRegisteredToVasGroup(int groupId, string receiver)
 {
     Business.PhoneBook phoneBookController = new Business.PhoneBook();
     return(phoneBookController.RecipientIsRegisteredToVasGroup(groupId, receiver));
 }
Exemple #15
0
 public static bool DeleteItemFromPhoneBook(Guid phoneBookGuid)
 {
     Business.PhoneBook phoneBookController = new Business.PhoneBook();
     return(phoneBookController.Delete(phoneBookGuid));
 }
Exemple #16
0
 public static DataTable GetAllServices()
 {
     Business.PhoneBook phoneBookController = new Business.PhoneBook();
     return(phoneBookController.GetAllServices());
 }
Exemple #17
0
 public static DataTable GetDisabledServices(string mobile)
 {
     Business.PhoneBook phoneBookController = new Business.PhoneBook();
     return(phoneBookController.GetDisabledServices(mobile));
 }