Ejemplo n.º 1
0
        public void BindProductWithDistributor(string qrCodeId, string productNameId, string distributorId)
        {
            QrCodeModel      qrCodeModel = qrCodeService.FindById(qrCodeId);
            ProductModel     product     = productService.FindById(productNameId);
            DistributorModel distributor = distributorService.FindById(distributorId);

            qrCodeModel.Distributor = distributor;
            qrCodeModel.Product     = product;
            qrCodeService.Update(qrCodeModel);
        }
        public static void BindProductToDistributorWithQrCode(string qrCode, string productName, string distributorName)
        {
            QrCodeModel      qrCodeModel = qrCodeService.FindById(qrCode);
            ProductModel     product     = productService.FindById(productName);
            DistributorModel distributor = distributorService.FindById(distributorName);

            qrCodeModel.Distributor = distributor;
            qrCodeModel.Product     = product;
            qrCodeService.Update(qrCodeModel);
        }
Ejemplo n.º 3
0
        public void TestBindingService()
        {
            string           qrcode           = "http://192.168.1.101:8080/qrcode-manage/0";
            string           distributorName  = "河北";
            string           productName      = "咳咳音乐";
            QrCodeModel      qrcodeModel      = qrcodeService.FindById(qrcode);
            DistributorModel distributorModel = distributorService.FindById(distributorName);
            ProductModel     productModel     = productService.FindById(productName);

            qrcodeModel.Distributor = distributorModel;
            qrcodeModel.Product     = productModel;

            qrcodeService.Add(qrcodeModel);
        }