Example #1
0
        public void SendLendingInfoTest()
        {
            // string ConnectionString = string.Empty; // TODO: 初始化为适当的值
            DBLendingInfoDetail target = new DBLendingInfoDetail(connstr); // TODO: 初始化为适当的值
            string TrainmanGUID        = string.Empty;                     // TODO: 初始化为适当的值
            string remark = string.Empty;                                  // TODO: 初始化为适当的值
            List <LendingInfoDetail> lifd = null;                          // TODO: 初始化为适当的值

            lifd = new List <LendingInfoDetail>();
            LendingInfoDetail lendinfo = new LendingInfoDetail();

            //定义他的值
            TrainmanGUID               = "08809D42-3B1C-4318-B818-756A7ED04300";
            lendinfo.dtBorrwoTime      = DateTime.Now;
            lendinfo.nBorrowVerifyType = 1;

            lendinfo.strTrainmanGUID    = TrainmanGUID;
            lendinfo.strLenderGUID      = "02517596-577B-4A0C-9E7F-A8C1AA35888E";
            lendinfo.strLendingInfoGUID = Guid.NewGuid().ToString();
            lendinfo.nLendingType       = 1;
            lendinfo.strLendingExInfo   = 450;
            lendinfo.nReturnState       = 0;
            lendinfo.dtModifyTime       = DateTime.Now;

            lifd.Add(lendinfo);
            target.SendLendingInfo(TrainmanGUID, remark, lifd);
            Assert.IsNotNull(lifd);
            // Assert.Inconclusive("无法验证不返回值的方法。");
        }
Example #2
0
        /// <summary>
        ///GetTrainmanNotReturnLendingInfo_DRToModelDTToList 的测试
        ///</summary>
        // [Test]
        public void GetTrainmanNotReturnLendingInfo_DRToModelDTToListTest()
        {
            // string ConnectionString = string.Empty; // TODO: 初始化为适当的值
            DBLendingInfoDetail target   = new DBLendingInfoDetail(connstr); // TODO: 初始化为适当的值
            DataRow             dr       = null;                             // TODO: 初始化为适当的值
            LendingInfoDetail   expected = null;                             // TODO: 初始化为适当的值
            LendingInfoDetail   actual;

            actual = target.GetTrainmanNotReturnLendingInfo_DRToModelDTToList(dr);
            Assert.AreEqual(expected, actual);
            // Assert.Inconclusive("验证此测试方法的正确性。");
        }
Example #3
0
        public bool CheckLendAble(LendingInfoDetail lifd, string strWorkShop)
        {
            if (lifd.strLendingExInfo == 0)
            {
                return(true);
            }
            string strSQL = "select TAB_LendingDetail.nid,TAB_Org_Trainman.strWorkShopGUID ";

            strSQL += " from TAB_LendingDetail Left Join TAB_Org_Trainman On ";
            strSQL += " TAB_LendingDetail.strBorrowTrainmanGUID = Tab_Org_Trainman.strTrainmanGUID ";
            strSQL += " where strWorkShopGUID = '" + strWorkShop + "' and strLendingExInfo = " + lifd.strLendingExInfo + " and nReturnState = 0 and nLendingType = " + lifd.nLendingType + "";
            return(SqlHelper.ExecuteDataset(ConnectionString, CommandType.Text, strSQL.ToString()).Tables[0].Rows.Count > 0);
        }
Example #4
0
        public void GiveBackDetailTest()
        {
            //   string ConnectionString = string.Empty; // TODO: 初始化为适当的值
            DBLendingInfoDetail      target = new DBLendingInfoDetail(connstr); // TODO: 初始化为适当的值
            List <LendingInfoDetail> lifd   = null;                             // TODO: 初始化为适当的值

            lifd = new List <LendingInfoDetail>();
            LendingInfoDetail l = new LendingInfoDetail();

            l.nGiveBackVerifyType     = 0;
            l.strGiveBackTrainmanGUID = "55E0BDC7-CCD4-4979-BA69-D890F814F08D";
            l.strGUID = "25416FBC-35E7-40E4-B881-6C2314D4C08D";
            lifd.Add(l);
            target.GiveBackDetail(lifd);
            Assert.IsNotNull(lifd);
            // Assert.Inconclusive("无法验证不返回值的方法。");
        }
