Exemplo n.º 1
0
        public ResponseCollectionModel <Rating> PendingPostRatingByUserId(long userId)
        {
            var result = new ResponseCollectionModel <Rating>();
            var dt     = this.instance.PendingPostRatingByUserId(userId);

            result.Response = DataAccessUtility.ConvertToList <Rating>(dt);
            result.Status   = Constants.WebApiStatusOk;
            return(result);
        }
Exemplo n.º 2
0
        public ResponseCollectionModel <PostStats> GetBiddingStatsByUserId(long userId)
        {
            var dt     = this.instanceBidding.GetBiddingStatsByUserId(userId);
            var result = new ResponseCollectionModel <PostStats>();

            result.Response = DataAccessUtility.ConvertToList <PostStats>(dt);;
            result.Status   = Constants.WebApiStatusOk;
            return(result);
        }
Exemplo n.º 3
0
        public ResponseCollectionModel <PostStatusList> GetPostingStatusByUserId(long userId, Int16 PostStatus)
        {
            var result = new ResponseCollectionModel <PostStatusList>();
            var dt     = this.instance.GetPostingStatusByUserId(userId, PostStatus);

            result.Response = DataAccessUtility.ConvertToList <PostStatusList>(dt);
            result.Status   = Constants.WebApiStatusOk;
            return(result);
        }
Exemplo n.º 4
0
        public ResponseCollectionModel <OrderList> GetPostingOrderByUserId(long userId, int Status)
        {
            var response   = new ResponseCollectionModel <OrderList>();
            var dt         = this.instance.GetPostingOrderByUserId(userId, Status);
            var lstbidding = DataAccessUtility.ConvertToList <OrderList>(dt);

            response.Response = lstbidding;
            response.Status   = Constants.WebApiStatusOk;
            return(response);
        }
Exemplo n.º 5
0
        public ResponseSingleModel <Product> GetById(long productId)
        {
            var response = new ResponseSingleModel <Product>();
            var dt       = this.instance.GetById(productId);

            response.Response = DataAccessUtility.ConvertToList <Product>(dt)[0];
            response.Status   = Constants.WebApiStatusOk;

            return(response);
        }
Exemplo n.º 6
0
        public ResponseSingleModel <ProductInstallDetails> GetInstallProductById(long DtlProductId, long productId, long vehicleId)
        {
            var response = new ResponseSingleModel <ProductInstallDetails>();
            var dt       = this.instance.GetInstallProductById(DtlProductId, productId, vehicleId);

            response.Response = DataAccessUtility.ConvertToList <ProductInstallDetails>(dt)[0];
            response.Status   = Constants.WebApiStatusOk;

            return(response);
        }
Exemplo n.º 7
0
        public ResponseCollectionModel <ProductInstallDetails> GetInstallProductListByUserId(long userId, long installer)
        {
            var response = new ResponseCollectionModel <ProductInstallDetails>();
            var dt       = this.instance.GetInstallProductListByUserId(userId, installer);

            response.Response = DataAccessUtility.ConvertToList <ProductInstallDetails>(dt);
            response.Status   = Constants.WebApiStatusOk;

            return(response);
        }
Exemplo n.º 8
0
        public ResponseCollectionModel <Vehicle> GetVehicleListByUserId(long userId)
        {
            var response = new ResponseCollectionModel <Vehicle>();
            var dt       = this.instance.GetVehicleListByUserId(userId);

            response.Response = DataAccessUtility.ConvertToList <Vehicle>(dt);
            response.Status   = Constants.WebApiStatusOk;

            return(response);
        }
Exemplo n.º 9
0
        /// <summary>
        /// Get list of bidding done by userid (false means Current posting otherwise close posting).
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="isPast"></param>
        /// <returns></returns>
        public ResponseCollectionModel <PostingListBid> GetBidStatusByUserId(long userId, Int16 status)
        {
            var response = new ResponseCollectionModel <PostingListBid>();
            var dt       = this.instanceBidding.GetBidStatusByUserId(userId, status);
            var lst      = DataAccessUtility.ConvertToList <PostingListBid>(dt);

            response.Response = lst;
            response.Status   = Constants.WebApiStatusOk;
            return(response);
        }
