Ejemplo n.º 1
0
        private void BtnItemDel_Click(object sender, RoutedEventArgs e)
        {
            WmsAreaInfo m_WmsAreaInfo = tvMain.SelectedItem as WmsAreaInfo;

            if ((m_WmsAreaInfo == null) || (string.IsNullOrEmpty(m_WmsAreaInfo.PKNO)))
            {
                return;
            }
            //删除明细
            WmsAllocationInfo m_AllocationInfo = gridItem.SelectedItem as WmsAllocationInfo;

            if (m_AllocationInfo == null)
            {
                return;
            }

            if (System.Windows.Forms.MessageBox.Show($"确定删除货位信息【{m_AllocationInfo.ALLOCATION_NAME}】吗?",
                                                     @"删除信息",
                                                     MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
            {
                m_AllocationInfo.USE_FLAG = -1;
                ws.UseService(s => s.UpdateWmsAllocationInfo(m_AllocationInfo));

                //删除成功.
                List <WmsAllocationInfo> mWmsAllocationInfos =
                    ws.UseService(s => s.GetWmsAllocationInfos($"AREA_PKNO = {m_WmsAreaInfo.PKNO} AND USE_FLAG >= 0"))
                    .OrderBy(c => c.CREATION_DATE)
                    .ToList();
                gridItem.ItemsSource = mWmsAllocationInfos;

                BindHelper.SetDictDataBindingGridItem(gbItem, gridItem);
            }
        }
Ejemplo n.º 2
0
 public WmsAreaInfo GetWmsAreaInfoById(string Id)
 {
     using (IWmsAreaInfoBLL WmsAreaInfoBLL = BLLContainer.Resolve <IWmsAreaInfoBLL>())
     {
         WmsAreaInfo model = WmsAreaInfoBLL.GetFirstOrDefault(Id);
         return(model);
     }
 }
Ejemplo n.º 3
0
 public bool AddWmsAreaInfo(WmsAreaInfo mWmsAreaInfo)
 {
     if (mWmsAreaInfo == null)
     {
         return(false);
     }
     using (IWmsAreaInfoBLL WmsAreaInfoBLL = BLLContainer.Resolve <IWmsAreaInfoBLL>())
     {
         return(WmsAreaInfoBLL.Add(mWmsAreaInfo));
     }
 }
Ejemplo n.º 4
0
 public bool DelWmsAreaInfo(string Id)
 {
     using (IWmsAreaInfoBLL WmsAreaInfoBLL = BLLContainer.Resolve <IWmsAreaInfoBLL>())
     {
         try
         {
             WmsAreaInfo item = WmsAreaInfoBLL.GetFirstOrDefault(Id);
             return(WmsAreaInfoBLL.Delete(item));
         }
         catch { return(false); }
     }
 }
Ejemplo n.º 5
0
        private void BtnItemSave_Click(object sender, RoutedEventArgs e)
        {
            WmsAreaInfo m_WmsAreaInfo = tvMain.SelectedItem as WmsAreaInfo;

            if ((m_WmsAreaInfo == null) || (string.IsNullOrEmpty(m_WmsAreaInfo.PKNO)))
            {
                return;
            }
            WmsAllocationInfo m_AllocationInfo = gbItem.DataContext as WmsAllocationInfo;

            if (m_AllocationInfo == null)
            {
                return;
            }

            #region  校验

            if (string.IsNullOrEmpty(m_AllocationInfo.ALLOCATION_NAME))
            {
                System.Windows.Forms.MessageBox.Show("请输入货位名称。", "保存", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            #endregion

            if (string.IsNullOrEmpty(m_AllocationInfo.PKNO)) //新增
            {
                m_AllocationInfo.PKNO             = Guid.NewGuid().ToString("N");
                m_AllocationInfo.CREATED_BY       = CBaseData.LoginName;
                m_AllocationInfo.CREATION_DATE    = DateTime.Now;
                m_AllocationInfo.LAST_UPDATE_DATE = DateTime.Now;

                ws.UseService(s => s.AddWmsAllocationInfo(m_AllocationInfo));

                //重新刷新数据
                List <WmsAllocationInfo> mAllocationInfos =
                    ws.UseService(s => s.GetWmsAllocationInfos($"AREA_PKNO = {m_WmsAreaInfo.PKNO} AND USE_FLAG >= 0"))
                    .OrderBy(c => c.CREATION_DATE)
                    .ToList();
                gridItem.ItemsSource = mAllocationInfos;
            }
            else  //修改
            {
                m_AllocationInfo.UPDATED_BY       = CBaseData.LoginName;
                m_AllocationInfo.LAST_UPDATE_DATE = DateTime.Now;
                ws.UseService(s => s.UpdateWmsAllocationInfo(m_AllocationInfo));
            }
            //提示保存成功

            gbItem.IsCollapsed = true;
            gbItem.Visibility  = Visibility.Collapsed;
            BindHelper.SetDictDataBindingGridItem(gbItem, gridItem);
        }
Ejemplo n.º 6
0
        //删除主信息,已禁用
        private void BtnMainDel_Click(object sender, RoutedEventArgs e)
        {
            WmsAreaInfo m_WmsAreaInfo = tvMain.SelectedItem as WmsAreaInfo;

            if ((m_WmsAreaInfo == null) || (string.IsNullOrEmpty(m_WmsAreaInfo.PKNO)))
            {
                return;
            }

            ws.UseService(s => s.DelWmsAreaInfo(m_WmsAreaInfo.PKNO));

            GetMainData();
        }
Ejemplo n.º 7
0
        private void Selector_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            WmsAreaInfo areaInfo = cmbInAreaInfo.SelectedItem as WmsAreaInfo;

            if (areaInfo == null)
            {
                cmbInAllocation.ItemsSource = null;
                return;
            }
            cmbInAllocation.ItemsSource =
                wsWMS.UseService(s => s.GetWmsAllocationInfos($"AREA_PKNO = '{areaInfo.PKNO}' AND USE_FLAG = 1"))
                .OrderBy(c => c.CREATION_DATE)
                .ToList();
        }
Ejemplo n.º 8
0
        private void BtnMainAdd_Click(object sender, RoutedEventArgs e)
        {
            WmsAreaInfo main = new WmsAreaInfo()
            {
                PKNO         = "",
                COMPANY_CODE = "",
                USE_FLAG     = 1,
            };
            AreaMang mainEdit = new AreaMang(main);

            mainEdit.ShowDialog();

            GetMainData();
        }
Ejemplo n.º 9
0
        private void BtnMainMod_Click(object sender, RoutedEventArgs e)
        {
            WmsAreaInfo m_WmsAreaInfo = tvMain.SelectedItem as WmsAreaInfo;

            if ((m_WmsAreaInfo == null) || (string.IsNullOrEmpty(m_WmsAreaInfo.PKNO)))
            {
                return;
            }
            AreaMang mainEdit = new AreaMang(m_WmsAreaInfo);

            mainEdit.ShowDialog();

            GetMainData();
        }
Ejemplo n.º 10
0
        public AreaMang(WmsAreaInfo areaInfo)
        {
            InitializeComponent();

            if (areaInfo == null)
            {
                areaInfo = new WmsAreaInfo()
                {
                    PKNO         = "",
                    COMPANY_CODE = "",
                    USE_FLAG     = 1,
                };
            }
            gbInfo.DataContext = areaInfo;
        }
Ejemplo n.º 11
0
 public bool DelWmsAreaInfos(string[] Ids)
 {
     using (IWmsAreaInfoBLL WmsAreaInfoBLL = BLLContainer.Resolve <IWmsAreaInfoBLL>())
     {
         try
         {
             List <WmsAreaInfo> entitys = new List <WmsAreaInfo>();
             foreach (string id in Ids)
             {
                 WmsAreaInfo item = WmsAreaInfoBLL.GetFirstOrDefault(id);
                 entitys.Add(item);
             }
             return(WmsAreaInfoBLL.Delete(entitys));
         }
         catch { return(false); }
     }
 }
Ejemplo n.º 12
0
        //双击修改
        private void gridItem_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            WmsAreaInfo m_WmsAreaInfo = tvMain.SelectedItem as WmsAreaInfo;

            if ((m_WmsAreaInfo == null) || (string.IsNullOrEmpty(m_WmsAreaInfo.PKNO)))
            {
                return;
            }

            if (gridItem.SelectedItem == null)
            {
                return;
            }
            //修改明细
            dictBasic.Header   = "货位信息维护  【修改】";
            gbItem.IsCollapsed = false;
            gbItem.Visibility  = Visibility.Visible;
        }
Ejemplo n.º 13
0
        private void tvMain_SelectedItemChanged(object sender, SelectedItemChangedEventArgs e)
        {
            WmsAreaInfo m_WmsAreaInfo = tvMain.SelectedItem as WmsAreaInfo;

            if ((m_WmsAreaInfo == null) || (string.IsNullOrEmpty(m_WmsAreaInfo.PKNO)))
            {
                gridItem.ItemsSource = null;
                return;
            }

            List <WmsAllocationInfo> mWmsAllocationInfos =
                ws.UseService(s => s.GetWmsAllocationInfos($"AREA_PKNO = {m_WmsAreaInfo.PKNO} AND USE_FLAG >= 0"))
                .OrderBy(c => c.CREATION_DATE)
                .ToList();

            gridItem.ItemsSource = mWmsAllocationInfos;

            gbItem.IsCollapsed = true;
            gbItem.Visibility  = Visibility.Collapsed;
        }
Ejemplo n.º 14
0
        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            WmsAreaInfo main = gbInfo.DataContext as WmsAreaInfo;

            if (string.IsNullOrEmpty(main.PKNO))  //新增
            {
                main.PKNO             = Guid.NewGuid().ToString("N");
                main.CREATION_DATE    = DateTime.Now;
                main.CREATED_BY       = CBaseData.LoginName;
                main.LAST_UPDATE_DATE = DateTime.Now;
                ws.UseService(s => s.AddWmsAreaInfo(main));
            }
            else
            {
                main.UPDATED_BY       = CBaseData.LoginName;
                main.LAST_UPDATE_DATE = DateTime.Now;
                ws.UseService(s => s.UpdateWmsAreaInfo(main));
            }

            Close();
        }
Ejemplo n.º 15
0
        private void BtnItemAdd_Click(object sender, RoutedEventArgs e)
        {
            WmsAreaInfo m_WmsAreaInfo = tvMain.SelectedItem as WmsAreaInfo;

            if ((m_WmsAreaInfo == null) || (string.IsNullOrEmpty(m_WmsAreaInfo.PKNO)))
            {
                return;
            }

            //添加明细
            dictBasic.Header   = "货位信息维护  【新增】";
            gbItem.IsCollapsed = false;
            gbItem.Visibility  = Visibility.Visible;

            WmsAllocationInfo m_AllocationInfos = new WmsAllocationInfo()
            {
                COMPANY_CODE     = "",
                AREA_PKNO        = m_WmsAreaInfo.PKNO,
                ALLOCATION_STATE = 0,
                USE_FLAG         = 1,
            };

            gbItem.DataContext = m_AllocationInfos;
        }
Ejemplo n.º 16
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            if (bShowInfo)
            {
                return;
            }

            Cursor            = Cursors.Wait;
            cvMain.Visibility = Visibility;
            string fileName = System.Environment.CurrentDirectory + "\\Monitor\\default.lfd";

            if (File.Exists(fileName))
            {
                cvMain.LoadFile(fileName); //加载
            }

            bShowInfo = true;

            #region 显示库存信息

            WmsAreaInfo area = wsWMS.UseService(s => s.GetWmsAreaInfos($"USE_FLAG = 1 AND AREA_CODE = '轮毂立体料架'"))
                               .FirstOrDefault();

            if (area != null)
            {
                //myShelf.TotalColumn = SafeConverter.SafeToInt(area.TOTAL_COL, 6);
                //totalColumn = SafeConverter.SafeToInt(area.TOTAL_COL, 6);
                //myShelf.TotalLayer = SafeConverter.SafeToInt(area.TOTAL_LAY, 2);
                //totalLayer = SafeConverter.SafeToInt(area.TOTAL_LAY, 2);
                //areaPKNO = area.PKNO;
            }


            List <RsItemMaster> items = wsRsm.UseService(s => s.GetRsItemMasters("USE_FLAG = 1"));  //物料信息

            #region 初始化物料显示图片

            SingleRowShelf.GoodsColors.Clear();
            SingleRowShelf.GoodsImages.Clear();

            string path = Environment.CurrentDirectory + "/images/";
            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }

            foreach (RsItemMaster item in items)
            {
                string imgFile = path + item.ITEM_NAME + ".jpg";
                if (File.Exists(imgFile))
                {
                    SingleRowShelf.GoodsImages.Add(item.PKNO, new BitmapImage(new Uri(imgFile, UriKind.Absolute)));
                }
                else //不存在图片
                {
                    SingleRowShelf.GoodsColors.Add(item.PKNO, Brushes.Pink);
                }
            }

            #endregion

            #endregion

            bRefreshAllo = true;

            Cursor = Cursors.Arrow;
        }