Example #5
0
        public bool CheckReturnAble(string TrainmanGUID, LendingInfoDetail lifd)
        {
            string strSQL = "select * from View_LendingInfoDetail where strBorrowTrainmanGUID =  ";

            strSQL += " '" + TrainmanGUID + "' and nReturnState = 0 and nLendingType = " + lifd.nLendingType + " and strLendingExInfo = " + lifd.strLendingExInfo + " ";
            DataTable dt = SqlHelper.ExecuteDataset(ConnectionString, CommandType.Text, strSQL.ToString()).Tables[0];

            if (dt.Rows.Count > 0)
            {
                lifd.strGUID            = dt.Rows[0]["strGUID"].ToString();
                lifd.strLendingInfoGUID = dt.Rows[0]["strLendingInfoGUID"].ToString();
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #6
0
        public void CheckLendAbleTest()
        {
            //  string ConnectionString = string.Empty; // TODO: 初始化为适当的值
            DBLendingInfoDetail target   = new DBLendingInfoDetail(connstr); // TODO: 初始化为适当的值
            LendingInfoDetail   newmodel = null;                             // TODO: 初始化为适当的值

            string strWorkShop = string.Empty;                               // TODO: 初始化为适当的值

            strWorkShop                        = "3b50bf66-dabb-48c0-8b6d-05db80591090";
            newmodel                           = new LendingInfoDetail();
            newmodel.dtBorrwoTime              = DateTime.Today;
            newmodel.dtModifyTime              = DateTime.Today;
            newmodel.nBorrowVerifyType         = 0;
            newmodel.nKeepMunites              = 20;
            newmodel.nLendingType              = 0;
            newmodel.nReturnState              = 1;
            newmodel.strBorrowVerifyTypeName   = "1";
            newmodel.strGiveBackTrainmanGUID   = "08809D42-3B1C-4318-B818-756A7ED04300";
            newmodel.strGiveBackTrainmanName   = "张勇";
            newmodel.strGiveBackTrainmanNumber = "2300679";
            newmodel.strGiveBackVerifyTypeName = "1";
            newmodel.strGUID                   = Guid.NewGuid().ToString();
            newmodel.strLenderGUID             = "";
            newmodel.strLenderName             = "";
            newmodel.strLenderNumber           = "";
            newmodel.strLendingExInfo          = 420;
            newmodel.strLendingInfoGUID        = "";
            newmodel.strLendingTypeAlias       = "";
            newmodel.strLendingTypeName        = "";
            newmodel.strStateName              = "";
            newmodel.strTrainmanGUID           = "08809D42-3B1C-4318-B818-756A7ED04300";
            newmodel.strTrainmanName           = "张勇";
            newmodel.strTrainmanNumber         = "2300679";
            newmodel.strWorkShopGUID           = "3b50bf66-dabb-48c0-8b6d-05db80591090";
            strWorkShop                        = "3b50bf66-dabb-48c0-8b6d-05db80591090";
            bool expected = true; // TODO: 初始化为适当的值
            bool actual;

            actual = target.CheckLendAble(newmodel, strWorkShop);
            Assert.AreEqual(expected, actual);
            // Assert.Inconclusive("验证此测试方法的正确性。");
        }
Example #7
0
        public void AddLendingDetailsTest()
        {
            //  string ConnectionString = string.Empty; // TODO: 初始化为适当的值
            DBLendingInfoDetail      target = new DBLendingInfoDetail(connstr); // TODO: 初始化为适当的值
            List <LendingInfoDetail> lifd   = null;                             // TODO: 初始化为适当的值

            lifd = new List <LendingInfoDetail>();
            LendingInfoDetail newmodel = new LendingInfoDetail();

            newmodel.dtBorrwoTime              = DateTime.Today;
            newmodel.dtModifyTime              = DateTime.Today;
            newmodel.nBorrowVerifyType         = 0;
            newmodel.nKeepMunites              = 20;
            newmodel.nLendingType              = 0;
            newmodel.nReturnState              = 1;
            newmodel.strBorrowVerifyTypeName   = "1";
            newmodel.strGiveBackTrainmanGUID   = "08809D42-3B1C-4318-B818-756A7ED04300";
            newmodel.strGiveBackTrainmanName   = "张勇";
            newmodel.strGiveBackTrainmanNumber = "2300679";
            newmodel.strGiveBackVerifyTypeName = "1";
            newmodel.strGUID             = Guid.NewGuid().ToString();
            newmodel.strLenderGUID       = "";
            newmodel.strLenderName       = "";
            newmodel.strLenderNumber     = "";
            newmodel.strLendingExInfo    = 420;
            newmodel.strLendingInfoGUID  = "";
            newmodel.strLendingTypeAlias = "";
            newmodel.strLendingTypeName  = "";
            newmodel.strStateName        = "";
            newmodel.strTrainmanGUID     = "08809D42-3B1C-4318-B818-756A7ED04300";
            newmodel.strTrainmanName     = "张勇";
            newmodel.strTrainmanNumber   = "2300679";
            newmodel.strWorkShopGUID     = "3b50bf66-dabb-48c0-8b6d-05db80591090";
            lifd.Add(newmodel);
            target.AddLendingDetails(lifd);

            Assert.IsNotNull(lifd);
            //Assert.Inconclusive("无法验证不返回值的方法。");
        }
Example #8
0
        public LendingInfoDetail GetTrainmanNotReturnLendingInfo_DRToModelDTToList(DataRow dr)
        {
            LendingInfoDetail model = new LendingInfoDetail();

            if (dr != null)
            {
                model.strLendingInfoGUID = ObjectConvertClass.static_ext_string(dr["strLendingInfoGUID"]);
                model.nLendingType       = ObjectConvertClass.static_ext_int(dr["nLendingType"]);
                model.strLendingExInfo   = ObjectConvertClass.static_ext_int(dr["strLendingExInfo"]);
                model.nReturnState       = ObjectConvertClass.static_ext_int(dr["nReturnState"]);
                model.dtModifyTime       = ObjectConvertClass.static_ext_date(dr["dtModifyTime"]);
                model.strGUID            = ObjectConvertClass.static_ext_string(dr["strGUID"]);
                model.nID                       = ObjectConvertClass.static_ext_int(dr["nID"]);
                model.dtBorrwoTime              = ObjectConvertClass.static_ext_date(dr["dtBorrowTime"]);
                model.dtGiveBackTime            = ObjectConvertClass.static_ext_date(dr["dtGiveBackTime"]);
                model.nBorrowVerifyType         = ObjectConvertClass.static_ext_int(dr["nBorrowLoginType"]);
                model.nGiveBackVerifyType       = ObjectConvertClass.static_ext_int(dr["nGiveBackLoginType"]);
                model.strLenderGUID             = ObjectConvertClass.static_ext_string(dr["strLenderGUID"]);
                model.strTrainmanGUID           = ObjectConvertClass.static_ext_string(dr["strBorrowTrainmanGUID"]);
                model.strGiveBackTrainmanGUID   = ObjectConvertClass.static_ext_string(dr["strGiveBackTrainmanGUID"]);
                model.strTrainmanNumber         = ObjectConvertClass.static_ext_string(dr["strBorrowTrainmanNumber"]);
                model.strTrainmanName           = ObjectConvertClass.static_ext_string(dr["strBorrowTrainmanName"]);
                model.strLenderNumber           = ObjectConvertClass.static_ext_string(dr["strLenderNumber"]);
                model.strLenderName             = ObjectConvertClass.static_ext_string(dr["strLenderName"]);
                model.strGiveBackTrainmanNumber = ObjectConvertClass.static_ext_string(dr["strGiveBackTrainmanNumber"]);
                model.strGiveBackTrainmanName   = ObjectConvertClass.static_ext_string(dr["strGiveBackTrainmanName"]);
                model.strBorrowVerifyTypeName   = ObjectConvertClass.static_ext_string(dr["strBorrowLoginTypeName"]);
                model.strGiveBackVerifyTypeName = ObjectConvertClass.static_ext_string(dr["strGiveBackLoginTypeName"]);
                model.strLendingTypeName        = ObjectConvertClass.static_ext_string(dr["strLendingTypeName"]);
                model.strLendingTypeAlias       = ObjectConvertClass.static_ext_string(dr["strAlias"]);
                model.strStateName              = ObjectConvertClass.static_ext_string(dr["strStateName"]);
                model.nKeepMunites              = ObjectConvertClass.static_ext_int(dr["nMinutes"]);
                model.strWorkShopGUID           = ObjectConvertClass.static_ext_string(dr["strWorkShopGUID"]);
            }
            return(model);
        }