Exemplo n.º 10
0
        public ResponseCollectionModel <TransportType> GetTransportTypeByUserId(long userid, out string message)
        {
            var result = new ResponseCollectionModel <TransportType>();

            message = string.Empty;
            var data = instance.GetTransportTypeByUserId(userid, out message);

            result.Response = DataAccessUtility.ConvertToList <TransportType>(data);
            result.Status   = Constants.WebApiStatusOk;
            return(result);
        }
 public static void SetFromDbXmlField<T>(this IDataReader reader,object obj, string dbFieldName, PropertyInfo pinfo)
 {
     if (pinfo != null)
     {
         var xmlData = DataAccessUtility.LoadNullable<string>(reader, dbFieldName);
         if (xmlData.NotEmpty())
             pinfo.SetValue(obj, XmlHelper.CreateFromXml<T>(xmlData));
         else
             pinfo.SetValue(obj, Activator.CreateInstance<T>());
     }
 }
Exemplo n.º 12
0
        public ResponseSingleModel <InsuranceDetails> GetInsuranceById(long vehicleId, long insuranceId)
        {
            var response = new ResponseSingleModel <InsuranceDetails>();
            var dt       = this.instance.GetInsuranceById(vehicleId, insuranceId);
            InsuranceDetails insuranceDetails = DataAccessUtility.ConvertToList <InsuranceDetails>(dt)[0];

            response.Response = insuranceDetails;
            response.Status   = Constants.WebApiStatusOk;

            return(response);
        }
Exemplo n.º 13
0
        public ResponseSingleModel <Vehicle> GetVehicleById(long vehicleId)
        {
            var     response = new ResponseSingleModel <Vehicle>();
            var     dt       = this.instance.GetById(vehicleId);
            Vehicle vehicle  = DataAccessUtility.ConvertToList <Vehicle>(dt)[0];

            response.Response = vehicle;
            response.Status   = Constants.WebApiStatusOk;

            return(response);
        }
Exemplo n.º 14
0
        /// <summary>
        /// Author:shwang
        /// Date:20140614
        /// Desc:得到担保批次信息
        /// </summary>
        /// <param name="filter">过滤条件</param>
        /// <param name="pageOption">页面信息</param>
        /// <returns>担保批次信息</returns>
        public List <GuaranteeBatchViewData> GetGuaranteeBatch(GuaranteeBatchFilter filter)
        {
            string payDateCondition;

            if (filter.HasPayDate)
            {
                payDateCondition = "g.PayDate IS NOT NULL";
            }
            else
            {
                payDateCondition = "g.PayDate IS NULL";
            }

            StringBuilder sbl = new StringBuilder();

            if (!string.IsNullOrEmpty(filter.GuaranteeNo))
            {
                sbl.AppendFormat(" AND g.GuaranteeNum='{0}'", filter.GuaranteeNo);
            }

            if (!string.IsNullOrEmpty(filter.Region))
            {
                sbl.AppendFormat(" AND c.fullKey IN({0})", filter.Region);
            }

            if (!string.IsNullOrEmpty(filter.GuaranteeMonth))
            {
                sbl.AppendFormat(" AND g.GuaranteeMonth={0}", filter.GuaranteeMonth.ConvertToInt());
            }

            if (!string.IsNullOrEmpty(filter.ChildCompany))
            {
                sbl.AppendFormat(" AND s.MappingValue='{0}'", filter.ChildCompany);
            }

            if (filter.GuaranteeIndex > 0)
            {
                sbl.AppendFormat(" AND g.GuaranteeIndex={0}", filter.GuaranteeIndex);
            }

            string pageStr = string.Empty;

            if (filter.PageSize > 0)
            {
                int startNo = (filter.PageNo - 1) * filter.PageSize + 1;
                int endNo   = startNo + filter.PageSize - 1;
                pageStr = string.Format("WHERE t.num BETWEEN {0} AND {1} ", startNo, endNo);
            }

            string sqlStr = "SQL\\DwjmPayConfirm\\Select_GuaranteeBatch.sql".ToFileContent(false, payDateCondition, sbl.ToString(), pageStr);

            return(DataAccessUtility.GetSearchDataByPageNo <GuaranteeBatchViewData>(filter, sqlStr));
        }
