Ejemplo n.º 1
0
        /// <summary>
        /// 获得备份信息列表【分页】
        /// </summary>
        /// <param name="queryJson"></param>
        /// <returns></returns>
        public List <DbBackupEntity> GetList(Pagination pagination, string queryJson)
        {
            var expression = ExtLinq.True <DbBackupEntity>();
            var queryParam = queryJson.ToJObject();

            if (!queryParam["condition"].IsEmpty() && !queryParam["keyword"].IsEmpty())
            {
                string condition = queryParam["condition"].ToString();
                string keyword   = queryParam["keyword"].ToString();
                switch (condition)
                {
                case "DbName":
                    expression = expression.And(t => t.F_DbName.Contains(keyword));
                    break;

                case "FileName":
                    expression = expression.And(t => t.F_FileName.Contains(keyword));
                    break;
                }
            }
            ResultClass <List <DbBackupEntity> > _ret = service.FindList(expression, pagination);

            if (_ret.Result)
            {
                return(_ret.ResultData.OrderByDescending(t => t.F_BackupTime).ToList());
            }
            throw new System.Exception(_ret.ErrorMessage);
        }
Ejemplo n.º 2
0
        public List <DbBackupEntity> GetList(Pagination pagination, string queryJson)
        {
            var expression = ExtLinq.True <DbBackupEntity>();
            var queryParam = queryJson.ToJObject();

            if (!queryParam["condition"].IsEmpty() && !queryParam["keyword"].IsEmpty())
            {
                string condition = queryParam["condition"].ToString();
                string keyword   = queryParam["keyword"].ToString();
                switch (condition)
                {
                case "DbName":
                    expression = expression.And(t => t.DbName.Contains(keyword));
                    break;

                case "FileName":
                    expression = expression.And(t => t.FileName.Contains(keyword));
                    break;
                }
            }
            expression = expression.And(t => t.DeleteMark != true);
            return(service.FindList(expression, pagination));
        }
Ejemplo n.º 3
0
        public List <DbBackupEntity> GetList(Pagination pagination, string queryJson)
        {
            var expression = ExtLinq.True <DbBackupEntity>();
            var queryParam = queryJson.ToJObject();

            if (!queryParam["keyword"].IsEmpty())
            {
                string keyword   = queryParam["keyword"].ToString();
                string condition = string.Empty;
                if (queryParam["condition"] != null)
                {
                    condition = queryParam["condition"].ToString().Trim();
                }
                if (condition == "DbName")
                {
                    expression = expression.And(t => t.F_DbName.Contains(keyword));
                }
                else
                {
                    expression = expression.And(t => t.F_FileName.Contains(keyword));
                }
            }
            return(service.FindList(expression, pagination));
        }