/// <summary>
        /// 显示修改详情页面
        /// </summary>
        public  void ShowUpdateDetail()
        {
            if (SelectedMaterialItem == null)
            {
                //弹框
                MessageBox.Show("请选择需要修改的原料!");
                return;
            }
            

            InitComboBoxBaseData();
            
            RawMaterialXaml = new RawMaterialView();
            //隐藏继续按钮
            RawMaterialXaml.Continue.Visibility = Visibility.Hidden;
            RawMaterialXaml.RecordControll.Visibility = Visibility.Visible;

            RawMaterialXaml.ShowDialog();
        }
 //type=0表示新增原料资料,type=1表示新增大类,type=2表示新增小类,type=3表示新增单位
 private void AddData(int type)
 {
     switch (type)
     {
         case 1:   //新增大类
             
             _BaseMaterialBean = new BaseMaterialBean();
             _BaseMaterialBean.Name = "";
             _RawMaterialBean.CreateBy = SubjectUtils.GetAuthenticationId();
             _RawMaterialBean.CreateDatetime = DateTime.Now;
             _BaseMaterialBean.Code = (BaseRawMaterialItems.Count + 1).ToString();
             BaseRawMaterialItems.Add(BaseMaterialBean);
             break;
         case 2:  //小类
             if (SelectedLittleRawNode != null)
             {
                 _LittleRawMaterialBean = new LittleRawMaterialBean();
                 _LittleRawMaterialBean.Name = "";
                 _LittleRawMaterialBean.Code = (LittleMaterialItems.Count + 1).ToString();
                 _LittleRawMaterialBean.ParentRawId = int.Parse(SelectedLittleRawNode.Id);
                 _LittleRawMaterialBean.ParentRaw = SelectedLittleRawNode.Text;
                 _LittleRawMaterialBean.CreateBy = SubjectUtils.GetAuthenticationId();
                 _LittleRawMaterialBean.CreateDatetime = DateTime.Now;
                 LittleMaterialItems.Add(LittleRawMaterialBean);
             }
             break;
         case 3:  //单位
             _BaseMaterialBean = new BaseMaterialBean();
             _BaseMaterialBean.Name = "";
             _BaseMaterialBean.Code = (BaseRawMaterialItems.Count + 1).ToString();
             _RawMaterialBean.CreateBy = SubjectUtils.GetAuthenticationId();
             _RawMaterialBean.CreateDatetime = DateTime.Now;
             BaseRawMaterialItems.Add(BaseMaterialBean);
             break;
         default:  //原料资料
             //把界面上的一下东东隐藏和显示
             if (SelectedRawNode == null || SelectedRawNode.Parent.Equals(RootTreeNode))
             {
                 MessageBox.Show("请选择原料小类");
                 return;
             }
             else
             {
                 //是小类,弹出新增原料页面
                 AddRawMaterialBaseData();
                 RawMaterialXaml = new RawMaterialView();
                 RawMaterialXaml.RecordControll.Visibility = Visibility.Hidden;
                 RawMaterialXaml.Continue.Visibility = Visibility.Visible;
                 RawMaterialXaml.ShowDialog();
             }
             break;
     }
 }