Example #1
0
        public static bool BulkIsActive(Guid numberGuid)
        {
            Business.PrivateNumber privateNumberController = new Business.PrivateNumber();
            DataTable dtAgentInfo = privateNumberController.GetAgentInfo(numberGuid);

            return(dtAgentInfo.Rows.Count > 0 ? Helper.GetBool(dtAgentInfo.Rows[0]["IsSendBulkActive"]) : false);
        }
Example #2
0
        public static Common.PrivateNumber LoadNumber(Guid numberGuid)
        {
            Business.PrivateNumber privateNumberController = new Business.PrivateNumber();
            Common.PrivateNumber   privateNumber           = new Common.PrivateNumber();

            privateNumberController.Load(numberGuid, privateNumber);
            return(privateNumber);
        }
Example #3
0
        public static bool UpdateNumber(Common.PrivateNumber privatenumber)
        {
            Business.PrivateNumber privateNumberController = new Business.PrivateNumber();

            try
            {
                return(privateNumberController.UpdateNumber(privatenumber));
            }
            catch
            {
                throw;
            }
        }
Example #4
0
        public static bool IsValidRange(List <string> lstSampleNumbers, string regex, Guid numberGuid, Guid userGuid)
        {
            Business.PrivateNumber privateNumberController = new Business.PrivateNumber();
            try
            {
                List <DataRow> lstRanges = privateNumberController.GetAllRanges(userGuid).AsEnumerable().ToList();
                bool           isValid   = true;
                foreach (DataRow row in lstRanges.Where(row => Helper.GetInt(row["UseForm"]) == (int)PrivateNumberUseForm.RangeNumber))
                {
                    foreach (string sample in lstSampleNumbers)
                    {
                        if (Regex.IsMatch(sample, row["Regex"].ToString()))
                        {
                            isValid = false;
                            break;
                        }
                    }
                    if (!isValid)
                    {
                        break;
                    }
                }

                if (isValid)
                {
                    foreach (DataRow row in lstRanges.Where(row => Helper.GetInt(row["UseForm"]) != (int)PrivateNumberUseForm.RangeNumber))
                    {
                        if (Regex.IsMatch(row["Number"].ToString(), regex) && Helper.GetGuid(row["Guid"]) != numberGuid)
                        {
                            isValid = false;
                            break;
                        }
                    }
                }

                return(isValid);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #5
0
        public static bool AssignNumberToUser(Guid numberGuid, Guid userGuid, string keyword, decimal price, DateTime expireDate)
        {
            Business.PrivateNumber privateNumberController = new Business.PrivateNumber();
            try
            {
                if (!Helper.CheckDataConditions(keyword).IsEmpty)
                {
                    if (privateNumberController.IsDuplicateKeyword(numberGuid, keyword))
                    {
                        throw new Exception(Language.GetString("PrivateNumberWithKeyWordIsDuplicate"));
                    }
                }

                return(privateNumberController.AssignNumberToUser(numberGuid, userGuid, keyword, price, expireDate));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #6
0
        public static bool IsValidSubRange(string sampleNumber, Guid numberGuid, string regex, string keyword)
        {
            Business.PrivateNumber privateNumberController = new Business.PrivateNumber();
            try
            {
                List <DataRow> lstRanges = privateNumberController.GetSubRanges(numberGuid).AsEnumerable().ToList();
                bool           isValid   = true;
                foreach (DataRow row in lstRanges.Where(row => string.IsNullOrEmpty(row["Number"].ToString())))
                {
                    if (Regex.IsMatch(sampleNumber, row["Regex"].ToString()))
                    {
                        isValid = false;
                        break;
                    }
                }

                if (isValid)
                {
                    foreach (DataRow row in lstRanges.Where(row => !string.IsNullOrEmpty(row["Number"].ToString())))
                    {
                        if (Regex.IsMatch(row["Number"].ToString(), regex) && row["Keyword"].ToString() == keyword)
                        {
                            isValid = false;
                            break;
                        }
                    }
                }

                if (isValid)
                {
                }

                return(isValid);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #7
0
 public static bool UpdateExpireDate(Guid privateNumberGuid, DateTime expireDate)
 {
     Business.PrivateNumber privateNumberController = new Business.PrivateNumber();
     return(privateNumberController.UpdateExpireDate(privateNumberGuid, expireDate));
 }
Example #8
0
 public static bool Insert(Common.PrivateNumber privateNumber)
 {
     Business.PrivateNumber privateNumberController = new Business.PrivateNumber();
     return(privateNumberController.InsertNumber(privateNumber) != Guid.Empty ? true : false);
 }
Example #9
0
 public static string GetServiceId(TypeServiceId typeServiceId, string serviceId)
 {
     Business.PrivateNumber privateNumberController = new Business.PrivateNumber();
     return(privateNumberController.GetServiceId(typeServiceId, serviceId));
 }
Example #10
0
 public static DataTable GetUserPrivateNumbersForSend(Guid userGuid)
 {
     Business.PrivateNumber privateNumberController = new Business.PrivateNumber();
     return(privateNumberController.GetUserPrivateNumbersForSend(userGuid));
 }
Example #11
0
 public static DataTable GetUserNumbers(Guid userGuid, string query, int pageNo, int pageSize, string sortField, ref int resultCount)
 {
     Business.PrivateNumber privateNumberController = new Business.PrivateNumber();
     return(privateNumberController.GetUserNumbers(userGuid, query, pageNo, pageSize, sortField, ref resultCount));
 }
Example #12
0
 public static bool AssignSubRangeNumberToUser(Common.PrivateNumber privateNumber, string keyword)
 {
     Business.PrivateNumber privateNumberController = new Business.PrivateNumber();
     return(privateNumberController.AssignSubRangeNumberToUser(privateNumber, keyword));
 }
Example #13
0
 public static DataTable GetPagedAllAssignedLine(string query, string sortField, int pageNo, int pageSize, ref int resultCount)
 {
     Business.PrivateNumber privateNumberController = new Business.PrivateNumber();
     return(privateNumberController.GetPagedAllAssignedLine(query, sortField, pageNo, pageSize, ref resultCount));
 }
Example #14
0
 public static bool SetPublicNumber(Guid numberGuid)
 {
     Business.PrivateNumber privateNumberController = new Business.PrivateNumber();
     return(privateNumberController.SetPublicNumber(numberGuid));
 }
Example #15
0
 public static object GetUserPrivateNumbersForSendBulk(Guid userGuid)
 {
     Business.PrivateNumber privateNumberController = new Business.PrivateNumber();
     return(privateNumberController.GetUserPrivateNumbersForSendBulk(userGuid));
 }
Example #16
0
 public static bool UpdateTrafficRelay(Common.PrivateNumber privateNumber)
 {
     Business.PrivateNumber privateNumberController = new Business.PrivateNumber();
     return(privateNumberController.UpdateTrafficRelay(privateNumber));
 }
Example #17
0
 public static bool DeleteNumber(Guid guid)
 {
     Business.PrivateNumber privateNumberController = new Business.PrivateNumber();
     return(privateNumberController.DeleteNumber(guid));
 }
Example #18
0
 public static Guid GetUserNumberGuid(string number, Guid userGuid)
 {
     Business.PrivateNumber privateNumberController = new Business.PrivateNumber();
     return(privateNumberController.GetUserNumberGuid(number, userGuid));
 }
Example #19
0
 public static DataTable GetVASNumber(string serviceId)
 {
     Business.PrivateNumber privateNumberController = new Business.PrivateNumber();
     return(privateNumberController.GetVASNumber(serviceId));
 }
Example #20
0
 public static bool AssignRangeNumberToUser(Guid numberGuid, Guid userGuid, decimal price, DateTime expireDate)
 {
     Business.PrivateNumber privateNumberController = new Business.PrivateNumber();
     return(privateNumberController.AssignRangeNumberToUser(numberGuid, userGuid, price, expireDate));
 }