/// <summary> /// 设置试题休息 /// </summary> /// <param name="Q"></param> /// <returns></returns> public static JsMessage SetST_Sleep(DanXuan DX) { JsMessage js = new JsMessage(); string SqlStr = @" UPDATE [dbo].[WT] SET [wt_Sleep] = @wt_Sleep WHERE [wt_ID]=@wt_ID"; SqlParameter[] commandParameters = new SqlParameter[]{ new SqlParameter("@wt_Sleep",SqlDbType.VarChar,1000){Value=DX.wt_Sleep}, new SqlParameter("@wt_ID",DX.wt_ID) }; try { int flg = SqlHelper.ExecteNonQueryText(SqlStr, commandParameters); if (flg == 1) { js.IsSuccess = true; } else { js.IsSuccess = false; } } catch (SqlException ex) { js.IsSuccess = false; js.ErrorMsg = ex.ToString(); } return js; }
/// <summary> /// 添加组合题 /// </summary> /// <param name="Q"></param> /// <returns></returns> public static JsMessage Add_ZHST(DanXuan DX) { JsMessage js = new JsMessage(); string SqlStr = @" INSERT INTO [dbo].[WT] ([wt_WJID] ,[wt_OrderNum] ,[wt_Title] ,[wt_Pageing] ,[wt_PID] ,[wt_LimitTime] ,[wt_Type] ,[wt_Problem] ,[wt_Options] ,[wt_IsAnswer] ,[wt_LogicRelated]) VALUES (@wt_WJID, @wt_OrderNum, @wt_Title, @wt_Pageing, @wt_PID, @wt_LimitTime, @wt_Type, @wt_Problem, @wt_Options, @wt_IsAnswer, @wt_LogicRelated);SELECT @wt_ID=SCOPE_IDENTITY();"; SqlParameter[] commandParameters = new SqlParameter[]{ new SqlParameter("@wt_WJID",DX.wt_WJID), new SqlParameter("@wt_OrderNum",DX.wt_OrderNum), new SqlParameter("@wt_Title",DX.wt_Title), new SqlParameter("@wt_Pageing",DX.wt_Pageing), new SqlParameter("@wt_PID",DX.wt_PID), new SqlParameter("@wt_LimitTime",DX.wt_LimitTime), new SqlParameter("@wt_Type",DX.wt_Type), new SqlParameter("@wt_Problem",SqlDbType.VarChar,400){Value=DX.wt_Problem}, new SqlParameter("@wt_Options",SqlDbType.VarChar,4000){Value=DX.wt_Options}, new SqlParameter("@wt_IsAnswer",SqlDbType.NVarChar,10){Value=DX.wt_IsAnswer}, new SqlParameter("@wt_LogicRelated",SqlDbType.NVarChar,2000){Value=DX.wt_LogicRelated}, new SqlParameter("@wt_ID",SqlDbType.Int){Direction = ParameterDirection.Output} }; try { int flg = SqlHelper.ExecteNonQueryText(SqlStr, commandParameters); if (flg == 1) { js.IsSuccess = true; js.ReturnADD_ID = int.Parse(commandParameters[11].Value.ToString()); } else { js.IsSuccess = false; } } catch (SqlException ex) { js.IsSuccess = false; js.ErrorMsg = ex.ToString(); } return js; }
/// <summary> /// 修改试题 /// </summary> /// <param name="Q"></param> /// <returns></returns> public static JsMessage Modify_ST(DanXuan DX) { JsMessage js = new JsMessage(); string SqlStr = @" UPDATE [dbo].[WT] SET [wt_Title] = @wt_Title, [wt_LimitTime]=@wt_LimitTime, [wt_Type]=@wt_Type, [wt_Problem]=@wt_Problem, [wt_Options]= @wt_Options WHERE [wt_ID]=@wt_ID"; SqlParameter[] commandParameters = new SqlParameter[]{ new SqlParameter("@wt_Title",DX.wt_Title), new SqlParameter("@wt_LimitTime",DX.wt_LimitTime), new SqlParameter("@wt_Type",DX.wt_Type), new SqlParameter("@wt_Problem",SqlDbType.VarChar,400){Value=DX.wt_Problem}, new SqlParameter("@wt_Options",SqlDbType.VarChar,4000){Value=DX.wt_Options}, new SqlParameter("@wt_ID",DX.wt_ID) }; try { int flg = SqlHelper.ExecteNonQueryText(SqlStr, commandParameters); if (flg == 1) { js.IsSuccess = true; } else { js.IsSuccess = false; } } catch (SqlException ex) { js.IsSuccess = false; js.ErrorMsg = ex.ToString(); } return js; }
/// <summary> /// 设置试题逻辑关系 /// </summary> /// <param name="Q"></param> /// <returns></returns> public static JsMessage Set_Relation(DanXuan dx) { JsMessage js = new JsMessage(); string SqlStr = @" UPDATE [dbo].[WT] SET [wt_Options] = @wt_Options ,[wt_LogicRelated]=@wt_LogicRelated WHERE [wt_ID]=@wt_ID"; SqlParameter[] commandParameters = new SqlParameter[]{ new SqlParameter("@wt_Options",SqlDbType.VarChar,6000){Value=dx.wt_Options}, new SqlParameter("@wt_LogicRelated",SqlDbType.VarChar,10){Value=dx.wt_LogicRelated}, new SqlParameter("@wt_ID",dx.wt_ID) }; try { int flg = SqlHelper.ExecteNonQueryText(SqlStr, commandParameters); if (flg == 1) { js.IsSuccess = true; } else { js.IsSuccess = false; } } catch (SqlException ex) { js.IsSuccess = false; js.ErrorMsg = ex.ToString(); } return js; }