예제 #1
0
        public List <P_QuotationVO> GetQuotationList(string accountId, QuotationQueryVO query)
        {
            var mfDO = LFFK.DataManager.TableQuery <UserDO>().Select().From().Where(p => p.UserId == accountId).Execute();

            if (mfDO != null && mfDO.UserType == 2 && mfDO.TargetId > 0)
            {
                var cpVo = LFFK.DataManager.TableQuery <CarPartsDO>()
                           .Select(p => p.MainServices, p => p.Alliance, p => p.CarPartsId).From().Where(p => p.CarPartsId == mfDO.TargetId).Execute();
                if (cpVo != null && !String.IsNullOrEmpty(cpVo.MainServices))
                {
                    var sql = String.Format(DAConstants.Sql_Select_QuotationList, mfDO.TargetId, cpVo.Alliance, cpVo.MainServices);
                    if (query.InquiryId > 0)
                    {
                        sql += String.Format(DAConstants.Sql_Select_QuotationList_Cond_InqId, query.InquiryId);
                    }
                    else
                    {
                        if (query.State > -99)
                        {
                            if (query.State == 0)
                            {
                                sql += DAConstants.Sql_Select_QuotationList_Cond_State0;
                            }
                            else if (query.State == 0)
                            {
                                sql += DAConstants.Sql_Select_QuotationList_Cond_State1;
                            }
                        }
                        if (query.QuoteStartDate > DateTime.MinValue)
                        {
                            sql += String.Format(DAConstants.Sql_Select_InquiryList_Cond_StartDate, DateHelper.ConvertToString(query.QuoteStartDate, DateType.Day));
                        }
                        if (query.QuoteEndDate > DateTime.MinValue)
                        {
                            sql += String.Format(DAConstants.Sql_Select_InquiryList_Cond_EndDate, DateHelper.ConvertToString(query.QuoteEndDate, DateType.Day));
                        }
                        if (!string.IsNullOrEmpty(query.PartsName))
                        {
                            sql += String.Format(DAConstants.Sql_Select_QuotationList_Cond_PartsName, query.PartsName);
                        }
                    }
                    return(LFFK.DataManager.ExecuteList <P_QuotationVO>(sql));
                }
            }
            return(new List <P_QuotationVO>());
        }
예제 #2
0
 public List <P_QuotationVO> GetQuotationList(string accountId, QuotationQueryVO query)
 {
     return(DAManager.CarPartsDAManager.GetQuotationList(accountId, query));
 }