Exemplo n.º 1
0
        public static Command CreateModel(DataRow dr)
        {
            Command cmd = new Command();

            if (dr.Table.Columns.Contains("Id"))
            {
                cmd.Id = LibConvert.ObjToInt64(dr["Id"]);
            }
            if (dr.Table.Columns.Contains("TaskId"))
            {
                cmd.TaskId = LibConvert.ObjToInt64(dr["TaskId"]);
            }
            if (dr.Table.Columns.Contains("NodeId"))
            {
                cmd.NodeId = LibConvert.ObjToInt64(dr["NodeId"]);
            }
            if (dr.Table.Columns.Contains("CommandType"))
            {
                cmd.CommandType = (CommandType)LibConvert.ObjToInt(dr["CommandType"]);
            }
            if (dr.Table.Columns.Contains("CreateTime"))
            {
                cmd.CreateTime = LibConvert.ObjToDateTime(dr["CreateTime"]);
            }
            if (dr.Table.Columns.Contains("State"))
            {
                cmd.State = LibConvert.ObjToInt(dr["State"]);
            }
            return(cmd);
        }
Exemplo n.º 2
0
        public virtual tb_shuntruleconn_config_model CreateModel(DataRow dr)
        {
            return(new tb_shuntruleconn_config_model
            {
                //自增
                id = dr["id"].Toint(),
                //分区id(分区标识号)
                partitionno = dr["f_partitionno"].Toint(),
                //地区编码
                regioncode = dr["f_regioncode"].Toint(),
                //服务器地址
                dbserver = dr["f_dbserver"].Tostring(),
                //数据库名
                dbname = dr["f_dbname"].Tostring(),
                //用户名
                dbuser = dr["f_dbuser"].Tostring(),
                //密码
                dbpass = dr["f_dbpass"].Tostring(),
                //最后更新时间

                lastUpdateTime = LibConvert.ObjToDateTime(dr["f_last_update_time"]),

                //是否删除

                isDel = LibConvert.ObjToBool(dr["f_isdel"])
            });
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        public virtual tb_dbpartition_config_model CreateModel(DataRow dr)
        {
            return(new tb_dbpartition_config_model
            {
                //自增
                id = dr["id"].Toint(),
                //分区id(分区标识号)
                partitionno = dr["f_partitionno"].Toint(),
                //分区类型(1:用户分区,2:商户表分区)
                partitiontype = dr["f_partitiontype"].ToByte(),
                //服务器地址
                dbserver = dr["f_dbserver"].Tostring(),
                //数据库名
                dbname = dr["f_dbname"].Tostring(),
                //用户名
                dbuser = dr["f_dbuser"].Tostring(),
                //密码
                dbpass = dr["f_dbpass"].Tostring(),

                lastUpdateTime = LibConvert.ObjToDateTime(dr["f_last_update_time"]),

                //是否删除

                isDel = LibConvert.ObjToBool(dr["f_isdel"])
            });
        }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
0
        public virtual tb_dbsubscribe_config_model CreateModel(DataRow dr)
        {
            var o = new tb_dbsubscribe_config_model();

            //
            if (dr.Table.Columns.Contains("f_id"))
            {
                o.id = dr["f_id"].Toint();
            }
            //
            if (dr.Table.Columns.Contains("f_partitionno"))
            {
                o.partitionno = dr["f_partitionno"].Tostring();
            }
            //
            if (dr.Table.Columns.Contains("f_partitiontype"))
            {
                o.partitiontype = dr["f_partitiontype"].Toint();
            }
            //
            if (dr.Table.Columns.Contains("f_dbserver"))
            {
                o.dbserver = dr["f_dbserver"].Tostring();
            }
            //
            if (dr.Table.Columns.Contains("f_dbname"))
            {
                o.dbname = dr["f_dbname"].Tostring();
            }
            //
            if (dr.Table.Columns.Contains("f_dbuser"))
            {
                o.dbuser = dr["f_dbuser"].Tostring();
            }
            //
            if (dr.Table.Columns.Contains("f_dbpass"))
            {
                o.dbpass = dr["f_dbpass"].Tostring();
            }
            //
            if (dr.Table.Columns.Contains("f_dbtype"))
            {
                o.dbtype = dr["f_dbtype"].Toint();
            }

            //最后更新时间
            if (dr.Table.Columns.Contains("f_last_update_time"))
            {
                o.lastUpdateTime = LibConvert.ObjToDateTime(dr["f_last_update_time"]);
            }
            //是否删除
            if (dr.Table.Columns.Contains("f_isdel"))
            {
                o.isDel = LibConvert.ObjToBool(dr["f_isdel"]);
            }
            return(o);
        }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
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);
        }