예제 #1
0
 private void btnAddNews_Click(object sender, EventArgs e)
 {
     webService.Notic model = new webService.Notic();
     if (GlobalVal.WebSerices == null)
     {
         GlobalVal.WebSerices = new MyWebService(GlobalVal.ServicesURL + @"/Service.asmx");
     }
     if (string.IsNullOrEmpty(txtID.Text))
     {
         model.Id = -1;
     }
     else
     {
         model.Id = Int32.Parse(txtID.Text);
     }
     model.SystemName = txtSystemName.Text;
     model.Title = txtTitle.Text;
     model.Url = txtUrl.Text;
     model.Body = txtBody.Text;
     bool isSuccese = GlobalVal.WebSerices.AddUpdateNews(model);
     if (isSuccese)
     {
         LoadNews(100);
     }
     else
     {
         MessageBox.Show("保存失败。");
     }
 }
예제 #2
0
 /// <remarks/>
 public void AddUpdateNewsAsync(Notic model) {
     this.AddUpdateNewsAsync(model, null);
 }
예제 #3
0
 /// <remarks/>
 public void AddUpdateNewsAsync(Notic model, object userState) {
     if ((this.AddUpdateNewsOperationCompleted == null)) {
         this.AddUpdateNewsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddUpdateNewsOperationCompleted);
     }
     this.InvokeAsync("AddUpdateNews", new object[] {
                 model}, this.AddUpdateNewsOperationCompleted, userState);
 }
예제 #4
0
 public bool AddUpdateNews(Notic model) {
     object[] results = this.Invoke("AddUpdateNews", new object[] {
                 model});
     return ((bool)(results[0]));
 }