Esempio n. 1
0
        public List <Todr1_Rcbp1> LoginCheck(Tms_Login request)
        {
            List <Todr1_Rcbp1> Result = null;

            try
            {
                using (var db = DbConnectionFactory.OpenDbConnection("TMS"))
                {
                    string strSql = "";
                    if (request.DriverCode != null && request.DriverCode.Length > 0)

                    {
                        strSql = "Select isnull(DriverCode,'') as  DriverCode   From Todr1 Where DriverCode='" + request.DriverCode + "' ";
                        Result = db.Select <Todr1_Rcbp1>(strSql);
                    }
                    else if (request.BusinessPartyCode != null && request.BusinessPartyCode.Length > 0 && request.PassWord != null && request.PassWord.Length > 0)
                    {
                        strSql = "Select isnull(BusinessPartyCode,'') as  BusinessPartyCode ,isnull(PassWord,'') as  PassWord From Rcbp1 Where BusinessPartyCode='" + request.BusinessPartyCode + "' And PassWord ='******' ";
                        Result = db.Select <Todr1_Rcbp1>(strSql);
                    }
                }
            }
            catch { throw; }
            return(Result);
        }
Esempio n. 2
0
        public List <Todr1> LoginCheck(Tms_Login request)
        {
            //int Result = -1; //20160511 注释
            //try
            //{
            //    using (var db = DbConnectionFactory.OpenDbConnection("TMS"))
            //    {
            //        string strSql = "Select count(*) From Saus1 Where UserId='" + request.UserId + "' And Password="******"'" + request.Password + "'";
            //        }
            //        else
            //        {
            //            strSql = strSql + "'" + request.Md5Stamp + "'";
            //        }
            //        Result = db.Scalar<int>(strSql);
            //    }
            //}
            //catch { throw; }
            //return Result;

            List <Todr1> Result = null;    //20160511

            try
            {
                using (var db = DbConnectionFactory.OpenDbConnection("TMS"))
                {
                    //if (request.ContactNo != null && request.ContactNo.Length > 0)    ///20160627 update login logic  DriverCode
                    //{
                    //    string strSql = "Select count(*) From Todr1 Where ContactNo1='" + request.ContactNo + "' ";
                    //    Result = db.Scalar<int>(strSql);
                    //    if (Result < 1)
                    //    {
                    //        strSql = "Select count(*) From Todr1 Where ContactNo2='" + request.ContactNo + "' ";
                    //        Result = db.Scalar<int>(strSql);
                    //        BlnContactNo = false;
                    //    }
                    //    else
                    //    {
                    //        BlnContactNo = true;
                    //    }
                    //}


                    if (request.DriverCode != null && request.DriverCode.Length > 0)
                    {
                        string strSql = "Select isnull(DriverName,'') as  DriverName From Todr1 Where DriverCode='" + request.DriverCode + "' ";
                        Result = db.Select <Todr1>(strSql);
                    }
                }
            }
            catch { throw; }
            return(Result);
        }
Esempio n. 3
0
        public int LoginCheck(Tms_Login request)
        {
            //int Result = -1; //20160511 注释
            //try
            //{
            //    using (var db = DbConnectionFactory.OpenDbConnection("TMS"))
            //    {
            //        string strSql = "Select count(*) From Saus1 Where UserId='" + request.UserId + "' And Password="******"'" + request.Password + "'";
            //        }
            //        else
            //        {
            //            strSql = strSql + "'" + request.Md5Stamp + "'";
            //        }
            //        Result = db.Scalar<int>(strSql);
            //    }
            //}
            //catch { throw; }
            //return Result;

            int Result = -1;    //20160511

            try
            {
                using (var db = DbConnectionFactory.OpenDbConnection("TMS"))
                {
                    if (request.ContactNo != null && request.ContactNo.Length > 0)
                    {
                        string strSql = "Select count(*) From Todr1 Where ContactNo1='" + request.ContactNo + "' ";
                        Result = db.Scalar <int>(strSql);
                        if (Result < 1)
                        {
                            strSql       = "Select count(*) From Todr1 Where ContactNo2='" + request.ContactNo + "' ";
                            Result       = db.Scalar <int>(strSql);
                            BlnContactNo = false;
                        }
                        else
                        {
                            BlnContactNo = true;
                        }
                    }
                }
            }
            catch { throw; }
            return(Result);
        }
Esempio n. 4
0
        public int LoginCheck(Tms_Login request)
        {
            int Result = -1;

            try
            {
                using (var db = DbConnectionFactory.OpenDbConnection("WMS"))
                {
                    Result = db.Scalar <int>(
                        "Select count(*) From Saus1 Where UserId={0} And Password={1}",
                        request.UserId, request.Password
                        );
                }
            }
            catch { throw; }
            return(Result);
        }
Esempio n. 5
0
        public List <Todr1> LoginCheck(Tms_Login request)
        {
            List <Todr1> Result = null;;    //20160511

            try
            {
                using (var db = DbConnectionFactory.OpenDbConnection("TMS"))
                {
                    if (request.DriverCode != null && request.DriverCode.Length > 0)
                    {
                        string strSql = "Select isnull(DriverName,'') as  DriverName ,isnull(VehicleNo,'') as  VehicleNo From Todr1 Where DriverCode='" + request.DriverCode + "' ";
                        Result = db.Select <Todr1>(strSql);
                    }
                }
            }
            catch { throw; }
            return(Result);
        }
Esempio n. 6
0
        public List <Todr1> GetTodr1(Tms_Login request)       //20160511
        {
            List <Todr1> Result = null;

            try
            {
                using (var db = DbConnectionFactory.OpenDbConnection("TMS"))
                {
                    var strSQL = "";
                    if (BlnContactNo == false)
                    {
                        strSQL = "select isnull(DriverCode,'') as  DriverCode,isnull(DriverName,'') as  DriverName from todr1 where ContactNo2=" + Modfunction.SQLSafeValue(request.ContactNo);
                        Result = db.Select <Todr1>(strSQL);
                    }
                    else
                    {
                        strSQL = "select isnull(DriverCode,'') as  DriverCode,isnull(DriverName,'') as  DriverName from todr1 where ContactNo1=" + Modfunction.SQLSafeValue(request.ContactNo);
                        Result = db.Select <Todr1>(strSQL);
                    }
                }
            }
            catch { throw; }
            return(Result);
        }