⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 runs.cs

📁 学术会议在线投稿系统 fghgfhgfhgfhfgh
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace WebDB
{
    public class Runs : DataAccess
    {
        public int newrun(String uid,
                          int lid,
                          int pid,
                          int cid,
                          ref int ret,
                          ref int rid,
                          ref String ccl,
                          ref String ecl,
                          ref String se,
                          ref String pip,
                          ref String pap,
                          ref int tl,
                          ref int ml,
                          ref int ol,
                          ref String error_string
                          )
        {
            SqlCommand comm = new SqlCommand();

            conn.Open();
            comm.CommandType = CommandType.StoredProcedure;
            comm.CommandText = "opr_runs_new";
            comm.Connection = conn;
            comm.Parameters.Add("@rid", SqlDbType.Int).Direction = ParameterDirection.Output;
            comm.Parameters.Add("@ccl", SqlDbType.NVarChar,260).Direction = ParameterDirection.Output;
            comm.Parameters.Add("@ecl", SqlDbType.NVarChar,260).Direction = ParameterDirection.Output;
            comm.Parameters.Add("@se", SqlDbType.NVarChar,8).Direction = ParameterDirection.Output;
            comm.Parameters.Add("@pip", SqlDbType.NVarChar,255).Direction = ParameterDirection.Output;
            comm.Parameters.Add("@pap", SqlDbType.NVarChar,255).Direction = ParameterDirection.Output;
            comm.Parameters.Add("@tl", SqlDbType.Int).Direction = ParameterDirection.Output;
            comm.Parameters.Add("@ml", SqlDbType.Int).Direction = ParameterDirection.Output;
            comm.Parameters.Add("@ol", SqlDbType.Int).Direction = ParameterDirection.Output;
            comm.Parameters.Add("@ret", SqlDbType.Int).Direction = ParameterDirection.ReturnValue;
            comm.Parameters.Add("@uid", SqlDbType.NVarChar).Value = uid;
            comm.Parameters.Add("@lid", SqlDbType.Int).Value = lid;
            comm.Parameters.Add("@pid", SqlDbType.Int).Value = pid;
            comm.Parameters.Add("@cid", SqlDbType.Int).Value = cid;
            try
            {
                comm.ExecuteNonQuery();
            }
            catch (SqlException e)
            {
                error_string = e.ToString();
                conn.Close();
                return 1;
            }

            ret = Convert.ToInt32(comm.Parameters["@ret"].Value);

            if (ret == 0)
            {
                rid = Convert.ToInt32(comm.Parameters["@rid"].Value);
                ccl = Convert.ToString(comm.Parameters["@ccl"].Value);
                ecl = Convert.ToString(comm.Parameters["@ecl"].Value);
                se = Convert.ToString(comm.Parameters["@se"].Value);
                pip = Convert.ToString(comm.Parameters["@pip"].Value);
                pap = Convert.ToString(comm.Parameters["@pap"].Value);
                tl = Convert.ToInt32(comm.Parameters["@tl"].Value);
                ml = Convert.ToInt32(comm.Parameters["@ml"].Value);
                ol = Convert.ToInt32(comm.Parameters["@ol"].Value);
            }
            
            conn.Close();
            return 0;

        }
        public int getstatus(String uid, ref int stat, ref String dsp, ref String dspname, ref String error_string)
        {
            SqlCommand comm = new SqlCommand();

            conn.Open();
            comm.CommandType = CommandType.StoredProcedure;
            comm.CommandText = "web_runs_get_status";
            comm.Connection = conn;
            comm.Parameters.Add("@uid", SqlDbType.NVarChar).Value = uid;
            comm.Parameters.Add("@dsp", SqlDbType.NVarChar, 50).Direction = ParameterDirection.Output;
            comm.Parameters.Add("@dspname", SqlDbType.NVarChar, 50).Direction = ParameterDirection.Output;
            comm.Parameters.Add("@s", SqlDbType.Int).Direction = ParameterDirection.Output;

            try
            {
                comm.ExecuteNonQuery();
            }
            catch (SqlException e)
            {
                error_string = e.ToString();
                conn.Close();
                return 1;
            }

            dsp = Convert.ToString(comm.Parameters["@dsp"].Value);
            dspname = Convert.ToString(comm.Parameters["@dspname"].Value);
            stat = Convert.ToInt32(comm.Parameters["@s"].Value);

            conn.Close();
            return 0;
        }
        public int setstatus(int rid,int status,String dsp, ref String error_string)
        {
            SqlCommand comm = new SqlCommand();

            conn.Open();
            comm.CommandType = CommandType.StoredProcedure;
            comm.CommandText = "jud_runs_update_status";
            comm.Connection = conn;
            comm.Parameters.Add("@rid", SqlDbType.Int).Value = rid;
            comm.Parameters.Add("@status", SqlDbType.Int).Value = status;
            comm.Parameters.Add("@dsp", SqlDbType.NVarChar).Value = dsp;

            try
            {
                comm.ExecuteNonQuery();
            }
            catch (SqlException e)
            {
                error_string = e.ToString();
                conn.Close();
                return 1;
            }

            conn.Close();
            return 0;
        }

    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -