Exemple #1
0
        public List <Rcbp1> Get_Rcbp1_SpsList(Rcbp request)
        {
            List <Rcbp1> Result = null;

            try
            {
                using (var db = DbConnectionFactory.OpenDbConnection())
                {
                    int    count    = int.Parse(request.RecordCount);
                    string strWhere = "";
                    if (!string.IsNullOrEmpty(request.BusinessPartyName))
                    {
                        strWhere = " Where PartyType='CL' And BusinessPartyName LIKE '" + request.BusinessPartyName + "%'";
                    }
                    string strSelect = "SELECT " +
                                       "r1.*, (Select Top 1 CountryName From Rccy1 Where CountryCode=r1.CountryCode) AS CountryName " +
                                       "FROM Rcbp1 r1," +
                                       "(SELECT TOP " + (count + 20) + " row_number() OVER (ORDER BY BusinessPartyName ASC) n, TrxNo FROM Rcbp1 " + strWhere + ") r2 " +
                                       "WHERE r1.TrxNo = r2.TrxNo AND r2.n > " + count;
                    string strOrderBy = " ORDER BY r2.n ASC";
                    string strSQL     = strSelect + strOrderBy;
                    Result = db.Select <Rcbp1>(strSQL);
                }
            }
            catch { throw; }
            return(Result);
        }
Exemple #2
0
        public List <Rcbp1> Get_Rcbp1_List(Rcbp request)
        {
            List <Rcbp1> Result = null;

            try
            {
                using (var db = DbConnectionFactory.OpenDbConnection())
                {
                    if (!string.IsNullOrEmpty(request.BusinessPartyName))
                    {
                        string strSQL = "Select Top 10 *,(Select Top 1 CountryName From Rccy1 Where CountryCode=Rcbp1.CountryCode) AS CountryName From Rcbp1 Where IsNUll(StatusCode,'')<>'DEL' And BusinessPartyName LIKE '" + request.BusinessPartyName + "%' Order By BusinessPartyCode Asc";
                        Result = db.Select <Rcbp1>(strSQL);
                    }
                    else if (!string.IsNullOrEmpty(request.TrxNo))
                    {
                        string strSQL = "Select top 1 *,(Select Top 1 CountryName From Rccy1 Where CountryCode=Rcbp1.CountryCode) AS CountryName From Rcbp1 Where IsNUll(StatusCode,'')<>'DEL' And TrxNo=" + int.Parse(request.TrxNo);
                        Result = db.Select <Rcbp1>(strSQL);
                    }
                    //else
                    //{
                    //				string strSQL = "Select Top 10 *,(Select Top 1 CountryName From Rccy1 Where CountryCode=Rcbp1.CountryCode) AS CountryName From Rcbp1 Where IsNUll(StatusCode,'')<>'DEL' Order By BusinessPartyName Asc";
                    //				Result = db.Select<Rcbp1>(strSQL);
                    //}
                }
            }
            catch { throw; }
            return(Result);
        }
Exemple #3
0
        public List <Rcdg1> Get_Rcdg1UnNo_List(Rcbp request)
        {
            List <Rcdg1> Result = null;

            try
            {
                using (var db = DbConnectionFactory.OpenDbConnection("WMS"))
                {
                    if (!string.IsNullOrEmpty(request.UnNo))
                    {
                        if (request.UnNoFlag == "Y")
                        {
                            string strSQL = "Select UnNo,DGClass,DGDescription  From Rcdg1 Where UnNo = '" + request.UnNo + "' ";
                            Result = db.Select <Rcdg1>(strSQL);
                        }
                        else
                        {
                            string strSQL = "Select UnNo,DGClass,DGDescription  From Rcdg1 Where UnNo LIKE '" + request.UnNo + "%'  Order By UnNo Asc";
                            Result = db.Select <Rcdg1>(strSQL);
                        }
                    }
                    else
                    {
                        Result = null;
                    }
                }
            }
            catch { throw; }
            return(Result);
        }
Exemple #4
0
        public List <Rcbp1> Get_Rcbp1_List(Rcbp request)
        {
            List <Rcbp1> Result = null;

            try
            {
                using (var db = DbConnectionFactory.OpenDbConnection("WMS"))
                {
                    if (!string.IsNullOrEmpty(request.BusinessPartyName))
                    {
                        string strSQL = "Select   Address1 , Address2,Address3 ,Address4 ,BusinessPartyCode, BusinessPartyName, StatusCode  From Rcbp1 Where StatusCode = 'USE' And BusinessPartyName LIKE '" + request.BusinessPartyName + "%'  Order By BusinessPartyCode Asc";
                        Result = db.Select <Rcbp1>(strSQL);
                    }
                    else if (!string.IsNullOrEmpty(request.BusinessPartyCode))
                    {
                        string strSQL = "Select  Address1 , Address2,Address3 ,Address4 , BusinessPartyCode, BusinessPartyName, StatusCode  From Rcbp1 Where StatusCode = 'USE' And BusinessPartyCode LIKE '" + request.BusinessPartyCode + "%'  Order By BusinessPartyCode Asc";
                        Result = db.Select <Rcbp1>(strSQL);
                    }
                    else
                    {
                        Result = null;
                    }
                }
            }
            catch { throw; }
            return(Result);
        }
Exemple #5
0
        public List <Rcbp1> Get_Rcbp1_All(Rcbp request)
        {
            List <Rcbp1> Result = null;

            try
            {
                using (var db = DbConnectionFactory.OpenDbConnection("WMS"))
                {
                    string strSQL = "Select ISNULL(BusinessPartyCode,'') AS BusinessPartyCode   From Rcbp1 Where PartyType = 'TR' And  BusinessPartyCode !=''";
                    Result = db.Select <Rcbp1>(strSQL);
                }
            }
            catch { throw; }
            return(Result);
        }
Exemple #6
0
 public List<Rcbp1> Get_Rcbp1_List(Rcbp request)
  {
     List<Rcbp1> Result = null;
     try
     {
         using (var db = DbConnectionFactory.OpenDbConnection("WMS"))
         {
             if (!string.IsNullOrEmpty(request.UserDefine01))
             {
                 string strSQL = "Select Top 10 * From imgr1 Where IsNUll(StatusCode,'')<>'DEL' And UserDefine01 LIKE '" + request.UserDefine01 + "%' Order By UserDefine01 Asc";
                 Result = db.Select<Rcbp1>(strSQL);
             }
            
         }
     }
     catch { throw; }
     return Result;
 }