private AccountModel GetAccount()
 {
     account = this.accountBasicInfo1.Account;
     account.CDChannelList = this.cdCannelList.GetChannelList();
     account.TYChannelList = this.tyCannelList.GetChannelList();
     account.UserID = UserModel.Current.UserID;
     return account;
 }
Example #2
0
 public void Connect(AccountModel para)
 {
     {
         var temp = new SocketPara();
         temp.ID = para.AccountName;
         //temp.IP = para.IP;
         temp.IP = "127.0.0.1";
         temp.Port = 8888;
         SocketClient.ConnectServer(temp);
     }
 }
Example #3
0
 public void AddAccount(AccountModel p)
 {
     AccountTag accountTag = new AccountTag(this, p);
     ItemList.Add(accountTag);
     accountTag.Dock = System.Windows.Forms.DockStyle.Fill;
     accountTag.Name = "accountTag" + (++i);
     accountTag.Padding = new System.Windows.Forms.Padding(2);
     accountTag.Size = new System.Drawing.Size(207, 27);
     accountTag.TabIndex = 1;
     this.tlp_CountList.RowCount = ItemList.Count + 1;
     this.tlp_CountList.RowStyles.Insert(0, new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 80F));
     this.tlp_CountList.Controls.Add(accountTag, 0, ItemList.Count - 1);
     Current = accountTag;
 }
        private void btn_Save_Click(object sender, EventArgs e)
        {
            this.account = GetAccount();
            SaveAccount(account);
            if (this.IsNew)
            {
                this.accountList.AddAccount(account);
            }
            else
            {
                this.accountList.Update(account);
            }

            this.Close();
        }
        public AccountSetting(AccountList accList, AccountModel acc, bool isNew)
        {
            InitializeComponent();
            this.account = acc;
            this.IsNew = isNew;
            this.accountList = accList;
            source = Buz.GetDestinationByAccount(acc.AccountName);
            tyCannelList = new ChannelList(acc.TYChannelList, false);
            tyCannelList.Dock = DockStyle.Fill;
            this.tabPage1.Controls.Add(tyCannelList);

            cdCannelList = new ChannelList(acc.CDChannelList, true);
            cdCannelList.Dock = DockStyle.Fill;
            this.tabPage2.Controls.Add(cdCannelList);

            this.accountBasicInfo1.SetChannelSource(source);
            this.tyCannelList.SetChannelSource(source);
            this.cdCannelList.SetChannelSource(source);
            this.accountBasicInfo1.Account = this.account;
        }
Example #6
0
 internal void Update(AccountModel account)
 {
     this.Current.Account = account;
 }
Example #7
0
 private void tsb_addAccount_Click(object sender, EventArgs e)
 {
     AccountModel acc = new AccountModel();
     new AccountSetting(this, acc, true).ShowDialog();
 }
 private void SaveAccount(AccountModel res)
 {
     AccountBuz buz = new AccountBuz();
     buz.Save(res);
 }
Example #9
0
 public void Save(AccountModel para)
 {
     new AccountFile<AccountModel>(UserModel.Current.UserID).Save(para, para.Alias);
 }