Esempio n. 1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     if (!check()) return;
     User u = new BLLUser.User()
     {
         Name = tbUserName.Text.Trim(),
         Password = tbPsd.Text.Trim(),
         UserType = tbUserType.Text.Trim()
     };
     MessageBox.Show(string.Format("name =={0},\npas == {1},\ntype=={2},\n", u.Name, u.Password, u.UserType));
     int id = wsu.Add(u);
     clear();
     if (id >= 0)
         MessageBox.Show(string.Format("{0}添加成功", u.Name));
     else
         MessageBox.Show("添加失败");
     LoadByPaging();
 }
Esempio n. 2
0
 /// <remarks/>
 public void UpdateAsync(User c, object userState) {
     if ((this.UpdateOperationCompleted == null)) {
         this.UpdateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateOperationCompleted);
     }
     this.InvokeAsync("Update", new object[] {
                 c}, this.UpdateOperationCompleted, userState);
 }
Esempio n. 3
0
 /// <remarks/>
 public void UpdateAsync(User c) {
     this.UpdateAsync(c, null);
 }
Esempio n. 4
0
 public string Update(User c) {
     object[] results = this.Invoke("Update", new object[] {
                 c});
     return ((string)(results[0]));
 }
Esempio n. 5
0
 /// <remarks/>
 public void SearchAsync(User c, int page, int pageSize, object userState) {
     if ((this.SearchOperationCompleted == null)) {
         this.SearchOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSearchOperationCompleted);
     }
     this.InvokeAsync("Search", new object[] {
                 c,
                 page,
                 pageSize}, this.SearchOperationCompleted, userState);
 }
Esempio n. 6
0
 /// <remarks/>
 public void SearchAsync(User c, int page, int pageSize) {
     this.SearchAsync(c, page, pageSize, null);
 }
Esempio n. 7
0
 public User[] Search(User c, ref int page, int pageSize, out int totalPages) {
     object[] results = this.Invoke("Search", new object[] {
                 c,
                 page,
                 pageSize});
     page = ((int)(results[1]));
     totalPages = ((int)(results[2]));
     return ((User[])(results[0]));
 }
Esempio n. 8
0
 /// <remarks/>
 public void AddAsync(User a, object userState) {
     if ((this.AddOperationCompleted == null)) {
         this.AddOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddOperationCompleted);
     }
     this.InvokeAsync("Add", new object[] {
                 a}, this.AddOperationCompleted, userState);
 }
Esempio n. 9
0
 /// <remarks/>
 public void AddAsync(User a) {
     this.AddAsync(a, null);
 }
Esempio n. 10
0
 public int Add(User a) {
     object[] results = this.Invoke("Add", new object[] {
                 a});
     return ((int)(results[0]));
 }