Exemplo n.º 1
0
        public DischesWay CreateDishesWay(DishesWayBean bean)
        {
            DischesWay beanBack = new DischesWay();

            beanBack.DischesWayId     = bean.DischesWayId;
            beanBack.DischesWayNameId = bean.DischesWayNameId;
            beanBack.Code             = bean.Code;
            beanBack.Name             = bean.Name;
            beanBack.WayDetail        = bean.WayDetail;
            beanBack.PingYing         = bean.PingYing;
            beanBack.AddPrice         = bean.AddPrice;
            beanBack.AddPriceByNum    = bean.AddPriceByNum;
            beanBack.CreateDatetime   = bean.CreateDatetime;
            beanBack.CreateBy         = bean.CreateBy;
            beanBack.Deleted          = bean.Deleted;
            beanBack.Status           = bean.Status;
            beanBack.UpdateDatetime   = bean.UpdateDatetime;
            beanBack.UpdateBy         = bean.UpdateBy;
            return(beanBack);
        }
Exemplo n.º 2
0
 public DishesWayBean CreateDishesWayBean(DishesWayBean bean)
 {
     this.DischesWayId     = bean.DischesWayId;
     this.DischesWayNameId = bean.DischesWayNameId;
     this.DischesWayName   = bean.DischesWayName;
     this.LineNumber       = bean.LineNumber;
     this.CurrentScaleText = bean.CurrentScaleText;
     this.Code             = bean.Code;
     this.Name             = bean.Name;
     this.WayDetail        = bean.WayDetail;
     this.PingYing         = bean.PingYing;
     this.AddPrice         = bean.AddPrice;
     this.AddPriceByNum    = bean.AddPriceByNum;
     this.CreateDatetime   = bean.CreateDatetime;
     this.CreateBy         = bean.CreateBy;
     this.Deleted          = bean.Deleted;
     this.Status           = bean.Status;
     this.UpdateDatetime   = bean.UpdateDatetime;
     this.UpdateBy         = bean.UpdateBy;
     this.addPriceByNum    = bean.addPriceByNum;
     return(this);
 }
 private void LoadDishesWayData(DischesWayName dwn, TreeNodeModel node)
 {
         ICollection<DischesWay> dws = dwn.DischesWay;
         if (dws != null)
         {
             foreach (var d in dws)
             {
                 if (d.Deleted == 0)
                 {
                     _DishesWayBean = new DishesWayBean();
                     _DishesWayBean.CreateDishesWayBean(d);
                     _DishesWayBean.LineNumber = DishesWayTableItems.Count + 1;
                     DishesWayTableItems.Add(DishesWayBean);
                 }
             }
         }
 }
Exemplo n.º 4
0
        public DischesWay CreateDishesWay(DishesWayBean bean)
        {
            DischesWay beanBack = new DischesWay();
            beanBack.DischesWayId = bean.DischesWayId;
            beanBack.DischesWayNameId = bean.DischesWayNameId;
            beanBack.Code = bean.Code;
            beanBack.Name = bean.Name;
            beanBack.WayDetail = bean.WayDetail;
            beanBack.PingYing = bean.PingYing;
            beanBack.AddPrice = bean.AddPrice;
            beanBack.AddPriceByNum = bean.AddPriceByNum;
            beanBack.CreateDatetime = bean.CreateDatetime;
            beanBack.CreateBy = bean.CreateBy;
            beanBack.Deleted = bean.Deleted;
            beanBack.Status = bean.Status;
            beanBack.UpdateDatetime = bean.UpdateDatetime;
            beanBack.UpdateBy = bean.UpdateBy;
            return beanBack;

        }
