Example #1
0
        public Get_OutDeleteGoodsCodeRange Delete(string data)
        {
            Get_InDeleteGoodsCodeRange  model = null;
            Get_OutDeleteGoodsCodeRange json  = new Get_OutDeleteGoodsCodeRange();

            try
            {
                model = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InDeleteGoodsCodeRange>(data);

                if (db.DeleteGoodsCodeRange(model.rangeGUID))
                {
                    json.result    = "0";
                    json.resultStr = "返回成功,成功删除一条数据!";
                }
                else
                {
                    json.result    = "0";
                    json.resultStr = "执行成功,返回0条数据!";
                }
            }
            catch (Exception ex)
            {
                json.result    = "1";
                json.resultStr = "提交失败:" + ex.Message;
            }
            return(json);
        }
Example #2
0
        public void DeleteGoodsCodeRangeTest()
        {
            // string ConnectionString = string.Empty; // TODO: 初始化为适当的值

            // ConnectionString = DatabaseSetup.GetConnectionStringsConfig("MyCon");// DatabaseSetup.CONNTXT.Connection.ConnectionString;// "Data Source=192.168.1.166;Initial Catalog=goodtestdb;User ID=sa;PassWord=Think123";
            DBLendingManager target    = new DBLendingManager(connstr); // TODO: 初始化为适当的值
            string           rangeGUID = string.Empty;                  // TODO: 初始化为适当的值
            bool             expected  = true;                          // TODO: 初始化为适当的值
            bool             actual;
            string           strguid = "867F086C-AF3C-4D88-88A4-63C85729F820";

            actual = target.DeleteGoodsCodeRange(strguid);

            ////  var sqlHelperMock = new Mock<LendingManagerInterface>();
            //sqlHelperMock.Setup(x => x.DeleteGoodsCodeRange(strguid)).Returns(true);
            //actual= sqlHelperMock.Object.DeleteGoodsCodeRange(strguid);

            Assert.AreEqual(expected, actual);

            // Assert.Inconclusive("验证此测试方法的正确性。");
        }