Example #1
0
        void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            EditDefaultMessage edit = new EditDefaultMessage(null);

            edit.SaveCompleted += (obj, ev) =>
            {//保存成功,重新绑定
                this.btnInit.Visibility = Visibility.Collapsed;
                SearchDefaultList();
            };
            edit.appSystem = appSystem;
            edit.appModel  = appModel;
            edit.cobSYSTEMCODE.ItemsSource   = this.cbSystemCode.ItemsSource;
            edit.cobSYSTEMCODE.SelectedIndex = 0;
            edit.cobMODELCODE.ItemsSource    = this.cbModelCode.ItemsSource;
            edit.cobMODELCODE.SelectedIndex  = 0;
            edit.Show();
        }
Example #2
0
 void btnEdit_Click(object sender, RoutedEventArgs e)
 {
     PlatformService.T_WF_DEFAULTMESSAGE entity = dgDefaultMessage.SelectedItem as PlatformService.T_WF_DEFAULTMESSAGE;
     if (entity != null)
     {
         EditDefaultMessage edit = new EditDefaultMessage(entity);
         edit.SaveCompleted += (obj, ev) =>
         {//保存成功,重新绑定
             SearchDefaultList();
         };
         edit.appSystem = appSystem;
         edit.appModel  = appModel;
         edit.cobMODELCODE.ItemsSource    = this.cbModelCode.ItemsSource;
         edit.cobMODELCODE.SelectedIndex  = 0;
         edit.cobSYSTEMCODE.ItemsSource   = this.cbSystemCode.ItemsSource;
         edit.cobSYSTEMCODE.SelectedIndex = 0;
         for (int i = 0; i < edit.cobSYSTEMCODE.Items.Count(); i++)
         {
             if ((edit.cobSYSTEMCODE.Items[i] as AppSystem).Name == entity.SYSTEMCODE)
             {
                 edit.cobSYSTEMCODE.SelectedIndex = i;
             }
         }
         for (int i = 0; i < edit.cobMODELCODE.Items.Count(); i++)
         {
             if ((edit.cobMODELCODE.Items[i] as AppModel).Name == entity.MODELCODE)
             {
                 edit.cobMODELCODE.SelectedIndex = i;
             }
         }
         edit.Show();
     }
     else
     {
         ComfirmWindow.ConfirmationBox("提示信息", "请选择一条记录进行修改!", "确定");
     }
 }