Esempio n. 1
0
        public bool Update(Model_ChapterAssembly_TQ model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update ChapterAssembly_TQ set ");
            builder.Append("Identifier_Id=@Identifier_Id,");
            builder.Append("TQ_Order=@TQ_Order,");
            builder.Append("TQ_Type=@TQ_Type,");
            builder.Append("type=@type,");
            builder.Append("ComplexityText=@ComplexityText,");
            builder.Append("TestQuestions_Id=@TestQuestions_Id,");
            builder.Append("ResourceToResourceFolder_Id=@ResourceToResourceFolder_Id,");
            builder.Append("Parent_Id=@Parent_Id");
            builder.Append(" where ChapterAssembly_TQ_Id=@ChapterAssembly_TQ_Id ");
            SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@Identifier_Id", SqlDbType.Char, 0x24), new SqlParameter("@TQ_Order", SqlDbType.Int, 4), new SqlParameter("@TQ_Type", SqlDbType.Char, 0x24), new SqlParameter("@type", SqlDbType.Char, 0x24), new SqlParameter("@ComplexityText", SqlDbType.Char, 0x24), new SqlParameter("@TestQuestions_Id", SqlDbType.Char, 0x24), new SqlParameter("@ResourceToResourceFolder_Id", SqlDbType.Char, 0x24), new SqlParameter("@Parent_Id", SqlDbType.Char, 0x24), new SqlParameter("@ChapterAssembly_TQ_Id", SqlDbType.Char, 0x24) };
            cmdParms[0].Value = model.Identifier_Id;
            cmdParms[1].Value = model.TQ_Order;
            cmdParms[2].Value = model.TQ_Type;
            cmdParms[3].Value = model.type;
            cmdParms[4].Value = model.ComplexityText;
            cmdParms[5].Value = model.TestQuestions_Id;
            cmdParms[6].Value = model.ResourceToResourceFolder_Id;
            cmdParms[7].Value = model.Parent_Id;
            cmdParms[8].Value = model.ChapterAssembly_TQ_Id;
            return(DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
Esempio n. 2
0
        public Model_ChapterAssembly_TQ DataRowToModel(DataRow row)
        {
            Model_ChapterAssembly_TQ y_tq = new Model_ChapterAssembly_TQ();

            if (row != null)
            {
                if (row["ChapterAssembly_TQ_Id"] != null)
                {
                    y_tq.ChapterAssembly_TQ_Id = row["ChapterAssembly_TQ_Id"].ToString();
                }
                if (row["Identifier_Id"] != null)
                {
                    y_tq.Identifier_Id = row["Identifier_Id"].ToString();
                }
                if ((row["TQ_Order"] != null) && (row["TQ_Order"].ToString() != ""))
                {
                    y_tq.TQ_Order = new int?(int.Parse(row["TQ_Order"].ToString()));
                }
                if (row["TQ_Type"] != null)
                {
                    y_tq.TQ_Type = row["TQ_Type"].ToString();
                }
                if (row["type"] != null)
                {
                    y_tq.type = row["type"].ToString();
                }
                if (row["ComplexityText"] != null)
                {
                    y_tq.ComplexityText = row["ComplexityText"].ToString();
                }
                if (row["TestQuestions_Id"] != null)
                {
                    y_tq.TestQuestions_Id = row["TestQuestions_Id"].ToString();
                }
                if (row["ResourceToResourceFolder_Id"] != null)
                {
                    y_tq.ResourceToResourceFolder_Id = row["ResourceToResourceFolder_Id"].ToString();
                }
                if (row["Parent_Id"] != null)
                {
                    y_tq.Parent_Id = row["Parent_Id"].ToString();
                }
            }
            return(y_tq);
        }
        public List <Model_ChapterAssembly_TQ> DataTableToList(DataTable dt)
        {
            List <Model_ChapterAssembly_TQ> list = new List <Model_ChapterAssembly_TQ>();
            int count = dt.Rows.Count;

            if (count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    Model_ChapterAssembly_TQ item = this.dal.DataRowToModel(dt.Rows[i]);
                    if (item != null)
                    {
                        list.Add(item);
                    }
                }
            }
            return(list);
        }
Esempio n. 4
0
        public bool Add(Model_ChapterAssembly_TQ model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("insert into ChapterAssembly_TQ(");
            builder.Append("ChapterAssembly_TQ_Id,Identifier_Id,TQ_Order,TQ_Type,type,ComplexityText,TestQuestions_Id,ResourceToResourceFolder_Id,Parent_Id)");
            builder.Append(" values (");
            builder.Append("@ChapterAssembly_TQ_Id,@Identifier_Id,@TQ_Order,@TQ_Type,@type,@ComplexityText,@TestQuestions_Id,@ResourceToResourceFolder_Id,@Parent_Id)");
            SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@ChapterAssembly_TQ_Id", SqlDbType.Char, 0x24), new SqlParameter("@Identifier_Id", SqlDbType.Char, 0x24), new SqlParameter("@TQ_Order", SqlDbType.Int, 4), new SqlParameter("@TQ_Type", SqlDbType.Char, 0x24), new SqlParameter("@type", SqlDbType.Char, 0x24), new SqlParameter("@ComplexityText", SqlDbType.Char, 0x24), new SqlParameter("@TestQuestions_Id", SqlDbType.Char, 0x24), new SqlParameter("@ResourceToResourceFolder_Id", SqlDbType.Char, 0x24), new SqlParameter("@Parent_Id", SqlDbType.Char, 0x24) };
            cmdParms[0].Value = model.ChapterAssembly_TQ_Id;
            cmdParms[1].Value = model.Identifier_Id;
            cmdParms[2].Value = model.TQ_Order;
            cmdParms[3].Value = model.TQ_Type;
            cmdParms[4].Value = model.type;
            cmdParms[5].Value = model.ComplexityText;
            cmdParms[6].Value = model.TestQuestions_Id;
            cmdParms[7].Value = model.ResourceToResourceFolder_Id;
            cmdParms[8].Value = model.Parent_Id;
            return(DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
 public bool Add(Model_ChapterAssembly_TQ model)
 {
     return(this.dal.Add(model));
 }
 public bool Update(Model_ChapterAssembly_TQ model)
 {
     return(this.dal.Update(model));
 }