public void CallTagMgmtPage()
        {
            WarehouseContext dbcontext;
            var tagMgmtPage = WindowMgr.CreateTabPageWithDBContext("管理分类标签", "管理分类标签", true, out dbcontext);

            if (tagMgmtPage != null)
            {
                tagMgmtPage.Content = new ManageTags(dbcontext);
            }
        }
Example #2
0
        public void CallWarehouseMapEditPage()
        {
            WarehouseContext dbcontext;
            var warehouseMapEditPage = WindowMgr.CreateTabPageWithDBContext("存放位置管理", "存放位置管理", true, out dbcontext);

            if (warehouseMapEditPage != null)
            {
                warehouseMapEditPage.Content = new WarehouseMap(dbcontext);
            }
        }
        public void CallWarehouseInboundtPage()
        {
            WarehouseContext dbcontext;
            var tab         = WindowMgr.CreateTabPageWithDBContext("入库单", "入库单", false, out dbcontext);
            var formControl = FormControlHelper.CreateFormControl();

            formControl.CreateControlCallback = (cx, ctl) =>
            {
                if (cx.ControlType == ControlType.Label &&
                    cx.PropertyInfo.Name == "InboundGoods")
                {
                    ctl.VerticalAlignment = VerticalAlignment.Top;
                    return(ctl);
                }
                if (cx.ControlType == ControlType.Editable ||
                    cx.ControlType == ControlType.Readonly)
                {
                    switch (cx.PropertyInfo.Name)
                    {
                    case "Operator":
                        return(RenderSelectUserControl(cx, dbcontext));

                    case "InboundGoods":
                        return(new GoodsList(dbcontext));
                    }
                }
                return(ctl);
            };

            //form submit callback
            formControl.SubmitCallback = d =>
            {
                try
                {
                    dbcontext.WarehouseInbounds.Add((WarehouseInbound)d);
                    dbcontext.SaveChanges();
                    WindowMgr.SendNotification("入库成功", NotificationLevel.Information);
                    WindowMgr.CloseTabPage(tab);
                    dbcontext.Dispose();
                }
                catch (Exception ex)
                {
                    //TODO: handle exception
                    WindowMgr.SendNotification("入库操作失败", NotificationLevel.Error);
                }
            };

            var newinbound = new WarehouseInbound();

            newinbound.Name = string.Format("入库 - {0}", DateTime.Now);
            formControl.RenderForm(newinbound, false);
            formControl.ConfirmButton.Content = "入库";
            tab.Content = formControl;
        }
        public void CallQueryGoodsPage()
        {
            WarehouseContext context;

            WindowMgr.CreateTabPageWithDBContext("查询货物", "查询货物", true, out context, new QueryGoods());
        }