Ejemplo n.º 1
0
        /// <summary>
        /// 各种单据新增
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmOrder_ActionButtonPress(object sender, ActionButtonPressEventArgs e)
        {
            switch (e.Index)
            {
            case 0:           //资产采购创建
                frmAssPurchaseOrderCreate frmAssPurchaseOrderCreate = new frmAssPurchaseOrderCreate();
                Show(frmAssPurchaseOrderCreate, (MobileForm senderAP, object args) => {
                    Bind(type, orderType);
                });
                break;

            case 1:          //资产销售创建
                frmAssSalesOrderCreate frmAssSalesOrderCreate = new frmAssSalesOrderCreate();
                Show(frmAssSalesOrderCreate, (MobileForm senderAS, object args) => {
                    Bind(type, orderType);
                });
                break;

            case 2:          //耗材采购创建
                frmConPurchaseCreate frmConPurchaseCreate = new frmConPurchaseCreate();
                Show(frmConPurchaseCreate, (MobileForm senderCP, object args) => {
                    Bind(type, orderType);
                });
                break;

            case 3:          //耗材销售创建
                frmConSalesCreate frmConSalesCreate = new frmConSalesCreate();
                Show(frmConSalesCreate, (MobileForm senderCS, object args) => {
                    Bind(type, orderType);
                });
                break;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// action事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmWork_ActionButtonPress(object sender, ActionButtonPressEventArgs e)
        {
            try
            {
                switch (e.Index)
                {
                //创建请假
                case 0:
                    Leave.frmLeaveCreate frmLeaveCreate = new Leave.frmLeaveCreate();
                    Show(frmLeaveCreate);
                    break;

                //创建消费记录
                case 1:
                    RB.frmRBRows frmRBRows = new RB.frmRBRows();
                    Show(frmRBRows);
                    break;

                //创建报销
                case 2:
                    RB.frmRBCreate frmRBCreate = new RB.frmRBCreate();
                    Show(frmRBCreate);
                    break;
                }
            }
            catch (Exception ex)
            {
                Toast(ex.Message, ToastLength.SHORT);
            }
        }
Ejemplo n.º 3
0
 private void demoTabToolbar_ActionButtonPress(object sender, ActionButtonPressEventArgs e)
 {
     switch (e.Index)
     {
     case 0:
         this.Form.Close();
         break;
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 点击ActionButton
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmAssets_ActionButtonPress(object sender, ActionButtonPressEventArgs e)
        {
            try
            {
                switch (e.Index)
                {
                case 0:         //资产调拨
                    //调拨
                    frmAssTransferRows frmT = new frmAssTransferRows();
                    this.Form.Show(frmT);
                    break;

                case 1:
                    //资产打印
                    try
                    {
                        if (string.IsNullOrEmpty(SelectAssId))
                        {
                            throw new Exception("请先选择资产.");
                        }
                        AssetsOutputDto            outputDto = _autofacConfig.SettingService.GetAssetsByID(SelectAssId);
                        PosPrinterEntityCollection Commands  = new PosPrinterEntityCollection();
                        Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.Initial));
                        Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.EnabledBarcode));
                        Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.AbsoluteLocation));
                        Commands.Add(new PosPrinterBarcodeEntity(PosBarcodeType.CODE128Height, "62"));
                        Commands.Add(new PosPrinterBarcodeEntity(PosBarcodeType.CODE128, outputDto.SN));
                        //Commands.Add(new PosPrinterBarcodeEntity(PosBarcodeType.CODE128, "E2000017320082231027BD"));
                        Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.DisabledBarcode));
                        Commands.Add(new PosPrinterContentEntity(System.Environment.NewLine));
                        Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.Cut));

                        posPrinter1.Print(Commands, (obj, args) =>
                        {
                            if (args.isError == true)
                            {
                                this.Toast("Error: " + args.error);
                            }
                            else
                            {
                                this.Toast("打印成功");
                            }
                        });
                    }
                    catch (Exception ex)
                    {
                        Toast(ex.Message);
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 入库、出库、购买提交、结束购买等操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmConPurchaseResult_ActionButtonPress(object sender, ActionButtonPressEventArgs e)
        {
            try
            {
                ReturnInfo rInfo = new ReturnInfo();
                switch (e.Index)
                {
                case 0:          //耗材入库
                    List <ConPORInstorageOutputDto> rows = autofacConfig.ConPurchaseOrderService.GetInStoRowsByPOID(POID);
                    if (rows.Count > 0)
                    {
                        frmConPORInSto frmConPORInSto = new frmConPORInSto();
                        frmConPORInSto.POID = POID;
                        Form.Show(frmConPORInSto, (MobileForm sender1, object args) =>
                        {
                            Bind();          //数据绑定
                        });
                    }
                    else
                    {
                        throw new Exception("该入库单下目前无可入库耗材!");
                    }
                    break;

                case 1:          //耗材退库
                    List <ConPurchaseOrderReturnOutputDto> returnRows = autofacConfig.ConPurchaseOrderService.GetReturnRowsByPOID(POID);
                    if (returnRows.Count > 0)
                    {
                        frmConPORReturn frmConPORReturn = new frmConPORReturn();
                        frmConPORReturn.POID = POID;
                        Form.Show(frmConPORReturn, (MobileForm sender1, object args) =>
                        {
                            Bind();          //数据绑定
                        });
                    }
                    else
                    {
                        throw new Exception("该入库单下目前无可退库耗材!");
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 出库、退货、销售提交、结束销售等操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmConSalesResult_ActionButtonPress(object sender, ActionButtonPressEventArgs e)
        {
            try
            {
                ReturnInfo rInfo = new ReturnInfo();
                switch (e.Index)
                {
                case 0:          //耗材出库
                    List <ConSalesOrderOutboundOutputDto> outRows = autofacConfig.ConSalesOrderService.GetOutRowsBySOID(SOID);
                    if (outRows.Count > 0)
                    {
                        frmConSOROutbound frmOut = new frmConSOROutbound();
                        frmOut.SOID = SOID;
                        Form.Show(frmOut, (MobileForm sender1, object args) =>
                        {
                            Bind();          //数据绑定
                        });
                    }
                    else
                    {
                        throw new Exception("该消耗单下目前无可出库耗材!");
                    }
                    break;

                case 1:          //耗材退货
                    List <ConSalesOrderRowInputDto> retRows = autofacConfig.ConSalesOrderService.GetRetRowsBySOID(SOID);
                    if (retRows.Count > 0)
                    {
                        frmConSORRetiring frmRet = new frmConSORRetiring();
                        frmRet.SOID = SOID;
                        Form.Show(frmRet, (MobileForm sender1, object args) =>
                        {
                            Bind();          //数据绑定
                        });
                    }
                    else
                    {
                        throw new Exception("该消耗单下目前无可出库耗材!");
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }
Ejemplo n.º 7
0
 /// <summary>
 /// 客户新增
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmCustomer_ActionButtonPress(object sender, ActionButtonPressEventArgs e)
 {
     switch (e.Index)
     {
     case 0:
         frmCustomerCreate frmCustomerCreate = new frmCustomerCreate();
         frmCustomerCreate.unitType = unitType;
         Show(frmCustomerCreate, (MobileForm sender1, object args) =>
         {
             if (frmCustomerCreate.ShowResult == ShowResult.Yes)
             {
                 Bind();        //新增客户完毕,刷新当前界面
             }
         });
         break;
     }
 }
Ejemplo n.º 8
0
        private void frmToolBarMenu_ActionButtonPress(object sender, ActionButtonPressEventArgs e)
        {
            frmOrderLayout ly = (frmOrderLayout)tabPageView1.Controls[1];
            //  int i = ly.type;
            int type      = ly.type;
            int orderType = ly.orderType;

            switch (e.Index)
            {
            case 0:           //资产采购创建
                frmAssPurchaseOrderCreate frmAssPurchaseOrderCreate = new frmAssPurchaseOrderCreate();
                Show(frmAssPurchaseOrderCreate, (MobileForm senderAP, object args) =>
                {
                    ly.Bind(type, orderType);
                });
                break;

            case 1:          //资产销售创建
                frmAssSalesOrderCreate frmAssSalesOrderCreate = new frmAssSalesOrderCreate();
                Show(frmAssSalesOrderCreate, (MobileForm senderAS, object args) =>
                {
                    ly.Bind(type, orderType);
                });
                break;

            case 2:          //耗材采购创建
                frmConPurchaseCreate frmConPurchaseCreate = new frmConPurchaseCreate();
                Show(frmConPurchaseCreate, (MobileForm senderCP, object args) =>
                {
                    ly.Bind(type, orderType);
                });
                break;

            case 3:          //耗材销售创建
                frmConSalesCreate frmConSalesCreate = new frmConSalesCreate();
                Show(frmConSalesCreate, (MobileForm senderCS, object args) =>
                {
                    ly.Bind(type, orderType);
                });
                break;
            }
        }
Ejemplo n.º 9
0
        //按ActionButton时触发
        private void frmAssInventory_ActionButtonPress(object sender, ActionButtonPressEventArgs e)
        {
            switch (e.Index)
            {
            case 0:
                frmAssInventoryCreate assInventoryCreate = new frmAssInventoryCreate();
                Show(assInventoryCreate, (MobileForm sender1, object args) =>
                {
                    if (assInventoryCreate.ShowResult == ShowResult.Yes)
                    {
                        Bind();
                    }
                });

                break;

            default:
                break;
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 盘点上传或盘点结束
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmConInventoryResult_ActionButtonPress(object sender, ActionButtonPressEventArgs e)
        {
            try
            {
                ReturnInfo rInfo = new ReturnInfo();
                switch (e.Index)
                {
                case 0:
                    //上传结果
                    ConInventoryInputDto inputDto = new ConInventoryInputDto
                    {
                        IID           = IID,
                        IsEnd         = false,
                        ConDictionary = conDictionary,
                        LOCATIONID    = LocationId,
                        CREATEUSER    = UserId
                    };
                    inputDto.IsEnd = false;
                    rInfo          = _autofacConfig.ConInventoryService.UpdateInventory(inputDto);
                    Toast(rInfo.IsSuccess ? "上传结果成功!" : rInfo.ErrorInfo);
                    break;

                case 1:
                    //盘点结束
                    Dictionary <string, List <decimal> > conDictionary2 = new Dictionary <string, List <decimal> >();
                    foreach (var key in conDictionary.Keys)
                    {
                        if (conDictionary[key][1] == (int)ResultStatus.待盘点)
                        {
                            List <decimal> list = new List <decimal>();
                            list.Add(0);
                            list.Add(Convert.ToDecimal((int)ResultStatus.盘亏));
                            conDictionary2.Add(key, list);
                        }
                        else
                        {
                            conDictionary2.Add(key, conDictionary[key]);
                        }
                    }

                    ConInventoryInputDto inputDto2 = new ConInventoryInputDto
                    {
                        IID           = IID,
                        LOCATIONID    = LocationId,
                        IsEnd         = false,
                        ConDictionary = conDictionary2
                    };
                    inputDto2.IsEnd = true;
                    rInfo           = _autofacConfig.ConInventoryService.UpdateInventory(inputDto2);
                    if (rInfo.IsSuccess)
                    {
                        ShowResult = ShowResult.Yes;
                        Close();
                        Toast("盘点结束成功.");
                    }
                    else
                    {
                        Toast(rInfo.ErrorInfo);
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 按ActionButton时
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmAssPurchaseOrderResult_ActionButtonPress(object sender, ActionButtonPressEventArgs e)
        {
            try
            {
                switch (e.Index)
                {
                case 0:
                    //入库
                    switch (Status)
                    {
                    case 2:
                        throw new Exception("入库已完成!");

                    case 0:
                    case 1:
                        frmAssIn frmAssIn = new frmAssIn
                        {
                            POID     = POID,
                            IsFromPO = true
                        };
                        Show(frmAssIn, (MobileForm sender1, object args) =>
                        {
                            if (frmAssIn.ShowResult == ShowResult.Yes)
                            {
                                Bind();
                            }
                        });
                        break;
                    }
                    break;

                case 1:
                    //退货
                    switch (Status)
                    {
                    case 0:
                        throw new Exception("入库未开始,无法退货!");

                    case 2:
                    case 1:
                        frmAssReturn frmAssReturn = new frmAssReturn
                        {
                            POID     = POID,
                            IsFromPO = true
                        };
                        Show(frmAssReturn, (MobileForm sender1, object args) =>
                        {
                            if (frmAssReturn.ShowResult == ShowResult.Yes)
                            {
                                Bind();
                            }
                        });
                        break;
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 点击ActionButton
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmAssets_ActionButtonPress(object sender, ActionButtonPressEventArgs e)
        {
            try
            {
                switch (e.Index)
                {
                case 0:         //资产新增
                    try
                    {
                        if (Client.Session["Role"].ToString() == "SMOSECUser")
                        {
                            throw new Exception("当前用户没有权限添加资产!");
                        }
                        frmAssetsCreate assetsCreate = new frmAssetsCreate();
                        Show(assetsCreate, (MobileForm sender1, object args) =>
                        {
                            if (assetsCreate.ShowResult == ShowResult.Yes)
                            {
                                Bind();
                            }
                        }
                             );
                    }
                    catch (Exception ex)
                    {
                        Toast(ex.Message);
                    }
                    break;

                case 1:
                    //资产复制
                    try
                    {
                        if (string.IsNullOrEmpty(SelectAssId))
                        {
                            throw new Exception("请先选择资产.");
                        }
                        var assets = _autofacConfig.SettingService.GetAssetsByID(SelectAssId);

                        frmAssetsCreate assetsCreate = new frmAssetsCreate
                        {
                            DatePickerBuy    = { Value = assets.BuyDate },
                            DepId            = assets.DepartmentId,
                            btnDep           = { Text = assets.DepartmentName + "   > " },
                            DatePickerExpiry = { Value = assets.ExpiryDate },
                            ImgPicture       = { ResourceID = assets.Image },
                            LocationId       = assets.LocationId,
                            btnLocation      = { Text = assets.LocationName },
                            ManagerId        = assets.Manager,
                            txtManager       = { Text = assets.ManagerName },
                            txtName          = { Text = assets.Name },
                            txtNote          = { Text = assets.Note },
                            txtPlace         = { Text = assets.Place },
                            txtPrice         = { Text = assets.Price.ToString() },
                            txtSpe           = { Text = assets.Specification },
                            TypeId           = assets.TypeId,
                            btnType          = { Text = assets.TypeName },
                            txtUnit          = { Text = assets.Unit },
                            txtVendor        = { Text = assets.Vendor }
                        };

                        Show(assetsCreate, (MobileForm sender1, object args) =>
                        {
                            if (assetsCreate.ShowResult == ShowResult.Yes)
                            {
                                Bind();
                            }
                        }
                             );
                    }
                    catch (Exception ex)
                    {
                        Toast(ex.Message);
                    }
                    break;

                case 2:
                    //资产领用
                    frmCollarOrder frmCO = new frmCollarOrder();
                    Form.Show(frmCO);
                    break;

                case 3:
                    //资产借用
                    frmBorrowOrder frmBO = new frmBorrowOrder();
                    Form.Show(frmBO);
                    break;

                case 4:
                    //维修登记
                    frmRepairRowsSN frmR = new frmRepairRowsSN();
                    this.Form.Show(frmR);
                    break;

                case 5:
                    //报废
                    frmScrapRowsSN frmS = new frmScrapRowsSN();
                    this.Form.Show(frmS);
                    break;

                case 6:
                    //调拨
                    frmTransferRowsSN frmT = new frmTransferRowsSN();
                    this.Form.Show(frmT);
                    break;

                case 7:
                    try
                    {
                        if (string.IsNullOrEmpty(SelectAssId))
                        {
                            throw new Exception("请先选择资产.");
                        }
                        AssetsOutputDto            outputDto = _autofacConfig.SettingService.GetAssetsByID(SelectAssId);
                        PosPrinterEntityCollection Commands  = new PosPrinterEntityCollection();
                        Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.Initial));
                        Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.EnabledBarcode));
                        Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.AbsoluteLocation));
                        Commands.Add(new PosPrinterBarcodeEntity(PosBarcodeType.CODE128Height, "62"));
                        Commands.Add(new PosPrinterBarcodeEntity(PosBarcodeType.CODE128, outputDto.SN));
                        //Commands.Add(new PosPrinterBarcodeEntity(PosBarcodeType.CODE128, "E2000017320082231027BD"));
                        Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.DisabledBarcode));
                        Commands.Add(new PosPrinterContentEntity(System.Environment.NewLine));
                        Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.Cut));

                        posPrinter1.Print(Commands, (obj, args) =>
                        {
                            if (args.isError == true)
                            {
                                this.Toast("Error: " + args.error);
                            }
                            else
                            {
                                this.Toast("打印成功");
                            }
                        });
                    }
                    catch (Exception ex)
                    {
                        Toast(ex.Message);
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }
Ejemplo n.º 13
0
 /// <summary>
 /// 点击ActionButton
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmAssInventoryResult_ActionButtonPress(object sender, ActionButtonPressEventArgs e)
 {
 }
Ejemplo n.º 14
0
        private void frmAssets_ActionButtonPress(object sender, ActionButtonPressEventArgs e)
        {
            try
            {
                switch (e.Index)
                {
                case 0:
                    frmAssetsCreate assCreate = new frmAssetsCreate();
                    Show(assCreate, (MobileForm sender1, object args) =>
                    {
                        if (assCreate.ShowResult == ShowResult.Yes)
                        {
                            Bind();
                        }
                    });
                    break;

                case 1:
                    //资产复制
                    try
                    {
                        if (string.IsNullOrEmpty(SelectAssId))
                        {
                            throw new Exception("请先选择资产.");
                        }
                        var assets = _autofacConfig.SettingService.GetAssetsByID(SelectAssId);

                        frmAssetsCreate assetsCreate = new frmAssetsCreate
                        {
                            DatePickerBuy    = { Value = assets.BuyDate },
                            txtDepart        = { Text = assets.DepartmentId },
                            DatePickerExpiry = { Value = assets.ExpiryDate },
                            ImgPicture       = { ResourceID = assets.Image },
                            LocationId       = assets.LocationId,
                            btnLocation      = { Text = assets.LocationName },
                            ManagerId        = assets.Manager,
                            txtManager       = { Text = assets.ManagerName },
                            txtName          = { Text = assets.Name },
                            txtNote          = { Text = assets.Note },
                            txtPlace         = { Text = assets.Place },
                            txtPrice         = { Text = assets.Price.ToString() },
                            txtSpe           = { Text = assets.Specification },
                            TypeId           = assets.TypeId,
                            btnType          = { Text = assets.TypeName },
                            txtUnit          = { Text = assets.Unit },
                            txtVendor        = { Text = assets.Vendor }
                        };

                        Show(assetsCreate, (MobileForm sender1, object args) =>
                        {
                            if (assetsCreate.ShowResult == ShowResult.Yes)
                            {
                                Bind();
                            }
                        }
                             );
                    }
                    catch (Exception ex)
                    {
                        Toast(ex.Message);
                    }
                    break;;

                case 2:
                    //资产领用
                    frmCollarOrder frmCO = new frmCollarOrder();
                    Form.Show(frmCO);
                    break;

                case 3:
                    //资产借用
                    frmBorrowOrder frmBO = new frmBorrowOrder();
                    Form.Show(frmBO);
                    break;

                case 4:
                    //维修登记
                    frmRepairRowsSN frmR = new frmRepairRowsSN();
                    this.Form.Show(frmR);
                    break;

                case 5:
                    //报废
                    frmScrapRowsSN frmS = new frmScrapRowsSN();
                    this.Form.Show(frmS);
                    break;

                case 6:
                    //调拨
                    frmTransferRowsSN frmT = new frmTransferRowsSN();
                    this.Form.Show(frmT);
                    break;
                }
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }
Ejemplo n.º 15
0
        /// <summary>
        /// 点击ActionButton
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmAssets_ActionButtonPress(object sender, ActionButtonPressEventArgs e)
        {
            try
            {
                switch (e.Index)
                {
                case 0:         //资产新增
                    try
                    {
                        if (Client.Session["permission"].ToString() == "guest")
                        {
                            throw new Exception("对不起,您没有权限添加资产!");
                        }
                        frmAssetsCreate assetsCreate = new frmAssetsCreate();
                        Show(assetsCreate, (MobileForm sender1, object args) =>
                        {
                            if (assetsCreate.ShowResult == ShowResult.Yes)
                            {
                                Bind();
                            }
                        });
                    }
                    catch (Exception ex)
                    {
                        Toast(ex.Message);
                    }
                    break;
                //case 1:
                //    //资产复制
                //    try
                //    {
                //        //if (Client.Session["Role"].ToString() == "SMOSECUser") throw new Exception("当前用户没有权限添加资产!");
                //        if (string.IsNullOrEmpty(SelectAssId))//SelectAssId is sn
                //        {
                //            throw new Exception("请先选择资产.");
                //        }
                //        var assets = _autofacConfig.SettingService.GetAssetsBysn(SelectAssId);

                //        frmAssetsCreate assetsCreate = new frmAssetsCreate
                //        {
                //            txtAssID = { Text = assets.AssId },
                //            txtName = { Text = assets.IP },
                //            txtNUm = { Text = assets.Num },
                //            txtSN = { Text = assets.SN  },
                //            btnType = { Text = assets.TypeName + "   > ", Tag = assets.TypeId },
                //            btnBrand = { Text = assets.Brandname + "   > ", Tag = assets.Brandid },
                //            txtSpe = { Text = assets.LocationName + "   > ", Tag = assets.LocationId },
                //            txtLocation = { Text = assets.Position },
                //            txtStatus1 = { Text = Enum.GetName(typeof(STATUS), assets.Status) + "   > ", Tag = assets.Status },
                //            txtPayman1 = { Text = assets.Payman + "   > ", Tag = assets.pay_man_id },
                //            txtPro1 = { Text = assets.Project + "   > ", Tag = assets.project_id == null ? true : false},
                //            txtTeam1 = { Text = assets.Team + "   > ", Tag = assets.team_id == null ? true : false },
                //            txtRole1 = { Text = assets.Role + "   > ", Tag = assets.role_id == null ? true : false },
                //            txtUserman1 = { Text = assets.CurrentUserName + "   > ", Tag = assets.CurrentUser == null ? true : false },
                //            //txtBordate1 = null,
                //            //txtRedate1 = null,
                //            txtBordate1 = { Value = DateTime.Now },
                //            txtRedate1 = { Value = DateTime.Now },
                //            //txtBordate1 = {Value = (DateTime)assets.BorrowDate },
                //            //txtRedate1 = {Value = (DateTime)assets.BorrowDate },
                //            //txtBordate1 = { Value = (DateTime)assets.BorrowDate != null ? (DateTime)assets.BorrowDate : Convert.ToDateTime(null) },
                //            //txtRedate1 = { Value = (DateTime)assets.ReturnDate != null ? (DateTime)assets.ReturnDate : Convert.ToDateTime(null) },

                //            txtNote = { Text = assets.Note },
                //            TypeId = assets.TypeId,
                //            Brandid = assets.Brandid,
                //            LocationId = assets.LocationId,
                //            Pay_man_id = assets.pay_man_id,

                //            Project_id = assets.project_id,
                //            Role_id = assets.role_id,
                //            Team_id = assets.team_id,
                //            CurrentUser = assets.CurrentUser,


                //            //txtAssID = { Text = assets.AssId + "   > " },
                //            //txtName = { Text = assets.IP + "   > " },
                //            //txtNUm = { Text = assets.Num + " >" },
                //            //txtSN = { Text = assets.SN + "   > " },
                //            //btnType = { Tag = assets.TypeId },
                //            //btnBrand = { Tag = assets.Brandid },
                //            //txtSpe = { Tag = assets.LocationId },
                //            //txtLocation = { Text = assets.Brandname },
                //            //txtStatus1 = {  Tag = assets.Status },
                //            //txtPayman1 = { Tag = assets.pay_man_id },
                //            //txtPro1 = {  Tag = assets.project_id },
                //            //txtTeam1 = {  Tag = assets.team_id },
                //            //txtRole1 = {  Tag = assets.role_id },
                //            //txtUserman1 = {  Tag = assets.CurrentUser },
                //            //txtBordate1 = { Value = (DateTime)assets.BorrowDate },
                //            ////txtBordate1 = { Value = (DateTime)assets.BorrowDate != null ? (DateTime)assets.BorrowDate : new DateTime() },
                //            //txtRedate1 = { Value = (DateTime)assets.ReturnDate },
                //            //txtNote = { Text = assets.Note },
                //        };

                //        Show(assetsCreate, (MobileForm sender1, object args) =>
                //        {
                //            if (assetsCreate.ShowResult == ShowResult.Yes)
                //            {
                //                Bind();
                //            }

                //        });
                //    }
                //    catch (Exception ex)
                //    {
                //        Toast(ex.Message);
                //    }
                //    break;
                //case 2:
                //资产领用
                //frmCollarOrder frmCO = new frmCollarOrder();
                //Form.Show(frmCO);
                //break;
                case 1:
                    //资产借用
                    frmBorrowOrder frmBO = new frmBorrowOrder();
                    Form.Show(frmBO);
                    break;

                case 2:
                    //维修登记
                    frmRepairRowsSN frmR = new frmRepairRowsSN();
                    this.Form.Show(frmR);
                    break;
                    //case 5:
                    //    //报废
                    //    frmScrapRowsSN frmS = new frmScrapRowsSN();
                    //    this.Form.Show(frmS);
                    //    break;
                    //case 6:
                    //    //调拨
                    //    frmTransferRowsSN frmT = new frmTransferRowsSN();
                    //    this.Form.Show(frmT);
                    //    break;
                    //case 7:
                    //    try
                    //    {
                    //        if (string.IsNullOrEmpty(SelectAssId))
                    //        {
                    //            throw new Exception("请先选择资产.");
                    //        }
                    //        AssetsOutputDto outputDto = _autofacConfig.SettingService.GetAssetsBysn(SelectAssId);
                    //        PosPrinterEntityCollection Commands = new PosPrinterEntityCollection();
                    //        Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.Initial));
                    //        Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.EnabledBarcode));
                    //        Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.AbsoluteLocation));
                    //        Commands.Add(new PosPrinterBarcodeEntity(PosBarcodeType.CODE128Height, "62"));
                    //        Commands.Add(new PosPrinterBarcodeEntity(PosBarcodeType.CODE128, outputDto.SN));
                    //        Commands.Add(new PosPrinterBarcodeEntity(PosBarcodeType.CODE128, "E2000017320082231027BD"));
                    //        Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.DisabledBarcode));
                    //        Commands.Add(new PosPrinterContentEntity(System.Environment.NewLine));
                    //        Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.Cut));

                    //        posPrinter1.Print(Commands, (obj, args) =>
                    //        {
                    //            if (args.isError == true)
                    //                this.Toast("Error: " + args.error);
                    //            else
                    //                this.Toast("打印成功");
                    //        });
                    //    }
                    //    catch (Exception ex)
                    //    {
                    //        Toast(ex.Message);
                    //    }
                    //    break;
                }
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }
Ejemplo n.º 16
0
        /// <summary>
        /// 按ActionButton时
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmAssSalesOrderResult_ActionButtonPress(object sender, ActionButtonPressEventArgs e)
        {
            try
            {
                switch (e.Index)
                {
                case 0:
                    //出库
                    switch (Status)
                    {
                    case 2:
                        throw new Exception("出库已完成!");

                    case 0:
                    case 1:
                        frmAssOut frmAssOut = new frmAssOut
                        {
                            SOID     = SOID,
                            IsFromSO = true
                        };
                        Show(frmAssOut, (MobileForm sender1, object args) =>
                        {
                            if (frmAssOut.ShowResult == ShowResult.Yes)
                            {
                                Bind();
                            }
                        });
                        break;
                    }
                    break;

                case 1:
                    //退库
                    switch (Status)
                    {
                    case 0:
                        throw new Exception("未开始出库,无法退库!");

                    case 2:
                    case 1:
                        frmAssRetiring frmAssRetiring = new frmAssRetiring
                        {
                            SOID     = SOID,
                            IsFromSO = true
                        };
                        Show(frmAssRetiring, (MobileForm sender1, object args) =>
                        {
                            if (frmAssRetiring.ShowResult == ShowResult.Yes)
                            {
                                Bind();
                            }
                        });
                        break;
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }
Ejemplo n.º 17
0
        /// <summary>
        /// 点击ActionButton
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmAssInventoryResult_ActionButtonPress(object sender, ActionButtonPressEventArgs e)
        {
            try
            {
                ReturnInfo rInfo = new ReturnInfo();
                switch (e.Index)
                {
                case 0:
                    //上传结果
                    AssInventoryInputDto inputDto = new AssInventoryInputDto
                    {
                        IID           = IID,
                        IsEnd         = false,
                        AssDictionary = assDictionary
                    };
                    inputDto.IsEnd = false;
                    rInfo          = _autofacConfig.AssInventoryService.UpdateInventory(inputDto);
                    Toast(rInfo.IsSuccess ? "上传结果成功." : rInfo.ErrorInfo);
                    break;

                case 1:
                    //盘点结束
                    Dictionary <string, int> assDictionary2 = new Dictionary <string, int>();
                    foreach (var key in assDictionary.Keys)
                    {
                        if (assDictionary[key] == (int)ResultStatus.待盘点)
                        {
                            assDictionary2.Add(key, (int)ResultStatus.盘亏);
                        }
                        else
                        {
                            assDictionary2.Add(key, assDictionary[key]);
                        }
                    }


                    AssInventoryInputDto inputDto2 = new AssInventoryInputDto
                    {
                        IID           = IID,
                        IsEnd         = false,
                        AssDictionary = assDictionary2
                    };
                    inputDto2.IsEnd = true;
                    rInfo           = _autofacConfig.AssInventoryService.UpdateInventory(inputDto2);
                    if (rInfo.IsSuccess)
                    {
                        ShowResult = ShowResult.Yes;
                        Close();
                        Toast("盘点结束成功.");
                    }
                    else
                    {
                        Toast(rInfo.ErrorInfo);
                    }
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }
Ejemplo n.º 18
0
        /// <summary>
        /// 点击ActionButton
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmAssTemplate_ActionButtonPress(object sender, ActionButtonPressEventArgs e)
        {
            try
            {
                switch (e.Index)
                {
                case 0:         //模板新增
                    try
                    {
                        frmAssTemplateCreate assTemplateCreate = new frmAssTemplateCreate();
                        Show(assTemplateCreate, (MobileForm sender1, object args) =>
                        {
                            if (assTemplateCreate.ShowResult == ShowResult.Yes)
                            {
                                Bind();
                            }
                        }
                             );
                    }
                    catch (Exception ex)
                    {
                        Toast(ex.Message);
                    }
                    break;

                case 1:
                    //模板复制
                    try
                    {
                        if (string.IsNullOrEmpty(SelectTemplateId))
                        {
                            throw new Exception("请先选择模板.");
                        }
                        var assTemplate = _autofacConfig.SettingService.GetAtbyId(SelectTemplateId);

                        frmAssTemplateCreate assTemplateCreate = new frmAssTemplateCreate
                        {
                            ImgPicture = { ResourceID = assTemplate.IMAGE },
                            txtName    = { Text = assTemplate.NAME },
                            txtNote    = { Text = assTemplate.NOTE },
                            txtPrice   = { Text = assTemplate.PRICE.ToString() },
                            txtSpe     = { Text = assTemplate.SPECIFICATION },
                            btnType    = { Text = assTemplate.TYPEID, Tag = assTemplate.TYPEID },
                            txtUnit    = { Text = assTemplate.UNIT },
                            txtVendor  = { Text = assTemplate.VENDOR }
                        };

                        Show(assTemplateCreate, (MobileForm sender1, object args) =>
                        {
                            if (assTemplateCreate.ShowResult == ShowResult.Yes)
                            {
                                Bind();
                            }
                        }
                             );
                    }
                    catch (Exception ex)
                    {
                        Toast(ex.Message);
                    }
                    break;

                case 2:
                    //打印标签
                    try
                    {
                        if (string.IsNullOrEmpty(SelectTemplateId))
                        {
                            throw new Exception("请先选择模板.");
                        }
                        AssTemplate outputDto = _autofacConfig.SettingService.GetAtbyId(SelectTemplateId);
                        PosPrinterEntityCollection Commands = new PosPrinterEntityCollection();
                        Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.Initial));
                        Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.EnabledBarcode));
                        Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.AbsoluteLocation));
                        Commands.Add(new PosPrinterBarcodeEntity(PosBarcodeType.CODE128Height, "62"));
                        Commands.Add(new PosPrinterBarcodeEntity(PosBarcodeType.CODE128, outputDto.TEMPLATEID));
                        //Commands.Add(new PosPrinterBarcodeEntity(PosBarcodeType.CODE128, "E2000017320082231027BD"));
                        Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.DisabledBarcode));
                        Commands.Add(new PosPrinterContentEntity(System.Environment.NewLine));
                        Commands.Add(new PosPrinterProtocolEntity(PosPrinterProtocol.Cut));

                        posPrinter1.Print(Commands, (obj, args) =>
                        {
                            if (args.isError == true)
                            {
                                this.Toast("Error: " + args.error);
                            }
                            else
                            {
                                this.Toast("打印成功");
                            }
                        });
                    }
                    catch (Exception ex)
                    {
                        Toast(ex.Message);
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }