コード例 #1
0
        public static Config CreateModel(DataRow dr)
        {
            Config config = new Config();

            if (dr.Table.Columns.Contains("Id"))
            {
                config.Id = LibConvert.ObjToInt64(dr["Id"]);
            }
            if (dr.Table.Columns.Contains("CategoryId"))
            {
                config.CategoryId = LibConvert.ObjToInt64(dr["CategoryId"]);
            }
            if (dr.Table.Columns.Contains("ConfigKey"))
            {
                config.ConfigKey = LibConvert.ObjToStr(dr["ConfigKey"]);
            }
            if (dr.Table.Columns.Contains("ConfigValue"))
            {
                config.ConfigValue = LibConvert.ObjToStr(dr["ConfigValue"]);
            }
            if (dr.Table.Columns.Contains("Remark"))
            {
                config.Remark = LibConvert.ObjToStr(dr["Remark"]);
            }
            if (dr.Table.Columns.Contains("CreateTime"))
            {
                config.CreateTime = LibConvert.ObjToDateTime(dr["CreateTime"]);
            }
            if (dr.Table.Columns.Contains("UpdateTime"))
            {
                config.UpdateTime = LibConvert.ObjToDateTime(dr["UpdateTime"]);
            }
            return(config);
        }
コード例 #2
0
        public static Project CreateModel(DataRow dr)
        {
            Project project = new Project();

            if (dr.Table.Columns.Contains("Id"))
            {
                project.Id = LibConvert.ObjToInt64(dr["Id"]);
            }
            if (dr.Table.Columns.Contains("ProjectName"))
            {
                project.ProjectName = LibConvert.ObjToStr(dr["ProjectName"]);
            }
            if (dr.Table.Columns.Contains("CategoryIds"))
            {
                project.CategoryIds = LibConvert.ObjToStr(dr["CategoryIds"]);
            }
            if (dr.Table.Columns.Contains("Remark"))
            {
                project.Remark = LibConvert.ObjToStr(dr["Remark"]);
            }
            if (dr.Table.Columns.Contains("CreateTime"))
            {
                project.CreateTime = LibConvert.ObjToDateTime(dr["CreateTime"]);
            }
            return(project);
        }
コード例 #3
0
 public string GetServerMonitorJson(DbConn PubConn, int serverid)
 {
     return(SqlHelper.Visit(ps =>
     {
         ps.Add("@serverid", serverid);
         StringBuilder stringSql = new StringBuilder();
         stringSql.Append(@"select monitorinfojson from tb_cluster_monitorinfo s where s.serverid=@serverid");
         string json = LibConvert.ObjToStr(PubConn.ExecuteScalar(stringSql.Tostring(), ps.ToParameters()));
         return json;
     }));
 }
コード例 #4
0
        public static SystemConfig CreateModel(DataRow dr)
        {
            SystemConfig o = new SystemConfig();

            if (dr.Table.Columns.Contains("Id"))
            {
                o.Id = LibConvert.ObjToInt64(dr["Id"]);
            }
            if (dr.Table.Columns.Contains("ConfigKey"))
            {
                o.ConfigKey = LibConvert.ObjToStr("ConfigKey");
            }
            if (dr.Table.Columns.Contains("ConfigValue"))
            {
                o.ConfigValue = LibConvert.ObjToStr(dr["ConfigValue"]);
            }
            if (dr.Table.Columns.Contains("Remark"))
            {
                o.Remark = LibConvert.ObjToStr(dr["Remark"]);
            }
            return(o);
        }
コード例 #5
0
        public static Category CreateModel(DataRow dr)
        {
            Category category = new Category();

            if (dr.Table.Columns.Contains("Id"))
            {
                category.Id = LibConvert.ObjToInt64(dr["Id"]);
            }
            if (dr.Table.Columns.Contains("CategoryName"))
            {
                category.CategoryName = LibConvert.ObjToStr(dr["CategoryName"]);
            }
            if (dr.Table.Columns.Contains("Remark"))
            {
                category.Remark = LibConvert.ObjToStr(dr["Remark"]);
            }
            if (dr.Table.Columns.Contains("CreateTime"))
            {
                category.CreateTime = LibConvert.ObjToDateTime(dr["CreateTime"]);
            }

            return(category);
        }
コード例 #6
0
        public static TaskModel CreateModel(DataRow dr)
        {
            TaskModel model = new TaskModel();

            if (dr.Table.Columns.Contains("Id"))
            {
                model.Id = LibConvert.ObjToInt64(dr["Id"]);
            }
            if (dr.Table.Columns.Contains("TaskName"))
            {
                model.TaskName = LibConvert.ObjToStr(dr["TaskName"]);
            }
            if (dr.Table.Columns.Contains("TaskDescription"))
            {
                model.TaskDescription = LibConvert.ObjToStr(dr["TaskDescription"]);
            }
            if (dr.Table.Columns.Contains("CategoryId"))
            {
                model.CategoryId = LibConvert.ObjToInt64(dr["CategoryId"]);
            }
            if (dr.Table.Columns.Contains("NodeId"))
            {
                model.NodeId = LibConvert.ObjToInt64(dr["NodeId"]);
            }
            if (dr.Table.Columns.Contains("TaskCreateTime"))
            {
                model.TaskCreateTime = LibConvert.ObjToDateTime(dr["TaskCreateTime"]);
            }
            if (dr.Table.Columns.Contains("TaskUpdateTime"))
            {
                model.TaskUpdateTime = LibConvert.ObjToDateTimeOrNull(dr["TaskUpdateTime"]);
            }
            if (dr.Table.Columns.Contains("TaskStartTime"))
            {
                model.TaskStartTime = LibConvert.ObjToDateTimeOrNull(dr["TaskStartTime"]);
            }
            if (dr.Table.Columns.Contains("TaskStopTime"))
            {
                model.TaskStopTime = LibConvert.ObjToDateTimeOrNull(dr["TaskStopTime"]);
            }
            if (dr.Table.Columns.Contains("TaskCron"))
            {
                model.TaskCron = LibConvert.ObjToStr(dr["TaskCron"]);
            }
            if (dr.Table.Columns.Contains("TaskState"))
            {
                model.TaskState = LibConvert.ObjToInt(dr["TaskState"]);
            }
            if (dr.Table.Columns.Contains("TaskClassPath"))
            {
                model.TaskClassPath = LibConvert.ObjToStr(dr["TaskClassPath"]);
            }
            if (dr.Table.Columns.Contains("TaskFileName"))
            {
                model.TaskFileName = LibConvert.ObjToStr(dr["TaskFileName"]);
            }
            if (dr.Table.Columns.Contains("TaskClassNamespace"))
            {
                model.TaskClassNamespace = LibConvert.ObjToStr(dr["TaskClassNamespace"]);
            }
            return(model);
        }