📄 userlogin.cs
字号:
try
{
comm.ExecuteNonQuery();
}
catch (SqlException e)
{
String error_string = e.ToString();
conn.Close();
return 0;
}
conn.Close();
return 1;
}
public int insert_Experts(Int32 RoleId, Int32 UserId)
{
SqlCommand comm = new SqlCommand();
conn.Open();
comm.CommandType = CommandType.StoredProcedure;
comm.CommandText = "User_InsertExpertAdmin";
comm.Connection = conn;
comm.Parameters.Add("@RoleId", SqlDbType.Int).Value = RoleId;
comm.Parameters.Add("@UserId", SqlDbType.Int).Value = UserId;
try
{
comm.ExecuteNonQuery();
}
catch (SqlException e)
{
String error_string = e.ToString();
conn.Close();
return 0;
}
conn.Close();
return 1;
}
public DataTable select_userandorg_requestroleid_Admin(Int32 UserId)
{
SqlCommand comm = new SqlCommand();
conn.Open();
comm.CommandType = CommandType.StoredProcedure;
comm.CommandText = "User_SelectUserandOrgByUserId";
comm.Connection = conn;
SqlDataAdapter sda = new SqlDataAdapter(comm);
sda.SelectCommand.Parameters.Add("@UserId", SqlDbType.Int).Value = UserId;
//定义一个数据集对象,并填充数据集
DataSet ds = new DataSet();
DataTable dt = new DataTable();
try
{
sda.Fill(ds, "organisation");
dt = ds.Tables["organisation"];
}
catch (SqlException e)
{
String error_string = e.ToString();
conn.Close();
return dt;
}
return dt;
conn.Close();
}
public int delete_envoyer_requestroleid_admin(Int32 UserId)
{
SqlCommand comm = new SqlCommand();
conn.Open();
comm.CommandType = CommandType.StoredProcedure;
comm.CommandText = "User_DeleteEnvoyer_ChangeRoleId";
comm.Connection = conn;
comm.Parameters.Add("@UserId", SqlDbType.Int).Value = UserId;
try
{
comm.ExecuteNonQuery();
}
catch (SqlException e)
{
String error_string = e.ToString();
conn.Close();
return 0;
}
conn.Close();
return 1;
}
public int delete_article_roleid_admin(Int32 ArticleId)
{
SqlCommand comm = new SqlCommand();
conn.Open();
comm.CommandType = CommandType.StoredProcedure;
comm.CommandText = "User_DeleteArticleAdmin";
comm.Connection = conn;
comm.Parameters.Add("@ArticleId", SqlDbType.Int).Value = ArticleId;
try
{
comm.ExecuteNonQuery();
}
catch (SqlException e)
{
String error_string = e.ToString();
conn.Close();
return 0;
}
conn.Close();
return 1;
}
public int update_roleid_admin(Int32 UserId)
{
SqlCommand comm = new SqlCommand();
conn.Open();
comm.CommandType = CommandType.StoredProcedure;
comm.CommandText = "User_UpdatePerson_ChangeRoleId";
comm.Connection = conn;
comm.Parameters.Add("@UserId", SqlDbType.Int).Value =UserId ;
try
{
comm.ExecuteNonQuery();
}
catch (SqlException e)
{
String error_string = e.ToString();
conn.Close();
return 0;
}
conn.Close();
return 1;
}
public int insert_experts_admin(Int32 UserId,Int32 RoleId)
{
SqlCommand comm = new SqlCommand();
conn.Open();
comm.CommandType = CommandType.StoredProcedure;
comm.CommandText = "User_InsertExpertAdmin";
comm.Connection = conn;
comm.Parameters.Add("@RoleId", SqlDbType.Int).Value = RoleId;
comm.Parameters.Add("@UserId", SqlDbType.Int).Value = UserId;
try
{
comm.ExecuteNonQuery();
}
catch (SqlException e)
{
String error_string = e.ToString();
conn.Close();
return 0;
}
conn.Close();
return 1;
}
public int delete_person_admin(Int32 UserId)
{
SqlCommand comm = new SqlCommand();
conn.Open();
comm.CommandType = CommandType.StoredProcedure;
comm.CommandText = "User_DeletePersonAdmin";
comm.Connection = conn;
comm.Parameters.Add("@UserId", SqlDbType.Int).Value = UserId;
try
{
comm.ExecuteNonQuery();
}
catch (SqlException e)
{
String error_string = e.ToString();
conn.Close();
return 0;
}
conn.Close();
return 1;
}
public int delete_envoyer_admin(Int32 UserId)
{
SqlCommand comm = new SqlCommand();
conn.Open();
comm.CommandType = CommandType.StoredProcedure;
comm.CommandText = "User_DeleteEnvoyer_ChangeRoleId";
comm.Connection = conn;
comm.Parameters.Add("@UserId", SqlDbType.Int).Value = UserId;
try
{
comm.ExecuteNonQuery();
}
catch (SqlException e)
{
String error_string = e.ToString();
conn.Close();
return 0;
}
conn.Close();
return 1;
}
public int delete_experts_admin(Int32 UserId)
{
SqlCommand comm = new SqlCommand();
conn.Open();
comm.CommandType = CommandType.StoredProcedure;
comm.CommandText = "User_DeleteExpertAdmin";
comm.Connection = conn;
comm.Parameters.Add("@UserId", SqlDbType.Int).Value = UserId;
try
{
comm.ExecuteNonQuery();
}
catch (SqlException e)
{
String error_string = e.ToString();
conn.Close();
return 0;
}
conn.Close();
return 1;
}
public int update_rejectchangerole_admin(Int32 UserId)
{
SqlCommand comm = new SqlCommand();
conn.Open();
comm.CommandType = CommandType.StoredProcedure;
comm.CommandText = "User_UpdatePerson_RejectRequest";
comm.Connection = conn;
comm.Parameters.Add("@UserId", SqlDbType.NVarChar).Value = UserId;
try
{
comm.ExecuteNonQuery();
}
catch (SqlException e)
{
String error_string = e.ToString();
conn.Close();
return 0;
}
conn.Close();
return 1;
}
public int update_envoyer_applyforreviewer(Int32 UserId)
{
SqlCommand comm = new SqlCommand();
conn.Open();
comm.CommandType = CommandType.StoredProcedure;
comm.CommandText = "User_UpdatePerson_Request";
comm.Connection = conn;
comm.Parameters.Add("@UserId", SqlDbType.NVarChar).Value = UserId;
try
{
comm.ExecuteNonQuery();
}
catch (SqlException e)
{
String error_string = e.ToString();
conn.Close();
return 0;
}
conn.Close();
return 1;
}
public int delete_envoyer_articleid_admin(Int32 articleid)
{
SqlCommand comm = new SqlCommand();
conn.Open();
comm.CommandType = CommandType.StoredProcedure;
comm.CommandText = "User_DeleteExpertAdmin";
comm.Connection = conn;
comm.Parameters.Add("@articleid", SqlDbType.Int).Value =articleid;
try
{
comm.ExecuteNonQuery();
}
catch (SqlException e)
{
String error_string = e.ToString();
conn.Close();
return 0;
}
conn.Close();
return 1;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -