public FormAccount(Account accout) { InitializeComponent(); if(accout.Name == "") this.Text = "����ʺ�"; else textBox1.ReadOnly = true; this.SetFormStyle(false, false, false, false); this.temp = accout; textBox1.Text = temp.Name; textBox2.Text = temp.Pw; comboBox1.SelectedIndex = temp.Type; textBox3.Text = temp.Tel; textBox4.Text = temp.Email; foreach(Team team in FormMain.user.TeamList) { checkedListBox1.Items.Add(team.TeamName); foreach(int tid in accout.Teams) if(team.TeamID == tid) { checkedListBox1.SetItemChecked(checkedListBox1.Items.Count - 1, true); } } checkBox0.Checked = temp.PolicyModTeam == 1; checkBox1.Checked = temp.PolicyModCar == 1; checkBox2.Checked = temp.PolicyOrder == 1; checkBox3.Checked = temp.PolicyExportCars == 1; checkBox4.Checked = temp.PolicyDeclare == 1; checkBox5.Checked = temp.PolicyAlarmList == 1; checkBox6.Checked = temp.PolicyOverTime == 1; }
public FormUserInfo(Account account) { InitializeComponent(); this.SetFormStyle(false, false, false, false); temp = account; textBox1.Text = temp.Name; textBox2.Text = temp.Pw; textBox3.Text = temp.Tel; textBox4.Text = temp.Email; }
//�� private void ToolStripMenuItem2_Click(object sender, EventArgs e) { Account accout = contextMenuStrip1.Tag as Account; if(accout.Id == FormMain.user.Id) { MessageBox.Show(this, "�뵽�û���Ϣ����������!"); return; } Account accout1 = new Account(accout); FormAccount frm = new FormAccount(accout1); if(frm.ShowDialog(this) == DialogResult.OK) FormMain.C_Info_ModifyAccount(accout1); }
//��� private void ToolStripMenuItem1_Click(object sender, EventArgs e) { Account accout = new Account(); FormAccount frm = new FormAccount(accout); if(frm.ShowDialog(this) == DialogResult.OK) FormMain.C_Info_AddAccount(accout); }
//���ʺ� public static void C_Info_ModifyAccount(Account account) { StringBuilder stb = new StringBuilder(Constant.HEAD).Append(Constant.C_INFO); stb.Append(Constant.C_INFO_ACCOUNT_MOD).Append(account.ToString()).Append(Constant.FOOT); dataSocket.Send(stb.ToString()); }
public Account(Account at) { Clone(at); }
public void Clone(Account at) { id = at.id; name = at.name; pw = at.pw; type = at.type; tel = at.tel; email = at.email; joinTime = at.joinTime; foreach(int i in at.teams) teams.Add(i); policyModTeam = at.policyModTeam; policyModCar = at.policyModCar; policyOrder = at.policyOrder; policyExportCars = at.policyExportCars; policyDeclare = at.policyDeclare; policyAlarmList = at.policyAlarmList; policyOverTime = at.policyOverTime; policyNotify = at.policyNotify; }
public static Account Parse(String s) { Account accout = new Account(); String[] ss = s.Split(Constant.SPLIT2); accout.id = Int32.Parse(ss[0]); accout.name = ss[1]; accout.pw = ss[2]; accout.type = Int32.Parse(ss[3]); accout.tel = ss[4]; accout.email = ss[5]; accout.joinTime = ss[6]; if(ss[7].Length > 0) { String[] sss = ss[7].Split(Constant.SPLIT_EX_1); foreach(String temp in sss) try { accout.teams.Add(Int32.Parse(temp)); } catch { } } accout.policyModTeam = Int32.Parse(ss[8]); accout.policyModCar = Int32.Parse(ss[9]); accout.policyOrder = Int32.Parse(ss[10]); accout.policyExportCars = Int32.Parse(ss[11]); accout.policyDeclare = Int32.Parse(ss[12]); accout.policyAlarmList = Int32.Parse(ss[13]); accout.policyOverTime = Int32.Parse(ss[14]); accout.policyNotify = Int32.Parse(ss[15]); return accout; }