当前位置: 首页>>代码示例>>C#>>正文


C# Subscriber.UpdateAccount方法代码示例

本文整理汇总了C#中Subscriber.UpdateAccount方法的典型用法代码示例。如果您正苦于以下问题:C# Subscriber.UpdateAccount方法的具体用法?C# Subscriber.UpdateAccount怎么用?C# Subscriber.UpdateAccount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Subscriber的用法示例。


在下文中一共展示了Subscriber.UpdateAccount方法的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);
        }
开发者ID:peterlambov,项目名称:CSharp,代码行数:28,代码来源:MainWindow.xaml.cs

示例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;
        }
开发者ID:peterlambov,项目名称:CSharp,代码行数:31,代码来源:DBConnect.cs


注:本文中的Subscriber.UpdateAccount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。