示例#1
0
        /// <summary>
        /// 复制资产数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCopy_Press(object sender, EventArgs e)
        {
            try
            {
                frmAssetsCreate assetsCreate = new frmAssetsCreate
                {
                    DatePickerBuy    = { Value = Convert.ToDateTime(txtBuyDate.Text) },
                    DepId            = DepId,
                    btnDep           = { Text = txtDep.Text + "   > " },
                    DatePickerExpiry = { Value = Convert.ToDateTime(txtEDate.Text) },
                    ImgPicture       = { ResourceID = image2.ResourceID },
                    LocationId       = LocationId,
                    btnLocation      = { Text = txtLocation1.Text },
                    ManagerId        = ManagerId,
                    txtManager       = { Text = txtManager.Text },
                    txtName          = { Text = txtName1.Text },
                    txtNote          = { Text = txtNote1.Text },
                    txtPlace         = { Text = txtPlace1.Text },
                    txtPrice         = { Text = txtPrice1.Text },
                    txtSpe           = { Text = txtSPE1.Text },
                    btnType          = { Tag = TypeId, Text = txtType.Text },
                    txtUnit          = { Text = txtUnit1.Text },
                    txtVendor        = { Text = txtVendor1.Text }
                };



                Show(assetsCreate);
                Close();
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }
示例#2
0
        private void btnCopy_Press(object sender, EventArgs e)
        {
            try
            {
                frmAssetsCreate assetsCreate = new frmAssetsCreate
                {
                    DatePickerBuy    = { Value = DatePickerBuy.Value },
                    txtDepart        = { Text = txtDep.Text },
                    DatePickerExpiry = { Value = DatePickerExpiry.Value },
                    ImgPicture       = { ResourceID = ImgPicture.ResourceID },
                    LocationId       = LocationId,
                    btnLocation      = { Text = txtLocation1.Text },
                    ManagerId        = ManagerId,
                    txtManager       = { Text = txtManager.Text },
                    txtName          = { Text = txtName.Text },
                    txtNote          = { Text = txtNote.Text },
                    txtPlace         = { Text = txtPlace.Text },
                    txtPrice         = { Text = txtPrice.Text },
                    txtSpe           = { Text = txtSpe.Text },
                    TypeId           = TypeId,
                    btnType          = { Text = txtType.Text },
                    txtUnit          = { Text = txtUnit.Text },
                    txtVendor        = { Text = txtVendor.Text }
//                    txtSN = {Text = txtVendor.Text}
                };
                //                CreateUser = UserId,
//                CurrentUser = "",
                //                assetsInputDto.LocationId = LocationId;
                //                ModifyUser = UserId,


                //                assetsInputDto.TypeId = TypeId;


                Show(assetsCreate);
                Close();
//                Show(assetsCreate, (MobileForm sender1, object args) =>
//                {
//                    if (assetsCreate.ShowResult == ShowResult.Yes)
//                    {
//                        ShowResult = ShowResult.Yes;
//                        Bind();
//                    }
//                });
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }
示例#3
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);
            }
        }
示例#4
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);
            }
        }
示例#5
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);
            }
        }