Exemplo n.º 5
0
        public DishesWayBean CreateDishesWayBean(DishesWayBean bean)
        {
            this.DischesWayId = bean.DischesWayId;
            this.DischesWayNameId = bean.DischesWayNameId;
            this.DischesWayName = bean.DischesWayName;
            this.LineNumber = bean.LineNumber;
            this.CurrentScaleText = bean.CurrentScaleText;
            this.Code = bean.Code;
            this.Name = bean.Name;
            this.WayDetail = bean.WayDetail;
            this.PingYing = bean.PingYing;
            this.AddPrice = bean.AddPrice;
            this.AddPriceByNum = bean.AddPriceByNum;
            this.CreateDatetime = bean.CreateDatetime;
            this.CreateBy = bean.CreateBy;
            this.Deleted = bean.Deleted;
            this.Status = bean.Status;
            this.UpdateDatetime = bean.UpdateDatetime;
            this.UpdateBy = bean.UpdateBy;
            this.addPriceByNum = bean.addPriceByNum;
            return this;

        }
 /// <summary>
 /// 根据做法类型id查询和显示该做法类型下的所有做法
 /// </summary>
 /// <param name="wayTypeId">做法类型id</param>
 /// <param name="type">type=0表示全部加载数据,并显示到表格中,type!=0表示选中树节点时显示其对应的数据</param>
 private void LoadBaseData(DischesWayName dwn, int type)
 {
     if (dwn == null)
     {
         return;
     }
     int wayTypeId = dwn.DischesWayNameId;
     if (type != 0)
     {
         DishesWayTableItems.Clear();
     }
     
     //加载数据
     ICollection<DischesWay> dws = dwn.DischesWay;
     if (dws != null)
         foreach (var d in dws)
         {
             if (d.Deleted == 1)
                 continue;
             _DishesWayBean = new DishesWayBean();
             _DishesWayBean.CreateDishesWayBean(d);
             _DishesWayBean.DischesWayName = dwn.Name;
             //设置显示行号和编码
             _DishesWayBean.LineNumber = DishesWayTableItems.Count + 1;
             _DishesWayBean.Code = d.Code;
             if (!SelectedFlag)
             {
                 DishesWaySelectedItem = DishesWayBean;
                 SelectedFlag = true;
             }
             DishesWayTableItems.Add(_DishesWayBean);
         }
 }
        /// <summary>
        /// 0代表是新增做法类型 1表示修改做法类型
        /// </summary>
        /// <param name="type"></param>
        private void OpenDishesWin(ButtonEventType type)
        {
            DishesWaySettingXaml = new DishesWaySettingWindow();
            switch (type)
            {
                case ButtonEventType.ADD:
                    if (SelectedTreeNode == null)
                    {
                        MessageBox.Show("请选择做法类型!");
                        return;
                    }
                    InitAddData();

                    DishesWaySettingXaml.AddDescription.Visibility = Visibility.Visible;
                    DishesWaySettingXaml.Continue.Visibility = Visibility.Visible;
                    DishesWaySettingXaml.UpdateRecord.Visibility = Visibility.Hidden;
                    break;
                case ButtonEventType.UPDATE:
                    if (DishesWaySelectedItem == null)
                    {
                        MessageBox.Show("请选择要修改的做法!");
                        return;
                    }

                    DishesWayBean = new DishesWayBean();
                    DishesWayBean.IsReadOnlyCode = true;
                    DishesWaySelectedItem.UpdateBy = SubjectUtils.GetAuthenticationId();
                    DishesWaySelectedItem.UpdateDatetime = DateTime.Now;
                    DishesWayBean.CreateDishesWayBean(DishesWaySelectedItem);
                    DishesWayBean.CurrentScaleText = (DishesWayTableItems.IndexOf(DishesWaySelectedItem) + 1) + "/" + DishesWayTableItems.Count;
                    DishesWaySettingXaml.AddDescription.Visibility = Visibility.Hidden;
                    DishesWaySettingXaml.Continue.Visibility = Visibility.Hidden;
                    DishesWaySettingXaml.UpdateRecord.Visibility = Visibility.Visible;
                    break;
            }
            DishesWaySettingXaml.ShowDialog();
        }