コード例 #1
0
 protected void OnSave(object sender, DirectEventArgs e)
 {
     try
     {
         ProjectSource obj = new ProjectSource();
         obj.ProjectSourceID   = Convert.ToInt32(txtSourceID.Text);
         obj.Name              = txtSourceName.Text;
         obj.SortIndex         = Convert.ToInt32(txtNumSort.Text);
         obj.Status            = StatusOptions.Valid;
         obj.OnlyInternal      = Convert.ToInt32(onlyinternalselect.SelectedItem.Value) > 0 ? true : false;
         obj.ProjectSourceType = (ProjectSourceTypeOptions)Convert.ToInt32(sourcetypeselect.SelectedItem.Value);
         obj.SoftID            = Convert.ToInt32(txtSoftID.Text.Trim());
         biService.AddPrjectSource(obj);
         e.ExtraParamsResponse.Add(new Ext.Net.Parameter("success", "1", false));
         X.Msg.Alert("消息", "添加成功").Show();
     }
     catch (ToUserException ex)
     {
         e.ExtraParamsResponse.Add(new Ext.Net.Parameter("success", "0", false));
         X.Msg.Alert("消息", ex.Message).Show();
     }
 }