Exemplo n.º 15
0
        public ResponseSingleModel <PostingSummary> GetPostingSummary(long userId)
        {
            var            result  = new ResponseSingleModel <PostingSummary>();
            var            dt      = this.instance.GetPostingSummary(UserId);
            var            lst     = DataAccessUtility.ConvertToList <PostingSummary>(dt);
            PostingSummary summary = lst.Count > 0 ? lst[0] : null;

            result.Response = summary;
            result.Status   = summary != null ? Constants.WebApiStatusOk : Constants.WebApiStatusFail;
            result.Message  = "";
            return(result);
        }
Exemplo n.º 16
0
        public void Load(IDataReader reader)
        {
            Id           = DataAccessUtility.LoadInt32(reader, "Id");
            Artist       = DataAccessUtility.LoadNullable <string>(reader, "Artist");
            FullFileName = DataAccessUtility.LoadNullable <string>(reader, "FullFileName");
            FileName     = DataAccessUtility.LoadNullable <string>(reader, "FileName");
            Title        = DataAccessUtility.LoadNullable <string>(reader, "Title");
            MachineName  = DataAccessUtility.LoadNullable <string>(reader, "MachineName");

            //ToUsb = DataAccessUtility.LoadNullable<bool?>(reader, "ToUsb");
            //ToPlaylist = DataAccessUtility.LoadNullable<bool?>(reader, "ToPlaylist");
        }
Exemplo n.º 17
0
 public void Load(IDataReader reader)
 {
     TransactionType = (MonthlyTransactionType)DataAccessUtility.LoadInt32(reader, "TransactionType");
     Amount          = DataAccessUtility.LoadNullable <int>(reader, "Amount");
     Name            = DataAccessUtility.LoadNullable <string>(reader, "Name");
     Id          = DataAccessUtility.LoadInt32(reader, "Id");
     Active      = DataAccessUtility.LoadNullable <bool>(reader, "Active");
     Auto        = DataAccessUtility.LoadNullable <bool>(reader, "Auto");
     UserGroupId = DataAccessUtility.LoadInt32(reader, "UserGroupId");
     FromDate    = DataAccessUtility.LoadNullable <DateTime>(reader, "FromDate");
     ToDate      = DataAccessUtility.LoadNullable <DateTime?>(reader, "ToDate");
 }
Exemplo n.º 18
0
        public ResponseSingleModel <BiddingProfile> GetBiddingDetailById(long biddingId)
        {
            var            response       = new ResponseSingleModel <BiddingProfile>();
            var            ds             = this.instanceBidding.GetById(biddingId);
            BiddingProfile biddingProfile = DataAccessUtility.ConvertToList <BiddingProfile>(ds.Tables[0])[0];

            biddingProfile.biddingDetails = DataAccessUtility.ConvertToList <BiddingDetails>(ds.Tables[1]);
            response.Response             = biddingProfile;
            response.Status = Constants.WebApiStatusOk;

            return(response);
        }
Exemplo n.º 19
0
        public ResponseCollectionModel <PostingList> GetPostingListByUserId(long userId, bool isPast, out string message)
        {
            var result = new ResponseCollectionModel <PostingList>();

            message = string.Empty;
            var dt = this.instance.GetListPostingByUserId(userId, isPast, out message);

            result.Response = DataAccessUtility.ConvertToList <PostingList>(dt);
            result.Status   = Constants.WebApiStatusOk;
            result.Message  = message;
            return(result);
        }
Exemplo n.º 20
0
        public ResponseSingleModel <Company> GetCompanyDetailByUserId(long userId, out string message)
        {
            var result = new ResponseSingleModel <Company>();

            message = string.Empty;
            var dt  = this.instance.GetByUserId(userId, out message);
            var lst = DataAccessUtility.ConvertToList <Company>(dt);

            result.Response = lst != null && lst.Count > 0 ? lst[0] : null;
            result.Status   = lst != null && lst.Count > 0 ? Constants.WebApiStatusOk : Constants.WebApiStatusFail;
            result.Message  = message;
            return(result);
        }
