Beispiel #1
0
        public override IModel CreateModel(DataRow dr)
        {
            TaskAttach taskattach = new TaskAttach();

            taskattach.TaskAttachId = Convert.ToInt32(dr["TaskAttachId"]);

            if (dr["TaskId"] != DBNull.Value)
            {
                taskattach.TaskId = Convert.ToInt32(dr["TaskId"]);
            }

            if (dr["AttachId"] != DBNull.Value)
            {
                taskattach.AttachId = Convert.ToInt32(dr["AttachId"]);
            }

            return taskattach;
        }
Beispiel #2
0
        public override IModel CreateModel(SqlDataReader dr)
        {
            TaskAttach taskattach = new TaskAttach();

            int indexTaskAttachId = dr.GetOrdinal("TaskAttachId");
            taskattach.TaskAttachId = Convert.ToInt32(dr[indexTaskAttachId]);

            int indexTaskId = dr.GetOrdinal("TaskId");
            if (dr["TaskId"] != DBNull.Value)
            {
                taskattach.TaskId = Convert.ToInt32(dr[indexTaskId]);
            }

            int indexAttachId = dr.GetOrdinal("AttachId");
            if (dr["AttachId"] != DBNull.Value)
            {
                taskattach.AttachId = Convert.ToInt32(dr[indexAttachId]);
            }

            return taskattach;
        }