Ejemplo n.º 1
0
 public static string AddAtrr(string ScoreId, string AttrId, string TestQuestions_Knowledge_ID)
 {
     try
     {
         ScoreId = ScoreId.Filter();
         AttrId  = AttrId.Filter();
         TestQuestions_Knowledge_ID = TestQuestions_Knowledge_ID.Filter();
         Rc.Cloud.Model.Model_VSysUserRole loginUser = (Rc.Cloud.Model.Model_VSysUserRole)HttpContext.Current.Session["LoginUser"];
         Model_TestQuestions_Score         score     = new BLL_TestQuestions_Score().GetModel(ScoreId);
         Model_S_TestQuestions_TP          model     = new Model_S_TestQuestions_TP();
         model.S_TestQuestions_TP_Id       = TestQuestions_Knowledge_ID;
         model.S_TestingPoint_Id           = AttrId;
         model.TestQuestions_Score_ID      = ScoreId;
         model.TestQuestions_Id            = score.TestQuestions_Id;
         model.ResourceToResourceFolder_Id = score.ResourceToResourceFolder_Id;
         model.CreateUser = loginUser.SysUser_ID;
         model.CreateTime = DateTime.Now;
         if (new BLL_S_TestQuestions_TP().Add(model))
         {
             return("1");
         }
         else
         {
             return("");
         }
     }
     catch (Exception ex)
     {
         return("");
     }
 }
Ejemplo n.º 2
0
        public List <Model_S_TestQuestions_TP> DataTableToList(DataTable dt)
        {
            List <Model_S_TestQuestions_TP> list = new List <Model_S_TestQuestions_TP>();
            int count = dt.Rows.Count;

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

            builder.Append("insert into S_TestQuestions_TP(");
            builder.Append("S_TestQuestions_TP_Id,TestQuestions_Score_ID,TestQuestions_Id,ResourceToResourceFolder_Id,S_TestingPoint_Id,CreateUser,CreateTime)");
            builder.Append(" values (");
            builder.Append("@S_TestQuestions_TP_Id,@TestQuestions_Score_ID,@TestQuestions_Id,@ResourceToResourceFolder_Id,@S_TestingPoint_Id,@CreateUser,@CreateTime)");
            SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@S_TestQuestions_TP_Id", SqlDbType.Char, 0x24), new SqlParameter("@TestQuestions_Score_ID", SqlDbType.Char, 0x24), new SqlParameter("@TestQuestions_Id", SqlDbType.Char, 0x24), new SqlParameter("@ResourceToResourceFolder_Id", SqlDbType.Char, 0x24), new SqlParameter("@S_TestingPoint_Id", SqlDbType.Char, 0x24), new SqlParameter("@CreateUser", SqlDbType.Char, 0x24), new SqlParameter("@CreateTime", SqlDbType.DateTime) };
            cmdParms[0].Value = model.S_TestQuestions_TP_Id;
            cmdParms[1].Value = model.TestQuestions_Score_ID;
            cmdParms[2].Value = model.TestQuestions_Id;
            cmdParms[3].Value = model.ResourceToResourceFolder_Id;
            cmdParms[4].Value = model.S_TestingPoint_Id;
            cmdParms[5].Value = model.CreateUser;
            cmdParms[6].Value = model.CreateTime;
            return(DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
Ejemplo n.º 4
0
        public bool Update(Model_S_TestQuestions_TP model)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("update S_TestQuestions_TP set ");
            builder.Append("TestQuestions_Score_ID=@TestQuestions_Score_ID,");
            builder.Append("TestQuestions_Id=@TestQuestions_Id,");
            builder.Append("ResourceToResourceFolder_Id=@ResourceToResourceFolder_Id,");
            builder.Append("S_TestingPoint_Id=@S_TestingPoint_Id,");
            builder.Append("CreateUser=@CreateUser,");
            builder.Append("CreateTime=@CreateTime");
            builder.Append(" where S_TestQuestions_TP_Id=@S_TestQuestions_TP_Id ");
            SqlParameter[] cmdParms = new SqlParameter[] { new SqlParameter("@TestQuestions_Score_ID", SqlDbType.Char, 0x24), new SqlParameter("@TestQuestions_Id", SqlDbType.Char, 0x24), new SqlParameter("@ResourceToResourceFolder_Id", SqlDbType.Char, 0x24), new SqlParameter("@S_TestingPoint_Id", SqlDbType.Char, 0x24), new SqlParameter("@CreateUser", SqlDbType.Char, 0x24), new SqlParameter("@CreateTime", SqlDbType.DateTime), new SqlParameter("@S_TestQuestions_TP_Id", SqlDbType.Char, 0x24) };
            cmdParms[0].Value = model.TestQuestions_Score_ID;
            cmdParms[1].Value = model.TestQuestions_Id;
            cmdParms[2].Value = model.ResourceToResourceFolder_Id;
            cmdParms[3].Value = model.S_TestingPoint_Id;
            cmdParms[4].Value = model.CreateUser;
            cmdParms[5].Value = model.CreateTime;
            cmdParms[6].Value = model.S_TestQuestions_TP_Id;
            return(DbHelperSQL.ExecuteSql(builder.ToString(), cmdParms) > 0);
        }
Ejemplo n.º 5
0
        public Model_S_TestQuestions_TP DataRowToModel(DataRow row)
        {
            Model_S_TestQuestions_TP s_tp = new Model_S_TestQuestions_TP();

            if (row != null)
            {
                if (row["S_TestQuestions_TP_Id"] != null)
                {
                    s_tp.S_TestQuestions_TP_Id = row["S_TestQuestions_TP_Id"].ToString();
                }
                if (row["TestQuestions_Score_ID"] != null)
                {
                    s_tp.TestQuestions_Score_ID = row["TestQuestions_Score_ID"].ToString();
                }
                if (row["TestQuestions_Id"] != null)
                {
                    s_tp.TestQuestions_Id = row["TestQuestions_Id"].ToString();
                }
                if (row["ResourceToResourceFolder_Id"] != null)
                {
                    s_tp.ResourceToResourceFolder_Id = row["ResourceToResourceFolder_Id"].ToString();
                }
                if (row["S_TestingPoint_Id"] != null)
                {
                    s_tp.S_TestingPoint_Id = row["S_TestingPoint_Id"].ToString();
                }
                if (row["CreateUser"] != null)
                {
                    s_tp.CreateUser = row["CreateUser"].ToString();
                }
                if ((row["CreateTime"] != null) && (row["CreateTime"].ToString() != ""))
                {
                    s_tp.CreateTime = new DateTime?(DateTime.Parse(row["CreateTime"].ToString()));
                }
            }
            return(s_tp);
        }
Ejemplo n.º 6
0
 public bool Add(Model_S_TestQuestions_TP model)
 {
     return(this.dal.Add(model));
 }
Ejemplo n.º 7
0
 public bool Update(Model_S_TestQuestions_TP model)
 {
     return(this.dal.Update(model));
 }