Exemplo n.º 21
0
        public ResponseSingleModel <PostingProfileView> GetPostingProfileById(long postingId, out string message)
        {
            var result = new ResponseSingleModel <PostingProfileView>();

            message = string.Empty;
            var dt         = this.instance.GetById(postingId, out message);
            var lstProfile = DataAccessUtility.ConvertToList <QTrans.Models.ViewModel.Posting.PostingProfileView>(dt);

            result.Response = lstProfile != null && lstProfile.Count > 0 ? lstProfile[0] : null;;
            result.Status   = Constants.WebApiStatusOk;
            result.Message  = message;
            return(result);
        }
Exemplo n.º 22
0
        /// <summary>
        /// Get Min Max Amount of bidding by DtlPostId.
        /// </summary>
        /// <param name="dtlpostId"></param>
        /// <returns>return bid min max amount and total bid</returns>
        public ResponseSingleModel <BidMinMaxAmount> GetBidMinMaxByDtlPostId(long dtlpostId)
        {
            var response = new ResponseSingleModel <BidMinMaxAmount>();
            var dt       = this.instanceBidding.GetMinMaxBidAmount(dtlpostId);
            var result   = DataAccessUtility.ConvertToList <BidMinMaxAmount>(dt);

            response.Response = result != null && result.Count > 0 ? result[0] : new BidMinMaxAmount()
            {
                dtlpostingid = dtlpostId
            };
            response.Status = Constants.WebApiStatusOk;
            return(response);
        }
Exemplo n.º 23
0
        public ResponseSingleModel <UserProfile> Login(string username, string password, out string message)
        {
            var result = new ResponseSingleModel <UserProfile>();

            message = string.Empty;
            var         dt   = instance.UserLogIn(username, password, out message);
            var         lst  = DataAccessUtility.ConvertToList <UserProfile>(dt);
            UserProfile user = lst != null && lst.Count > 0 ? lst[0] : null;

            result.Response = user;
            result.Status   = user != null ? Constants.WebApiStatusOk : Constants.WebApiStatusFail;
            result.Message  = message;
            return(result);
        }
Exemplo n.º 24
0
        public ResponseSingleModel <UserProfile> GetUserDetailByToken(string token, out string message)
        {
            var result = new ResponseSingleModel <UserProfile>();

            message = string.Empty;
            var         dt   = instance.GetBytoken(token, out message);
            var         lst  = DataAccessUtility.ConvertToList <UserProfile>(dt);
            UserProfile user = lst != null && lst.Count > 0 ? lst[0] : null;

            result.Response = user;
            result.Status   = user != null ? Constants.WebApiStatusOk : Constants.WebApiStatusFail;
            result.Message  = message;
            return(result);
        }
Exemplo n.º 25
0
        public void Load(IDataReader reader)
        {
            Id           = DataAccessUtility.LoadInt32(reader, "Id");
            UserId       = DataAccessUtility.LoadInt32(reader, "UserId");
            Shared       = DataAccessUtility.LoadNullable <bool>(reader, "Shared");
            CreationDate = DataAccessUtility.LoadNullable <DateTime>(reader, "CreationDate");
            Date         = DataAccessUtility.LoadNullable <DateTime>(reader, "Date");
            Description  = DataAccessUtility.LoadNullable <string>(reader, "Description");
            title        = DataAccessUtility.LoadNullable <string>(reader, "title");
            var rEvery = DataAccessUtility.LoadNullable <int?>(reader, "RepeatEvery");

            if (rEvery.HasValue)
            {
                RepeatEvery = (RepeatEvery)rEvery.Value;
            }
        }
