private void InitWithDefaults() { this.UserName = string.Empty; this.NoSpam = false;; this.MobileNumbers_AllConfirmed__ = new MobileNoHandler(""); this.MobileNumbers_AllUnConfirmed__ = new MobileNoHandler(""); this.Email = string.Empty; this.Password = string.Empty; this.CreationDate = DateTime.MinValue.Ticks; this.CreationIp = string.Empty; this.ApiGuId = string.Empty; //this.NoOfQueuedMessages = 0; //this.NoOfSentMessages = 0; //this.NoOfBytesSent = 0; //this.LastMsgQueued = 0; //this.MinDelayInSeconds = 60; this.AccountStatus = eUserStatus.email_sent_for_verification; //this.RemainingMessages = 200; this.Comment = string.Empty; //this.SendFooter = true; //this.WelcomeCounter = 0; this.DeleteOnFailed = false; this.AddNumber_AllowedWithAPI = false; this.AddNumber_ActivateOnSyncRequest = false; this.FreeAccount = new freeAccount(); this.MonthlyAccount = new monthlyAccount(); this.PayAsSentAccount = new payAsSentAccount(); this.MonthlyDifPriceAccount = new monthlyDifPriceAccount(); this.SystemDuplicationAccount = new systemDuplicationAccount(); }
public void SortAndReturn(out MobileNoHandler confirmed, out MobileNoHandler unconfirmed, out string status) { confirmed = new MobileNoHandler(""); unconfirmed = new MobileNoHandler(""); status = ""; int confirmedCounter = 0; int unconfirmedCounter = 0; string[] keysToSort = new string[m_Dic.Keys.Count]; m_Dic.Keys.CopyTo(keysToSort, 0); List <string> keysList = new List <string>(keysToSort); keysList.Sort(); foreach (string k1 in keysList) { var kv = m_Dic[k1]; if (kv.IsConfirmed) { confirmed.Add(kv.Number); confirmedCounter++; } else { unconfirmed.Add(kv.Number); unconfirmedCounter++; } } status = string.Format("{0} confirmed and {1} unconfirmed numbers.", confirmedCounter, unconfirmedCounter); }
private void ReadFromStream_V0(BinaryReader br) { UserName = br.ReadString(); NoSpam = br.ReadBoolean(); int mobCount = br.ReadInt32(); MobileNumbers_AllConfirmed__ = new MobileNoHandler(""); MobileNumbers_AllUnConfirmed__ = new MobileNoHandler(""); for (int i = 0; i < mobCount; i++) { MobileNumbers_AllConfirmed__.Add(br.ReadString()); } Email = br.ReadString(); Password = br.ReadString(); CreationDate = br.ReadInt64(); CreationIp = br.ReadString(); ApiGuId = br.ReadString(); FreeAccount.free_MsgQueued = br.ReadInt64(); FreeAccount.free_MsgSent /* NoOfSentMessages */ = br.ReadInt64(); /* NoOfBytesSent = */ br.ReadInt64(); FreeAccount.free_MsgLeft /* RemainingMessages */ = br.ReadInt64(); FreeAccount.free_LastMsgQueued = br.ReadInt64(); FreeAccount.free_MinDelayInSeconds = br.ReadInt32(); switch ((eUserStatus_V0)br.ReadInt32()) { case eUserStatus_V0.email_sent_for_verification: AccountStatus = eUserStatus.email_sent_for_verification; break; case eUserStatus_V0.verified: AccountStatus = eUserStatus.verified_welcome_No_sent; break; case eUserStatus_V0.blocked: AccountStatus = eUserStatus.blocked; break; case eUserStatus_V0.active: AccountStatus = eUserStatus.free_account; break; } }
private void ReadFromStream_V1(BinaryReader br) { UserName = br.ReadString(); NoSpam = br.ReadBoolean(); int mobCount = br.ReadInt32(); MobileNumbers_AllConfirmed__ = new MobileNoHandler(""); MobileNumbers_AllUnConfirmed__ = new MobileNoHandler(""); for (int i = 0; i < mobCount; i++) { MobileNumbers_AllConfirmed__.Add(br.ReadString()); } Email = br.ReadString(); Password = br.ReadString(); CreationDate = br.ReadInt64(); CreationIp = br.ReadString(); ApiGuId = br.ReadString(); FreeAccount.free_MsgQueued = br.ReadInt64(); FreeAccount.free_MsgSent /* NoOfSentMessages */ = br.ReadInt64(); /* NoOfBytesSent = */ br.ReadInt64(); FreeAccount.free_MsgLeft /* RemainingMessages */ = br.ReadInt64(); FreeAccount.free_LastMsgQueued = br.ReadInt64(); FreeAccount.free_MinDelayInSeconds = br.ReadInt32(); AccountStatus = (eUserStatus)br.ReadInt32(); }
private void ReadFromStream_V5(BinaryReader br) { UserName = br.ReadString(); NoSpam = br.ReadBoolean(); MobileNumbers_AllConfirmed__ = new MobileNoHandler(br.ReadString()); MobileNumbers_AllUnConfirmed__ = new MobileNoHandler(br.ReadString()); Email = br.ReadString(); Password = br.ReadString(); CreationDate = br.ReadInt64(); CreationIp = br.ReadString(); ApiGuId = br.ReadString(); FreeAccount.free_MsgQueued = br.ReadInt64(); FreeAccount.free_MsgSent /* NoOfSentMessages */ = br.ReadInt64(); /* NoOfBytesSent = */ br.ReadInt64(); FreeAccount.free_MsgLeft /* RemainingMessages */ = br.ReadInt64(); FreeAccount.free_LastMsgQueued = br.ReadInt64(); FreeAccount.free_MinDelayInSeconds = br.ReadInt32(); AccountStatus = (eUserStatus)br.ReadInt32(); Comment = br.ReadString(); FreeAccount.free_SendFooter = br.ReadBoolean(); FreeAccount.free_WelcomeCounter = br.ReadInt16(); DeleteOnFailed = br.ReadBoolean(); AddNumber_AllowedWithAPI = br.ReadBoolean(); AddNumber_ActivateOnSyncRequest = br.ReadBoolean(); }
public void Remove(string tels) { MobileNoHandler h = new MobileNoHandler(tels); string nextNo = ""; while ((nextNo = h.RemoveAndReturnFirst()).Length > 0) { if (m_Dic.ContainsKey(nextNo)) { m_Dic.Remove(nextNo); } } }
private void ReadFromStream_V6(BinaryReader br) { UserName = br.ReadString(); NoSpam = br.ReadBoolean(); MobileNumbers_AllConfirmed__ = new MobileNoHandler(br.ReadString()); MobileNumbers_AllUnConfirmed__ = new MobileNoHandler(br.ReadString()); Email = br.ReadString(); Password = br.ReadString(); CreationDate = br.ReadInt64(); CreationIp = br.ReadString(); ApiGuId = br.ReadString(); AccountStatus = (eUserStatus)br.ReadInt32(); Comment = br.ReadString(); DeleteOnFailed = br.ReadBoolean(); AddNumber_AllowedWithAPI = br.ReadBoolean(); AddNumber_ActivateOnSyncRequest = br.ReadBoolean(); FreeAccount.ReadFromStream(br); MonthlyAccount.ReadFromStream(br); PayAsSentAccount.ReadFromStream(br); }
public void Add(string tels, bool isConfirmed) { MobileNoHandler h = new MobileNoHandler(tels); string nextNo = ""; while ((nextNo = h.RemoveAndReturnFirst()).Length > 0) { string err = Data_AppUserFile.Check_MobileNumber(nextNo, 0); if (err == null) { if (!m_Dic.ContainsKey(nextNo)) { m_Dic.Add(nextNo, new MobileNoWithState(nextNo, isConfirmed)); } else { // already there m_Dic[nextNo].IsConfirmed = isConfirmed; } } } }
public MobileNoHandlerWithUserName(string user) { UserName = user; Handler = new MobileNoHandler(""); }