Ejemplo n.º 1
0
        /// <summary>
        /// Select
        /// </summary>
        /// <param name="sysAreaQuery"></param>
        /// <param name="DataCount"></param>
        /// <param name="ErrorMsg"></param>
        /// <returns></returns>
        public List <SysAreaVm> Select(SysAreaQuery sysAreaQuery, ref int DataCount, ref string ErrorMsg)
        {
            try
            {
                SelectInfo <SysArea> selectInfo = new SelectInfo <SysArea>("SysArea");

                Expression <Func <SysArea, bool> > predicate = null;

                var DbRequest = selectInfo
                                .SetWhere(predicate, DataBaseType.SqlServer, DataDeleteFlag.IsNotDelete)
                                .SetType(TableType.Table)
                                .OrderBy(EF => EF.CreateTime)
                                .OrderByDescending(EF => EF.ObjectId)
                                .Check(ref erolt)
                                .Run <SysAreaVm>(db, erolt);

                //selectInfo
                //    .GetById("123")
                //    .Run();

                //var DbRequest = selectInfo.SetSqlStr("select * from SysArea").Run<SysAreaVm>();

                //var DbRequest = DbContextExtensions.Query<SysAreaVm>(new MSSqlDBContext(), new DbContextSqlQueryCommands
                //{
                //    Sql = sql
                //}).ToList();
                //ErrorMsg = "Select Success";
                return(DbRequest);
            }
            catch (Exception ex)
            {
                ErrorMsg = "Select Error";
                return(null);
            }
        }
        public IActionResult SelectJson([FromBody] SysAreaQuery sysAreaQuery)
        {
            string ErrorMsg  = string.Empty;
            int    DataCount = 0;
            var    flag      = sysAreaService.SelectJson(sysAreaQuery, ref DataCount, ref ErrorMsg);

            if (flag != null)
            {
                return(new JsonResult(
                           ResponseHelper.IsSuccess_Msg_Data_HttpCode(ErrorMsg, flag, DataCount)
                           ));
            }
            else
            {
                return(new JsonResult(
                           ResponseHelper.Error_Msg_Ecode_Elevel_HttpCode(ErrorMsg, flag)
                           ));
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// SelectJson
 /// </summary>
 /// <param name="sysAreaQuery"></param>
 /// <param name="DataCount"></param>
 /// <param name="ErrorMsg"></param>
 /// <returns></returns>
 public string SelectJson(SysAreaQuery sysAreaQuery, ref int DataCount, ref string ErrorMsg)
 {
     return(null);
 }