Exemplo n.º 26
0
        /// <summary>
        /// 得到business信息
        /// </summary>
        /// <typeparam name="T">类型</typeparam>
        /// <param name="filter">过滤条件,字段名需要和数据库列名一致</param>
        /// <returns>订单信息包括 客户姓名、身份证号</returns>
        public List <T> GetBusinessInfo <T>(BaseFilter filter) where T : new()
        {
            Type filterType = filter.GetType();

            PropertyInfo[] propertyInfoArray = filterType.GetProperties();
            StringBuilder  conditionSbl      = new StringBuilder();

            foreach (PropertyInfo propertyInfo in propertyInfoArray)
            {
                object propertyInfoV = propertyInfo.GetValue(filter, null);
                if (propertyInfoV.IsDefaultValue())
                {
                    continue;
                }

                if (DataAccessConsts.BaseFilterProperty.Contains(propertyInfo.Name))
                {
                    continue;
                }

                if (propertyInfoV is string)
                {
                    conditionSbl.AppendFormat("AND {0}='{1}' ", propertyInfo.Name, propertyInfoV);
                }
                else if (propertyInfoV is DateTime)
                {
                    conditionSbl.AppendFormat("AND {0}='{1}' ", propertyInfo.Name, Convert.ToDateTime(propertyInfoV).DateTimeToString2());
                }
                else
                {
                    conditionSbl.AppendFormat("AND {0}={1} ", propertyInfo.Name, propertyInfoV);
                }
            }

            string pageConditionStr = string.Empty;

            if (filter.PageNo > 0)
            {
                int startNo = (filter.PageNo - 1) * filter.PageSize + 1;
                int endNo   = startNo + filter.PageSize - 1;
                pageConditionStr = string.Format("WHERE t.num BETWEEN {0} AND {1}", startNo, endNo);
            }

            string sql = "SQL\\BusinessService\\BusinessSearch.sql".ToFileContent(false, conditionSbl.ToString(), pageConditionStr);

            return(DataAccessUtility.GetSearchDataByPageNo <T>(filter, sql));
        }
Exemplo n.º 27
0
        public ResponseCollectionModel <CityPincode> GetPincode()
        {
            var result = new ResponseCollectionModel <CityPincode>();

            if (InMemoryStorage.Instance.PincodeStorage.Count > 0)
            {
                result.Response = InMemoryStorage.Instance.PincodeStorage.Values.ToList();
            }
            else
            {
                var data = instance.GetPincode();
                result.Response = DataAccessUtility.ConvertToList <CityPincode>(data);
            }

            result.Status = Constants.WebApiStatusOk;
            return(result);
        }
Exemplo n.º 28
0
        /// <summary>
        /// Get list of bidding done by userid.
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        public ResponseCollectionModel <BiddingListDetails> GetBiddingListByDtPostingId(long DtlPostingId)
        {
            var message  = "";
            var response = new ResponseCollectionModel <BiddingListDetails>();
            var ds       = this.instanceBidding.GetBiddingListByDtlPostId(DtlPostingId);

            var lstbidding    = DataAccessUtility.ConvertToList <BiddingListDetails>(ds.Tables[0]);
            var lstBidDetails = DataAccessUtility.ConvertToList <BiddingDetails>(ds.Tables[1]);

            foreach (var bid in lstbidding)
            {
                bid.biddingDetails = lstBidDetails.Where(item => item.biddingid == bid.biddingid).ToList();
            }

            response.Response = lstbidding;
            response.Status   = Constants.WebApiStatusOk;
            return(response);
        }
Exemplo n.º 29
0
        public void Load(IDataReader reader)
        {
            Id          = DataAccessUtility.LoadInt32(reader, "Id");
            UserName    = DataAccessUtility.LoadNullable <string>(reader, "UserName");
            Password    = DataAccessUtility.LoadNullable <string>(reader, "Password");
            DisplayName = DataAccessUtility.LoadNullable <string>(reader, "DisplayName");
            EmailAdress = DataAccessUtility.LoadNullable <string>(reader, "EmailAdress");
            string cper = DataAccessUtility.LoadNullable <string>(reader, "AllowedClientPagePermissions");

            if (string.IsNullOrEmpty(cper))
            {
                AllowedClientPagePermissions = new List <ClientPagePermissions>();
            }
            else
            {
                AllowedClientPagePermissions = XmlHelper.CreateFromXml <List <ClientPagePermissions> >(cper);
            }
        }
Exemplo n.º 30
0
        public ResponseCollectionModel <CountryState> GetState()
        {
            var response = new ResponseCollectionModel <CountryState>();

            if (InMemoryStorage.Instance.StateStorage.Count > 0)
            {
                var lst = InMemoryStorage.Instance.StateStorage.Values.ToList();
                response.Response = lst;
            }
            else
            {
                var data = instance.GetState();
                var lst  = DataAccessUtility.ConvertToList <CountryState>(data);
                response.Response = lst;
            }

            response.Status = Constants.WebApiStatusOk;
            return(response);
        }