本文整理汇总了C#中Subscriber.ChangeTariffPlan方法的典型用法代码示例。如果您正苦于以下问题:C# Subscriber.ChangeTariffPlan方法的具体用法?C# Subscriber.ChangeTariffPlan怎么用?C# Subscriber.ChangeTariffPlan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subscriber
的用法示例。
在下文中一共展示了Subscriber.ChangeTariffPlan方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnAddSubcriber_Click
private void OnAddSubcriber_Click(object sender, RoutedEventArgs e)
{
string currentMSISDN = this.SubscriberMSISDN.Text;
string currentName = this.SubscriberName.Text;
string currentEGN = this.SubscriberEGN.Text;
string currentTariffPlan = defaultTariffPlan;
double account = 0;
Subscriber currentSubscriber = new Subscriber(currentMSISDN, currentName, currentEGN);
//work with Hashset
Subscriber.AddSubscriber(currentSubscriber);
if (this.SubscriberTariffPlan.SelectedItem != null)
{
currentTariffPlan = this.SubscriberTariffPlan.SelectedItem.ToString();
currentSubscriber.ChangeTariffPlan(currentTariffPlan);
}
if (this.SubscriberAccount.Text != null)
{
account = double.Parse(this.SubscriberAccount.Text.ToString());
currentSubscriber.UpdateAccount(account);
}
billingSystemDB.InsertSubscriber(currentSubscriber);
SubscriberAllTextBoxInit(sender, e);
}
示例2: SelectSubscriber
//Select statement
public Subscriber SelectSubscriber(string msisdnOrEgn, bool byEGN = false)
{
string query = string.Empty;
if (byEGN) query = string.Format("SELECT subscriber_msisdn, subscriber_name, subscriber_egn, subscriber_tariffplan, subscriber_account FROM subscriber WHERE subscriber_egn='{0}'", msisdnOrEgn);
else query = string.Format("SELECT subscriber_msisdn, subscriber_name, subscriber_egn, subscriber_tariffplan, subscriber_account FROM subscriber WHERE subscriber_msisdn='{0}'", msisdnOrEgn);
Subscriber subscriber = new Subscriber();
if (this.OpenConnection() == true)
{
MySqlCommand cmd = new MySqlCommand(query, connection);
MySqlDataReader dataReader = cmd.ExecuteReader();
while (dataReader.Read())
{
string msisdn = dataReader["subscriber_msisdn"] as string;
string name = dataReader["subscriber_name"] as string;
string egn = dataReader["subscriber_egn"] as string;
subscriber = new Subscriber(msisdn, name, egn);
subscriber.ChangeTariffPlan(dataReader["subscriber_tariffplan"] as string);
subscriber.UpdateAccount((double)dataReader["subscriber_account"]);
}
dataReader.Close();
this.CloseConnection();
}
return subscriber;
}