Ejemplo n.º 1
0
 private void EditSoft(bool adding, DirectEventArgs e)
 {
     try
     {
         Soft   soft  = new Soft();
         string plats = e.ExtraParams[0].Value.TrimEnd('-');
         soft.Platforms    = plats.Split('-').Select(p => (MobileOption)Convert.ToInt32(p)).ToList();
         soft.Name         = SoftName.Text;
         soft.SoftType     = (SoftTypeOptions)Convert.ToInt32(softType.SelectedItem.Value);
         soft.OutID        = Convert.ToInt32(SoftOutID.Text);
         soft.ID           = Convert.ToInt32(SoftPID.Text == "" ? "0" : SoftPID.Text);
         soft.SortIndex    = Convert.ToInt32(SortNumID.Text);
         soft.Status       = StatusOptions.Valid;
         soft.OnlyInternal = Convert.ToInt32(onlyinternalselect.SelectedItem.Value) > 0 ? true : false;
         soft.SoftAreaType = Convert.ToInt32(softareatype.SelectedItem.Value);
         if (adding)
         {
             biService.AddSoft(soft);
         }
         else
         {
             biService.UpdateSoft(soft);
         }
         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();
     }
 }