Esempio n. 1
0
        public string GetPayMentTypePage(NameValueCollection rParams)
        {
            TPaymentTypeBLL      service       = new TPaymentTypeBLL(CurrentUserInfo);
            int                  startRowIndex = Utils.GetIntVal(FormatParamValue(Request("page")));
            ReqPayMentTypeEntity entity        = rParams["form"].DeserializeJSONTo <ReqPayMentTypeEntity>();


            List <IWhereCondition> wheres = new List <IWhereCondition>();

            if (entity != null && !string.IsNullOrEmpty(entity.Payment_Type_Name))
            {
                wheres.Add(new LikeCondition()
                {
                    FieldName = "t.Payment_Type_Name", HasLeftFuzzMatching = true, HasRightFuzzMathing = true, Value = entity.Payment_Type_Name
                });
            }
            if (entity != null && !string.IsNullOrEmpty(entity.Payment_Type_Code))
            {
                wheres.Add(new LikeCondition()
                {
                    FieldName = "t.Payment_Type_Code", HasLeftFuzzMatching = true, HasRightFuzzMathing = true, Value = entity.Payment_Type_Code
                });
            }

            PagedQueryResult <TPaymentTypeEntity> prlist = service.GetPaymentTypePage(wheres.ToArray(), startRowIndex, PageSize);

            return(string.Format("{{\"totalCount\":{0},\"url\":\"{1}\",\"topics\":{2}}}", prlist.RowCount, ConfigurationManager.AppSettings["payMentUrl"], prlist.Entities.ToJSON()));
        }