Exemple #1
0
		/// <summary>
		/// 获取某个用户及其下级
		/// </summary>
		/// <param name="NReturn"></param>
		/// <param name="ExMsg"></param>
		/// <param name="UserID">UserID</param>
		/// <param name="ContainsSelf">是否包含自己</param>
		/// <param name="ContainsGrand">是否包含子孙</param>
		/// <returns></returns>
		public static DataTable ListChild(ref int NReturn, ref string ExMsg, long UserID, bool ContainsSelf, bool ContainsGrand)
		{
			DataSet ds = new DataSet();

			using (SqlConnection SqlConn = new SqlConnection(Apq.DB.GlobalObject.SqlConnectionString))
			{
				SqlDataAdapter sda = new SqlDataAdapter("dtxc.Apq_Users_ListChild", SqlConn);
				sda.SelectCommand.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sda.SelectCommand);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("ExMsg", ExMsg, DbType.String, -1);
				dch.AddParameter("UserID", UserID, DbType.Int64);
				dch.AddParameter("ContainsSelf", ContainsSelf, DbType.Byte);
				dch.AddParameter("ContainsGrand", ContainsGrand, DbType.Byte);
				sda.SelectCommand.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sda.SelectCommand.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;
				SqlConn.Open();
				sda.Fill(ds);

				NReturn = System.Convert.ToInt32(sda.SelectCommand.Parameters["rtn"].Value);
				ExMsg = sda.SelectCommand.Parameters["ExMsg"].Value.ToString();

				sda.Dispose();
				SqlConn.Close();
			}

			return ds.Tables.Count > 0 ? ds.Tables[0] : null;
		}
Exemple #2
0
		public Apq.STReturn ApqUser_Login(int UserSrc, string UserName)
		{
			Apq.STReturn stReturn = new Apq.STReturn();

			using (SqlConnection SqlConn = new SqlConnection(Apq.DB.GlobalObject.SqlConnectionString))
			{
				SqlCommand sc = new SqlCommand("dbo.ApqUser_Login", SqlConn);
				sc.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sc);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

				dch.AddParameter("UserSrc", UserSrc, DbType.Int32);
				dch.AddParameter("UserName", UserName);
				dch.AddParameter("UserID", 0, DbType.Int64);

				sc.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sc.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;
				sc.Parameters["UserID"].Direction = ParameterDirection.InputOutput;

				SqlConn.Open();
				sc.ExecuteNonQuery();

				stReturn.NReturn = System.Convert.ToInt32(sc.Parameters["rtn"].Value);
				stReturn.ExMsg = Apq.Convert.ChangeType<string>(sc.Parameters["ExMsg"].Value);
				stReturn.POuts.Add(sc.Parameters["UserID"].Value);
			}

			return stReturn;
		}
Exemple #3
0
		/// <summary>
		/// 编辑
		/// </summary>
		public static STReturn ApqPrivilege_Edit(long PID, long ParentID, string PName, string Remark)
		{
			STReturn stReturn = new STReturn();

			using (SqlConnection SqlConn = new SqlConnection(Apq.DB.GlobalObject.SqlConnectionString))
			{
				SqlCommand sc = new SqlCommand("dbo.ApqPrivilege_Edit", SqlConn);
				sc.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sc);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("PID", PID, DbType.Int64);
				dch.AddParameter("ParentID", ParentID, DbType.Int64);
				dch.AddParameter("PName", PName);
				dch.AddParameter("Remark", Remark);
				sc.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sc.Parameters["PID"].Direction = ParameterDirection.InputOutput;
				sc.Parameters["ParentID"].Direction = ParameterDirection.InputOutput;
				sc.Parameters["PName"].Direction = ParameterDirection.InputOutput;
				sc.Parameters["Remark"].Direction = ParameterDirection.InputOutput;
				SqlConn.Open();
				sc.ExecuteNonQuery();

				stReturn.NReturn = System.Convert.ToInt32(sc.Parameters["rtn"].Value);
				stReturn.POuts.Add(sc.Parameters["PID"].Value);
				stReturn.POuts.Add(sc.Parameters["ParentID"].Value);
				stReturn.POuts.Add(sc.Parameters["PName"].Value);
				stReturn.POuts.Add(sc.Parameters["Remark"].Value);
				stReturn.ExMsg = Apq.Convert.ChangeType<string>(sc.Parameters["ExMsg"].Value);

				SqlConn.Close();
			}

			return stReturn;
		}
Exemple #4
0
		/// <summary>
		/// 上传文件
		/// </summary>
		public void FileUp(string FullName, string DBFullName, byte[] bFile)
		{
			string FileName = System.IO.Path.GetFileName(FullName);
			string CFolder = System.IO.Path.GetDirectoryName(FullName);
			string DBFolder = System.IO.Path.GetDirectoryName(DBFullName);

			// 1.上传到数据库
			Apq.Data.Common.DbConnectionHelper.Open(Connection);
			System.Data.Common.DbCommand sqlCmd = Connection.CreateCommand();
			sqlCmd.CommandText = "Apq_FileTrans_Insert";
			sqlCmd.CommandType = CommandType.StoredProcedure;
			Apq.Data.Common.DbCommandHelper cmdHelper = new Apq.Data.Common.DbCommandHelper(sqlCmd);
			cmdHelper.AddParameter("@FileName", FileName);
			cmdHelper.AddParameter("@DBFolder", DBFolder);
			cmdHelper.AddParameter("@CFolder", CFolder);
			cmdHelper.AddParameter("@FileStream", bFile);
			cmdHelper.AddParameter("@ID", 0);
			sqlCmd.Parameters["@ID"].Direction = ParameterDirection.InputOutput;
			sqlCmd.ExecuteNonQuery();
			int ID = Apq.Convert.ChangeType<int>(sqlCmd.Parameters["@ID"].Value);

			// 2.转到磁盘
			sqlCmd.Parameters.Clear();
			sqlCmd.CommandText = "Apq_FileTrans_WriteToHD_ADO";
			sqlCmd.CommandType = CommandType.StoredProcedure;
			cmdHelper.AddParameter("@ID", ID);
			cmdHelper.AddParameter("@KeepInDB", DBNull.Value);
			sqlCmd.ExecuteNonQuery();
		}
Exemple #5
0
		//[ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Xml, XmlSerializeString = true)]
		public Apq.STReturn Dinner_Restaurant_List()
		{
			Apq.STReturn stReturn = new Apq.STReturn();
			DinnerSession ApqSession = new DinnerSession(Session);

			if (!CheckLoginPage.CheckAdmin(ref stReturn, ApqSession))
			{
				return stReturn;
			}

			DataSet ds = new DataSet();
			DbConnection SqlConn = null;
			using (SqlConn = Apq.DBC.Common.CreateDBConnection("Dinner", ref SqlConn))
			{
				Apq.Data.Common.DbConnectionHelper dbch = new Apq.Data.Common.DbConnectionHelper(SqlConn);
				DbDataAdapter sda = dbch.CreateAdapter();
				sda.SelectCommand.CommandText = "dbo.Dinner_Restaurant_List";
				sda.SelectCommand.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sda.SelectCommand);
				dch.AddParameter("rtn", 0, DbType.Int32);

				sda.SelectCommand.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;

				SqlConn.Open();
				sda.Fill(ds);

				stReturn.NReturn = System.Convert.ToInt32(sda.SelectCommand.Parameters["rtn"].Value);
				stReturn.FNReturn = ds.Tables[0];

				sda.Dispose();
				SqlConn.Close();
			}

			return stReturn;
		}
Exemple #6
0
		//[ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Xml, XmlSerializeString = true)]
		public Apq.STReturn UserEditSelf(long UserID, string Name, short Sex, string PhotoUrl, DateTime Birthday
			, string IDCard, string Alipay)
		{
			Apq.STReturn stReturn = new Apq.STReturn();
			DinnerSession ApqSession = new DinnerSession(Session);

			if (!CheckLoginPage.CheckPwdExpire(ref stReturn, ApqSession))
			{
				return stReturn;
			}
			
			DbConnection SqlConn = null;
			using (SqlConn = Apq.DBC.Common.CreateDBConnection("Dinner", ref SqlConn))
			{
				Apq.Data.Common.DbConnectionHelper dbch = new Apq.Data.Common.DbConnectionHelper(SqlConn);
				DbCommand sc = SqlConn.CreateCommand();
				sc.CommandText = "Dinner.Dinner_User_UpdateSelf";
				sc.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sc);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

				dch.AddParameter("_OperID", ApqSession);
				dch.AddParameter("_OpTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
				IPAddress ipa;
				if (IPAddress.TryParse(HttpContext.Current.Request.UserHostAddress, out ipa))
				{
					dch.AddParameter("_OperIP", ipa.GetAddressBytes());
				}

				dch.AddParameter("UserID", UserID);

				dch.AddParameter("Name", Name);
				dch.AddParameter("Sex", Sex);
				dch.AddParameter("PhotoUrl", PhotoUrl);
				//dch.AddParameter("Expire", Expire.ToString("yyyy-MM-dd HH:mm:ss.fff"));
				//dch.AddParameter("Status", Status);
				//dch.AddParameter("IsAdmin", IsAdmin);
				dch.AddParameter("Birthday", Birthday);
				dch.AddParameter("IDCard", IDCard);
				dch.AddParameter("Alipay", Alipay);

				sc.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sc.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;

				SqlConn.Open();
				sc.ExecuteNonQuery();

				stReturn.NReturn = System.Convert.ToInt32(sc.Parameters["rtn"].Value);
				stReturn.ExMsg = sc.Parameters["ExMsg"].Value.ToString();

				sc.Dispose();
				SqlConn.Close();
			}

			return stReturn;
		}
Exemple #7
0
		protected void Page_Load(object sender, EventArgs e)
		{
			//绑定对象

			//默认值

			string m = Request.QueryString["m"];
			switch (m)
			{
				//添加
				case "a":
				case "A":
					break;

				//查看
				//修改
				default:
					//获取数据
					using (SqlConnection SqlConn = new SqlConnection(Apq.DB.GlobalObject.SqlConnectionString))
					{
						STReturn stReturn = new STReturn();
						SqlDataAdapter sda = new SqlDataAdapter("dtxc.Apq_Users_ListOne", SqlConn);
						sda.SelectCommand.CommandType = CommandType.StoredProcedure;
						Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sda.SelectCommand);
						dch.AddParameter("rtn", 0, DbType.Int32);
						dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

						dch.AddParameter("UserID", ApqSession.UserID);

						sda.SelectCommand.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
						sda.SelectCommand.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;

						SqlConn.Open();
						sda.Fill(ds);

						stReturn.NReturn = System.Convert.ToInt32(sda.SelectCommand.Parameters["rtn"].Value);
						stReturn.ExMsg = sda.SelectCommand.Parameters["ExMsg"].Value.ToString();
						stReturn.FNReturn = ds.Tables[0];

						sda.Dispose();
						SqlConn.Close();
					}

					if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
					{
						//页面赋值
						txtBalanceMoney.InnerText = ds.Tables[0].Rows[0]["BalanceMoney"].ToString();
					}
					break;
			}

			//设置只读
			if (m == "v" || m == "V")
			{
			}
		}
Exemple #8
0
		//[ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Xml, XmlSerializeString = true)]
		public Apq.STReturn AddinList(int start, int limit, short IsLookup, long LookupID)
		{
			Apq.STReturn stReturn = new Apq.STReturn();
			Apq.Web.SessionState.HttpSessionState ApqSession = new Apq.Web.SessionState.HttpSessionState(Session);

			if (!CheckLoginPage.CheckAdmin(ref stReturn, ApqSession))
			{
				return stReturn;
			}

			DataSet ds = new DataSet();

			using (SqlConnection SqlConn = new SqlConnection(Apq.DB.Common.GetSqlConnectionString("SqlConnectionString2")))
			{
				SqlDataAdapter sda = new SqlDataAdapter("dtxc.Apq_Addin_List", SqlConn);
				sda.SelectCommand.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sda.SelectCommand);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

				dch.AddParameter("Pager_Page", start / limit + 1, DbType.Int32);
				dch.AddParameter("Pager_PageSize", limit);
				dch.AddParameter("Pager_RowCount", 0, DbType.Int32);

				dch.AddParameter("IsLookup", IsLookup, DbType.Int16);
				dch.AddParameter("LookupID", LookupID);

				sda.SelectCommand.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sda.SelectCommand.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;

				sda.SelectCommand.Parameters["Pager_Page"].Direction = ParameterDirection.InputOutput;
				sda.SelectCommand.Parameters["Pager_RowCount"].Direction = ParameterDirection.InputOutput;

				SqlConn.Open();
				sda.Fill(ds);

				stReturn.NReturn = System.Convert.ToInt32(sda.SelectCommand.Parameters["rtn"].Value);
				stReturn.ExMsg = sda.SelectCommand.Parameters["ExMsg"].Value.ToString();
				stReturn.FNReturn = ds.Tables[0];
				stReturn.POuts = new object[]{
					sda.SelectCommand.Parameters["Pager_Page"].Value,
					sda.SelectCommand.Parameters["Pager_RowCount"].Value
				};

				sda.Dispose();
				SqlConn.Close();
			}

			return stReturn;
		}
Exemple #9
0
		//[ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Xml, XmlSerializeString = true)]
		public STReturn dtxc_Users_ListChild_Pager(int Pager_Page, int Pager_PageSize, long UserID)
		{
			STReturn stReturn = new STReturn();
			Apq.Web.SessionState.HttpSessionState ApqSession = new Apq.Web.SessionState.HttpSessionState(Session);

			if (!CheckLoginPage.CheckAdmin(ref stReturn, ApqSession))
			{
				return stReturn;
			}

			DataSet ds = new DataSet();

			using (SqlConnection SqlConn = new SqlConnection(Apq.DB.Common.GetSqlConnectionString("SqlConnectionString2")))
			{
				SqlDataAdapter sda = new SqlDataAdapter("dtxc.dtxc_Users_ListChild_Pager", SqlConn);
				sda.SelectCommand.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sda.SelectCommand);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

				dch.AddParameter("Pager_Page", Pager_Page, DbType.Int32);
				dch.AddParameter("Pager_PageSize", Pager_PageSize);
				dch.AddParameter("Pager_RowCount", 0, DbType.Int32);

				dch.AddParameter("UserID", UserID);

				sda.SelectCommand.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sda.SelectCommand.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;

				sda.SelectCommand.Parameters["Pager_Page"].Direction = ParameterDirection.InputOutput;
				sda.SelectCommand.Parameters["Pager_RowCount"].Direction = ParameterDirection.InputOutput;

				SqlConn.Open();
				sda.Fill(ds);

				stReturn.NReturn = System.Convert.ToInt32(sda.SelectCommand.Parameters["rtn"].Value);
				stReturn.ExMsg = sda.SelectCommand.Parameters["ExMsg"].Value.ToString();
				stReturn.FNReturn = ds.Tables[0];
				stReturn.POuts = new object[]{
					sda.SelectCommand.Parameters["Pager_Page"].Value,
					sda.SelectCommand.Parameters["Pager_RowCount"].Value
				};

				sda.Dispose();
				SqlConn.Close();
			}

			return stReturn;
		}
Exemple #10
0
		//[ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Xml, XmlSerializeString = true)]
		public Apq.STReturn NewsList(int Pager_Page, int Pager_PageSize)
		{
			Apq.STReturn stReturn = new Apq.STReturn();
			Apq.Web.SessionState.HttpSessionState ApqSession = new Apq.Web.SessionState.HttpSessionState(Session);

			//if (!CheckLogin(ref stReturn, ApqSession))
			//{
			//    return stReturn;
			//}

			DataSet ds = new DataSet();
			long UserID = System.Convert.ToInt64(ApqSession.User.Rows[0]["UserID"]);

			using (SqlConnection SqlConn = new SqlConnection(Apq.DB.GlobalObject.SqlConnectionString))
			{
				SqlDataAdapter sda = new SqlDataAdapter("dtxc.News_List", SqlConn);
				sda.SelectCommand.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sda.SelectCommand);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

				dch.AddParameter("Pager_Page", Pager_Page);
				dch.AddParameter("Pager_PageSize", Pager_PageSize);
				dch.AddParameter("Pager_RowCount", 0, DbType.Int32);

				sda.SelectCommand.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sda.SelectCommand.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;

				sda.SelectCommand.Parameters["Pager_RowCount"].Direction = ParameterDirection.InputOutput;

				SqlConn.Open();
				sda.Fill(ds);

				stReturn.NReturn = System.Convert.ToInt32(sda.SelectCommand.Parameters["rtn"].Value);
				stReturn.ExMsg = sda.SelectCommand.Parameters["ExMsg"].Value.ToString();
				stReturn.FNReturn = ds.Tables[0];
				stReturn.POuts = new object[]{
					sda.SelectCommand.Parameters["Pager_RowCount"].Value
				};

				sda.Dispose();
				SqlConn.Close();
			}

			return stReturn;
		}
Exemple #11
0
		/// <summary>
		/// 列表权限项树
		/// </summary>
		/// <param name="PID">根</param>
		/// <returns></returns>
		public static System.Data.DataSet ApqPrivilege_List(long PID)
		{
			System.Data.DataSet ds = new System.Data.DataSet();

			using (SqlConnection SqlConn = new SqlConnection(Apq.DB.GlobalObject.SqlConnectionString))
			{
				SqlDataAdapter sda = new SqlDataAdapter("dbo.ApqPrivilege_List", SqlConn);
				sda.SelectCommand.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sda.SelectCommand);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("PID", PID, DbType.Int64);
				sda.SelectCommand.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				SqlConn.Open();
				sda.Fill(ds);
				//stReturn.NReturn = System.Convert.ToInt32(sc.Parameters["rtn"].Value);

				SqlConn.Close();
			}

			return ds;
		}
Exemple #12
0
		//[ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Xml, XmlSerializeString = true)]
		public STReturn dtxc_TaskVote_Log_List(string TaskName, string UserNameBegin)
		{
			STReturn stReturn = new STReturn();
			DataSet ds = new DataSet();

			using (SqlConnection SqlConn = new SqlConnection(Apq.DB.Common.GetSqlConnectionString("SqlConnectionString2")))
			{
				SqlDataAdapter sda = new SqlDataAdapter("dtxc.dtxc_TaskVote_Log_List", SqlConn);
				sda.SelectCommand.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sda.SelectCommand);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

				dch.AddParameter("TaskName", TaskName);
				dch.AddParameter("UserNameBegin", UserNameBegin);

				sda.SelectCommand.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sda.SelectCommand.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;

				SqlConn.Open();
				sda.Fill(ds);

				stReturn.NReturn = System.Convert.ToInt32(sda.SelectCommand.Parameters["rtn"].Value);
				stReturn.ExMsg = sda.SelectCommand.Parameters["ExMsg"].Value.ToString();
				stReturn.FNReturn = ds.Tables[0];

				sda.Dispose();
				SqlConn.Close();
			}

			return stReturn;
		}
Exemple #13
0
		/// <summary>
		/// 执行登录存储过程
		/// </summary>
		/// <param name="UserName">用户名</param>
		/// <param name="binLoginPwd">密码</param>
		/// <returns></returns>
		private STReturn DBLogin(string UserName, byte[] binLoginPwd)
		{
			STReturn stReturn = new STReturn();
			DataSet ds = new DataSet();

			using (SqlConnection SqlConn = new SqlConnection(Apq.DB.Common.GetSqlConnectionString("SqlConnectionString2")))
			{
				SqlDataAdapter sda = new SqlDataAdapter("dtxc.dtxc_Login_UserName", SqlConn);
				sda.SelectCommand.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sda.SelectCommand);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

				dch.AddParameter("UserName", UserName);
				dch.AddParameter("LoginPwd", binLoginPwd);

				sda.SelectCommand.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sda.SelectCommand.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;

				SqlConn.Open();
				sda.Fill(ds);

				stReturn.NReturn = System.Convert.ToInt32(sda.SelectCommand.Parameters["rtn"].Value);
				stReturn.ExMsg = sda.SelectCommand.Parameters["ExMsg"].Value.ToString();
				stReturn.FNReturn = ds.Tables[0];

				sda.Dispose();
				SqlConn.Close();
			}

			// 返回客户端
			string SqlLoginPwd = Apq.Data.SqlClient.Common.ConvertToSqlON(binLoginPwd);
			if (stReturn.NReturn > 0)
			{
				stReturn.FNReturn = ds.Tables[0];
				stReturn.POuts = new object[] { UserName, SqlLoginPwd };
			}
			return stReturn;
		}
Exemple #14
0
		//[ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Xml, XmlSerializeString = true)]
		public Apq.STReturn Dinner_EmDinner_Delete(long ID)
		{
			Apq.STReturn stReturn = new Apq.STReturn();
			DinnerSession ApqSession = new DinnerSession(Session);

			if (!CheckLoginPage.CheckLogin(ref stReturn, ApqSession))
			{
				return stReturn;
			}

			DataSet ds = new DataSet();
			
			DbConnection SqlConn = null;
			using (SqlConn = Apq.DBC.Common.CreateDBConnection("Dinner", ref SqlConn))
			{
				Apq.Data.Common.DbConnectionHelper dbch = new Apq.Data.Common.DbConnectionHelper(SqlConn);
				DbCommand sc = SqlConn.CreateCommand();
				sc.CommandText = "dbo.Dinner_EmDinner_Delete";
				sc.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sc);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

				dch.AddParameter("ID", ID);

				sc.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sc.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;

				SqlConn.Open();
				sc.ExecuteNonQuery();

				stReturn.NReturn = System.Convert.ToInt32(sc.Parameters["rtn"].Value);
				stReturn.ExMsg = sc.Parameters["ExMsg"].Value.ToString();

				sc.Dispose();
				SqlConn.Close();
			}

			return stReturn;
		}
Exemple #15
0
		//[ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Xml, XmlSerializeString = true)]
		public STReturn AddinAdd(string AddinName, string AddinUrl, string AddinDescript)
		{
			STReturn stReturn = new STReturn();
			Apq.Web.SessionState.HttpSessionState ApqSession = new Apq.Web.SessionState.HttpSessionState(Session);

			if (!CheckLoginPage.CheckAdmin(ref stReturn, ApqSession))
			{
				return stReturn;
			}

			long UserID = Convert.ToInt64(ApqSession.User.Rows[0]["UserID"]);

			using (SqlConnection SqlConn = new SqlConnection(Apq.DB.Common.GetSqlConnectionString("SqlConnectionString2")))
			{
				SqlCommand sc = new SqlCommand("dtxc.Apq_Addin_Insert", SqlConn);
				sc.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sc);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

				dch.AddParameter("_OperID", UserID);
				dch.AddParameter("_OpTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
				IPAddress ipa;
				if (IPAddress.TryParse(HttpContext.Current.Request.UserHostAddress, out ipa))
				{
					dch.AddParameter("_OperIP", ipa.GetAddressBytes());
				}

				dch.AddParameter("AddinName", AddinName);
				dch.AddParameter("AddinUrl", AddinUrl);
				dch.AddParameter("AddinDescript", AddinDescript);
				dch.AddParameter("AddinID", 0);

				sc.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sc.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;
				sc.Parameters["AddinID"].Direction = ParameterDirection.InputOutput;

				SqlConn.Open();
				sc.ExecuteNonQuery();

				stReturn.NReturn = System.Convert.ToInt32(sc.Parameters["rtn"].Value);
				stReturn.ExMsg = sc.Parameters["ExMsg"].Value.ToString();
				stReturn.POuts = new object[] {
					sc.Parameters["AddinID"].Value
				};

				sc.Dispose();
				SqlConn.Close();
			}

			return stReturn;
		}
Exemple #16
0
		//[ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Xml, XmlSerializeString = true)]
		public STReturn TaskList(int Pager_Page, int Pager_PageSize, int[] Status)
		{
			STReturn stReturn = new STReturn();
			Apq.Web.SessionState.HttpSessionState ApqSession = new Apq.Web.SessionState.HttpSessionState(Session);

			if (!CheckLoginPage.CheckAdmin(ref stReturn, ApqSession))
			{
				return stReturn;
			}

			DataSet ds = new DataSet();

			using (SqlConnection SqlConn = new SqlConnection(Apq.DB.Common.GetSqlConnectionString("SqlConnectionString2")))
			{
				DataTable dtStatus = new DataTable();
				dtStatus.Columns.Add("ID", typeof(int));
				foreach (int i in Status)
				{
					dtStatus.Rows.Add(i);
				}

				SqlDataAdapter sda = new SqlDataAdapter("dtxc.Apq_Task_List", SqlConn);
				sda.SelectCommand.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sda.SelectCommand);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

				dch.AddParameter("Pager_Page", Pager_Page, DbType.Int32);
				dch.AddParameter("Pager_PageSize", Pager_PageSize);
				dch.AddParameter("Pager_RowCount", 0, DbType.Int32);

				sda.SelectCommand.Parameters.Add("Status", SqlDbType.Structured);
				sda.SelectCommand.Parameters["Status"].TypeName = "tvp:t_int";
				sda.SelectCommand.Parameters["Status"].Value = dtStatus;

				sda.SelectCommand.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sda.SelectCommand.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;

				sda.SelectCommand.Parameters["Pager_Page"].Direction = ParameterDirection.InputOutput;
				sda.SelectCommand.Parameters["Pager_RowCount"].Direction = ParameterDirection.InputOutput;

				SqlConn.Open();
				sda.Fill(ds);

				stReturn.NReturn = System.Convert.ToInt32(sda.SelectCommand.Parameters["rtn"].Value);
				stReturn.ExMsg = sda.SelectCommand.Parameters["ExMsg"].Value.ToString();
				stReturn.FNReturn = ds.Tables[0];
				stReturn.POuts = new object[]{
					sda.SelectCommand.Parameters["Pager_Page"].Value,
					sda.SelectCommand.Parameters["Pager_RowCount"].Value
				};

				sda.Dispose();
				SqlConn.Close();
			}

			return stReturn;
		}
Exemple #17
0
		//[ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Xml, XmlSerializeString = true)]
		public Apq.STReturn Dinner_EmDinner_ListPager(int start, int limit)
		{
			int Pager_Page = start / limit;
			int Pager_PageSize = limit;

			Apq.STReturn stReturn = new Apq.STReturn();
			DinnerSession ApqSession = new DinnerSession(Session);

			if (!CheckLoginPage.CheckLogin(ref stReturn, ApqSession))
			{
				return stReturn;
			}

			DataSet ds = new DataSet();
			
			DbConnection SqlConn = null;
			using (SqlConn = Apq.DBC.Common.CreateDBConnection("Dinner", ref SqlConn))
			{
				Apq.Data.Common.DbConnectionHelper dbch = new Apq.Data.Common.DbConnectionHelper(SqlConn);
				DbDataAdapter sda = dbch.CreateAdapter();
				sda.SelectCommand.CommandText = "dbo.Dinner_EmDinner_ListPager";
				sda.SelectCommand.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sda.SelectCommand);
				dch.AddParameter("rtn", 0, DbType.Int32);
				//dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

				dch.AddParameter("Pager_Page", Pager_Page, DbType.Int32);
				dch.AddParameter("Pager_PageSize", Pager_PageSize);
				dch.AddParameter("Pager_RowCount", 0, DbType.Int32);

				dch.AddParameter("EmID", ApqSession.Employee.EmID);

				sda.SelectCommand.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				//sda.SelectCommand.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;

				sda.SelectCommand.Parameters["Pager_RowCount"].Direction = ParameterDirection.InputOutput;

				SqlConn.Open();
				sda.Fill(ds);

				stReturn.NReturn = System.Convert.ToInt32(sda.SelectCommand.Parameters["rtn"].Value);
				//stReturn.ExMsg = sda.SelectCommand.Parameters["ExMsg"].Value.ToString();
				stReturn.FNReturn = ds.Tables[0];
				stReturn.POuts.Add(sda.SelectCommand.Parameters["Pager_Page"].Value);
				stReturn.POuts.Add(sda.SelectCommand.Parameters["Pager_RowCount"].Value);

				sda.Dispose();
				SqlConn.Close();
			}

			return stReturn;
		}
Exemple #18
0
		//[ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Xml, XmlSerializeString = true)]
		public Apq.STReturn UserEditLoginPwd(string LoginPwd_C, string LoginPwd)
		{
			Apq.STReturn stReturn = new Apq.STReturn();
			Apq.Web.SessionState.HttpSessionState ApqSession = new Apq.Web.SessionState.HttpSessionState(Session);

			if (!CheckLoginPage.CheckLogin(ref stReturn, ApqSession))
			{
				return stReturn;
			}

			// 检测旧密码
			System.Security.Cryptography.SHA512 SHA512 = System.Security.Cryptography.SHA512.Create();
			byte[] binLoginPwd_C = SHA512.ComputeHash(System.Text.Encoding.Unicode.GetBytes(LoginPwd_C));
			string SqlLoginPwd_C = Apq.Data.SqlClient.Common.ConvertToSqlON(binLoginPwd_C);
			string SqlLoginPwd_DB = Apq.Data.SqlClient.Common.ConvertToSqlON(ApqSession.User.Rows[0]["LoginPwd"]);
			if (SqlLoginPwd_C != SqlLoginPwd_DB)
			{
				stReturn.NReturn = -1;
				stReturn.ExMsg = "原密码输入错误";
				return stReturn;
			}

			byte[] binLoginPwd = SHA512.ComputeHash(System.Text.Encoding.Unicode.GetBytes(LoginPwd));
			using (SqlConnection SqlConn = new SqlConnection(Apq.DB.Common.GetSqlConnectionString("SqlConnectionString2")))
			{
				SqlCommand sc = new SqlCommand("dtxc.dtxc_User_UpdateLoginPwd", SqlConn);
				sc.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sc);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

				dch.AddParameter("_OperID", ApqSession.UserID);
				dch.AddParameter("_OpTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
				IPAddress ipa;
				if (IPAddress.TryParse(HttpContext.Current.Request.UserHostAddress, out ipa))
				{
					dch.AddParameter("_OperIP", ipa.GetAddressBytes());
				}

				dch.AddParameter("UserID", ApqSession.UserID);

				dch.AddParameter("LoginPwd", binLoginPwd);

				sc.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sc.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;

				SqlConn.Open();
				sc.ExecuteNonQuery();

				stReturn.NReturn = System.Convert.ToInt32(sc.Parameters["rtn"].Value);
				stReturn.ExMsg = sc.Parameters["ExMsg"].Value.ToString();

				sc.Dispose();
				SqlConn.Close();
			}

			// 更新Session中的密码信息
			ApqSession.User.Rows[0]["LoginPwd"] = binLoginPwd;

			// 返回客户端
			stReturn.FNReturn = Apq.Data.SqlClient.Common.ConvertToSqlON(binLoginPwd);
			return stReturn;
		}
Exemple #19
0
		/// <summary>
		/// 下载文件
		/// </summary>
		public void FileDow(string DBFullName, string FullName)
		{
			string FileName = System.IO.Path.GetFileName(FullName);
			string CFolder = System.IO.Path.GetDirectoryName(FullName);
			string DBFolder = System.IO.Path.GetDirectoryName(DBFullName);

			// 准备本地目录
			if (!System.IO.Directory.Exists(CFolder))
			{
				System.IO.Directory.CreateDirectory(CFolder);
			}

			// 1.写入数据库
			Apq.Data.Common.DbConnectionHelper.Open(Connection);
			System.Data.Common.DbCommand sqlCmd = Connection.CreateCommand();
			sqlCmd.CommandText = "Apq_FileTrans_Insert_ADO";
			sqlCmd.CommandType = CommandType.StoredProcedure;
			Apq.Data.Common.DbCommandHelper cmdHelper = new Apq.Data.Common.DbCommandHelper(sqlCmd);
			cmdHelper.AddParameter("@FullName", DBFullName);
			cmdHelper.AddParameter("@CFolder", CFolder);
			cmdHelper.AddParameter("@ID", 0);
			sqlCmd.Parameters["@ID"].Direction = ParameterDirection.InputOutput;
			sqlCmd.ExecuteNonQuery();
			int ID = Apq.Convert.ChangeType<int>(sqlCmd.Parameters["@ID"].Value);

			// 2.读取到本地
			DataSet ds = new DataSet();
			Apq.Data.Common.DbConnectionHelper connHelper = new Apq.Data.Common.DbConnectionHelper(Connection);
			DbDataAdapter da = connHelper.CreateAdapter();
			da.SelectCommand.CommandText = "Apq_FileTrans_List";
			da.SelectCommand.CommandType = CommandType.StoredProcedure;
			Apq.Data.Common.DbCommandHelper daHelper = new Apq.Data.Common.DbCommandHelper(da.SelectCommand);
			daHelper.AddParameter("@ID", ID);
			da.Fill(ds);

			// 3.保存文件
			if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
			{
				byte[] bFile = Apq.Convert.ChangeType<byte[]>(ds.Tables[0].Rows[0]["FileStream"]);
				System.IO.FileStream fs = new System.IO.FileStream(FullName, System.IO.FileMode.Create);
				fs.Write(bFile, 0, bFile.Length);
				fs.Flush();
				fs.Close();
			}

			// 4.删除数据库行
			da.SelectCommand.CommandText = "Apq_FileTrans_Delete";
			da.SelectCommand.ExecuteNonQuery();
		}
Exemple #20
0
		//[ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Xml, XmlSerializeString = true)]
		public Apq.STReturn AddinListOne(long AddinID)
		{
			Apq.STReturn stReturn = new Apq.STReturn();
			Apq.Web.SessionState.HttpSessionState ApqSession = new Apq.Web.SessionState.HttpSessionState(Session);

			if (!CheckLoginPage.CheckAdmin(ref stReturn, ApqSession))
			{
				return stReturn;
			}

			DataSet ds = new DataSet();

			using (SqlConnection SqlConn = new SqlConnection(Apq.DB.Common.GetSqlConnectionString("SqlConnectionString2")))
			{
				SqlDataAdapter sda = new SqlDataAdapter("dtxc.Apq_Addin_ListOne", SqlConn);
				sda.SelectCommand.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sda.SelectCommand);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

				dch.AddParameter("AddinID", AddinID);

				sda.SelectCommand.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sda.SelectCommand.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;

				SqlConn.Open();
				sda.Fill(ds);

				stReturn.NReturn = System.Convert.ToInt32(sda.SelectCommand.Parameters["rtn"].Value);
				stReturn.ExMsg = sda.SelectCommand.Parameters["ExMsg"].Value.ToString();
				stReturn.FNReturn = ds.Tables[0];

				sda.Dispose();
				SqlConn.Close();
			}

			return stReturn;
		}
Exemple #21
0
		//[ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Xml, XmlSerializeString = true)]
		public Apq.STReturn PayoutConfirm(long PayoutID)
		{
			Apq.STReturn stReturn = new Apq.STReturn();
			Apq.Web.SessionState.HttpSessionState ApqSession = new Apq.Web.SessionState.HttpSessionState(Session);

			if (!CheckLoginPage.CheckAdmin(ref stReturn, ApqSession))
			{
				return stReturn;
			}

			long UserID = System.Convert.ToInt64(ApqSession.User.Rows[0]["UserID"]);

			using (SqlConnection SqlConn = new SqlConnection(Apq.DB.GlobalObject.SqlConnectionString))
			{
				SqlCommand sc = new SqlCommand("dtxc.dtxc_Payout_Confirm", SqlConn);
				sc.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sc);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

				dch.AddParameter("_OperID", UserID);
				dch.AddParameter("_OpTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
				IPAddress ipa;
				if (IPAddress.TryParse(HttpContext.Current.Request.UserHostAddress, out ipa))
				{
					dch.AddParameter("_OperIP", ipa.GetAddressBytes());
				}

				dch.AddParameter("PayoutID", PayoutID);

				sc.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sc.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;

				SqlConn.Open();
				sc.ExecuteNonQuery();

				stReturn.NReturn = System.Convert.ToInt32(sc.Parameters["rtn"].Value);
				stReturn.ExMsg = sc.Parameters["ExMsg"].Value.ToString();

				sc.Dispose();
				SqlConn.Close();
			}

			return stReturn;
		}
Exemple #22
0
		//[ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Xml, XmlSerializeString = true)]
		public STReturn dtxc_Reg_UserName(string Name, string UserName, string LoginPwd, short Sex, string PhotoUrl, long IntroUserID, string Alipay, int UserType
			, DateTime Birthday, string IDCard, string IDCard_Name, short IDCard_Sex, string IDCard_PhotoUrl)
		{
			STReturn stReturn = new STReturn();

			if (LoginPwd.Length < 1)
			{
				stReturn.NReturn = -1;
				stReturn.ExMsg = "密码不允许为空";
				return stReturn;
			}

			System.Security.Cryptography.SHA512 SHA512 = System.Security.Cryptography.SHA512.Create();
			byte[] binLoginPwd = SHA512.ComputeHash(System.Text.Encoding.Unicode.GetBytes(LoginPwd));
			using (SqlConnection SqlConn = new SqlConnection(Apq.DB.Common.GetSqlConnectionString("SqlConnectionString2")))
			{
				SqlCommand sc = new SqlCommand("dtxc.dtxc_Reg_UserName", SqlConn);
				sc.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sc);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

				IPAddress ipa;
				if (IPAddress.TryParse(HttpContext.Current.Request.UserHostAddress, out ipa))
				{
					dch.AddParameter("RegIP", ipa.GetAddressBytes());
				}

				dch.AddParameter("Name", Name);
				dch.AddParameter("UserName", UserName);
				dch.AddParameter("LoginPwd", binLoginPwd);
				dch.AddParameter("Sex", Sex);
				dch.AddParameter("PhotoUrl", PhotoUrl);
				dch.AddParameter("Birthday", Birthday.ToString("yyyy-MM-dd HH:mm:ss.fff"));
				dch.AddParameter("Alipay", Alipay);
				dch.AddParameter("IntroUserID", IntroUserID);
				dch.AddParameter("UserType", UserType);
				dch.AddParameter("Expire", DateTime.Now.AddYears(10).ToString("yyyy-MM-dd HH:mm:ss.fff"));

				dch.AddParameter("IDCard", IDCard);
				dch.AddParameter("IDCard_Name", IDCard_Name);
				dch.AddParameter("IDCard_Sex", IDCard_Sex);
				dch.AddParameter("IDCard_PhotoUrl", IDCard_PhotoUrl);

				dch.AddParameter("UserID", 0, DbType.Int64);

				sc.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sc.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;
				sc.Parameters["UserID"].Direction = ParameterDirection.InputOutput;

				SqlConn.Open();
				sc.ExecuteNonQuery();

				stReturn.NReturn = System.Convert.ToInt32(sc.Parameters["rtn"].Value);
				stReturn.ExMsg = sc.Parameters["ExMsg"].Value.ToString();
				stReturn.POuts = new object[] {
					sc.Parameters["UserID"].Value
				};

				sc.Dispose();
				SqlConn.Close();
			}

			return stReturn;
		}
Exemple #23
0
		//[ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Xml, XmlSerializeString = true)]
		public Apq.STReturn UserEditLoginPwd(string LoginPwd_C, string LoginPwd)
		{
			Apq.STReturn stReturn = new Apq.STReturn();
			DinnerSession ApqSession = new DinnerSession(Session);

			if (!CheckLoginPage.CheckLogin(ref stReturn, ApqSession))
			{
				return stReturn;
			}

			// 检测旧密码
			System.Security.Cryptography.SHA512 SHA512 = System.Security.Cryptography.SHA512.Create();
			byte[] binLoginPwd_C = SHA512.ComputeHash(System.Text.Encoding.Unicode.GetBytes(LoginPwd_C));
			string SqlLoginPwd_C = Apq.Data.SqlClient.Common.ConvertToSqlON(binLoginPwd_C);
			string SqlLoginPwd_DB = Apq.Data.SqlClient.Common.ConvertToSqlON(ApqSession.ApqLogin.LoginPwd);
			if (SqlLoginPwd_C != SqlLoginPwd_DB)
			{
				stReturn.NReturn = -1;
				stReturn.ExMsg = "原密码输入错误";
				return stReturn;
			}

			byte[] binLoginPwd = SHA512.ComputeHash(System.Text.Encoding.Unicode.GetBytes(LoginPwd));
			DbConnection SqlConn = null;
			using (SqlConn = Apq.DBC.Common.CreateDBConnection("Dinner", ref SqlConn))
			{
				Apq.Data.Common.DbConnectionHelper dbch = new Apq.Data.Common.DbConnectionHelper(SqlConn);
				DbCommand sc = SqlConn.CreateCommand();
				sc.CommandText = "dbo.Dinner_User_UpdateLoginPwd";
				sc.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sc);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

				dch.AddParameter("LoginID", ApqSession.ApqLogin.LoginID);

				dch.AddParameter("LoginPwd", binLoginPwd);

				sc.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sc.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;

				SqlConn.Open();
				sc.ExecuteNonQuery();

				stReturn.NReturn = System.Convert.ToInt32(sc.Parameters["rtn"].Value);
				stReturn.ExMsg = sc.Parameters["ExMsg"].Value.ToString();

				sc.Dispose();
				SqlConn.Close();
			}

			// 更新Session中的密码信息
			ApqSession.ApqLogin.LoginPwd = binLoginPwd;

			// 返回客户端
			stReturn.FNReturn = Apq.Data.SqlClient.Common.ConvertToSqlON(binLoginPwd);
			return stReturn;
		}
Exemple #24
0
		protected void Page_Load(object sender, EventArgs e)
		{
			//绑定对象

			string m = Request.QueryString["m"];
			switch (m)
			{
				//添加
				case "a":
				case "A":
					break;

				//查看
				//修改
				default:
					//获取数据
					long AddinID = Convert.ToInt64(Request.QueryString["AddinID"]);
					using (SqlConnection SqlConn = new SqlConnection(Apq.DB.Common.GetSqlConnectionString("SqlConnectionString2")))
					{
						STReturn stReturn = new STReturn();
						SqlDataAdapter sda = new SqlDataAdapter("dtxc.Apq_Addin_ListOne", SqlConn);
						sda.SelectCommand.CommandType = CommandType.StoredProcedure;
						Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sda.SelectCommand);
						dch.AddParameter("rtn", 0, DbType.Int32);
						dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

						dch.AddParameter("AddinID", AddinID);

						sda.SelectCommand.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
						sda.SelectCommand.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;

						SqlConn.Open();
						sda.Fill(ds);

						stReturn.NReturn = System.Convert.ToInt32(sda.SelectCommand.Parameters["rtn"].Value);
						stReturn.ExMsg = sda.SelectCommand.Parameters["ExMsg"].Value.ToString();
						stReturn.FNReturn = ds.Tables[0];

						sda.Dispose();
						SqlConn.Close();
					}

					if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
					{
						//页面赋值
						txtAddinID.Text = ds.Tables[0].Rows[0]["AddinID"].ToString();
						txtAddinName.Text = ds.Tables[0].Rows[0]["AddinName"].ToString();
						txtAddinUrl.Text = ds.Tables[0].Rows[0]["AddinUrl"].ToString();
						txtAddinDescript.Text = ds.Tables[0].Rows[0]["AddinDescript"].ToString();
					}
					break;
			}

			//设置只读
			if (m == "v" || m == "V")
			{
				txtAddinID.Enabled = false;
				txtAddinName.Enabled = false;
				txtAddinUrl.Enabled = false;
				txtAddinDescript.Enabled = false;
			}
		}
Exemple #25
0
		/// <summary>
		/// 删除
		/// </summary>
		public static STReturn ApqUser_Delete(long PID, long ParentID)
		{
			STReturn stReturn = new STReturn();

			using (SqlConnection SqlConn = new SqlConnection(Apq.DB.GlobalObject.SqlConnectionString))
			{
				SqlCommand sc = new SqlCommand("dbo.ApqUser_Delete", SqlConn);
				sc.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sc);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("PID", PID, DbType.Int64);
				dch.AddParameter("ParentID", ParentID, DbType.Int64);
				sc.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				SqlConn.Open();
				sc.ExecuteNonQuery();

				stReturn.NReturn = System.Convert.ToInt32(sc.Parameters["rtn"].Value);

				SqlConn.Close();
			}

			return stReturn;
		}
Exemple #26
0
		//[ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Xml, XmlSerializeString = true)]
		public Apq.STReturn WS_Reg(string LoginName, string LoginPwd, byte[] Ipa, string Introducer)
		{
			Apq.STReturn stReturn = new Apq.STReturn();

			if (LoginPwd.Length < 1)
			{
				stReturn.NReturn = -1;
				stReturn.ExMsg = "密码不允许为空";
				return stReturn;
			}

			using (SqlConnection SqlConn = new SqlConnection(Apq.DB.GlobalObject.SqlConnectionString))
			{
				SqlCommand sc = new SqlCommand("dbo.WS_Reg", SqlConn);
				sc.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sc);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

				dch.AddParameter("RegIP", Ipa, DbType.Binary);

				dch.AddParameter("LoginName", LoginName);
				dch.AddParameter("LoginPwd", LoginPwd);
				dch.AddParameter("Introducer", Introducer);

				dch.AddParameter("UserID", 0, DbType.Int64);

				sc.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sc.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;
				sc.Parameters["UserID"].Direction = ParameterDirection.InputOutput;

				SqlConn.Open();
				sc.ExecuteNonQuery();

				stReturn.NReturn = System.Convert.ToInt32(sc.Parameters["rtn"].Value);
				stReturn.ExMsg = Apq.Convert.ChangeType<string>(sc.Parameters["ExMsg"].Value);
				stReturn.POuts.Add(sc.Parameters["UserID"].Value);

				sc.Dispose();
				SqlConn.Close();
			}

			return stReturn;
		}
Exemple #27
0
		//[ScriptMethod(ResponseFormat = System.Web.Script.Services.ResponseFormat.Xml, XmlSerializeString = true)]
		public STReturn UserEdit(long UserID, string UserName, short Sex, string PhotoUrl, DateTime Expire, bool Status, bool IsAdmin, DateTime Birthday
			, string IDCard, string Alipay)
		{
			STReturn stReturn = new STReturn();
			Apq.Web.SessionState.HttpSessionState ApqSession = new Apq.Web.SessionState.HttpSessionState(Session);

			if (!CheckLoginPage.CheckAdmin(ref stReturn, ApqSession))
			{
				return stReturn;
			}

			using (SqlConnection SqlConn = new SqlConnection(Apq.DB.GlobalObject.SqlConnectionString))
			{
				SqlCommand sc = new SqlCommand("dtxc.Apq_Users_Update", SqlConn);
				sc.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sc);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

				dch.AddParameter("_OperID", ApqSession.UserID);
				dch.AddParameter("_OpTime", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
				IPAddress ipa;
				if (IPAddress.TryParse(HttpContext.Current.Request.UserHostAddress, out ipa))
				{
					dch.AddParameter("_OperIP", ipa.GetAddressBytes());
				}

				dch.AddParameter("UserID", UserID);

				dch.AddParameter("UserName", UserName);
				dch.AddParameter("Sex", Sex);
				dch.AddParameter("PhotoUrl", PhotoUrl);
				dch.AddParameter("Expire", Expire.ToString("yyyy-MM-dd HH:mm:ss.fff"));
				dch.AddParameter("Status", Status);
				dch.AddParameter("IsAdmin", IsAdmin);
				dch.AddParameter("Birthday", Birthday);
				dch.AddParameter("IDCard", IDCard);
				dch.AddParameter("Alipay", Alipay);

				sc.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sc.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;

				SqlConn.Open();
				sc.ExecuteNonQuery();

				stReturn.NReturn = System.Convert.ToInt32(sc.Parameters["rtn"].Value);
				stReturn.ExMsg = sc.Parameters["ExMsg"].Value.ToString();

				sc.Dispose();
				SqlConn.Close();
			}

			return stReturn;
		}
Exemple #28
0
		public Apq.STReturn Login_LoginNameFromCookie(string LoginName, string CryptLoginPwd)
		{
			Apq.STReturn stReturn = new Apq.STReturn();

			if (CryptLoginPwd.Length < 1)
			{
				stReturn.NReturn = -1;
				stReturn.ExMsg = "密码不允许为空";
				return stReturn;
			}

			using (SqlConnection SqlConn = new SqlConnection(Apq.DB.GlobalObject.SqlConnectionString))
			{
				SqlCommand sc = new SqlCommand("dbo.WS_Login", SqlConn);
				sc.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sc);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

				dch.AddParameter("LoginName", LoginName);
				dch.AddParameter("LoginPwd", CryptLoginPwd);
				dch.AddParameter("UserID", 0, DbType.Int64);
				dch.AddParameter("IsAdmin", 0, DbType.Byte);
				dch.AddParameter("NickName", string.Empty, DbType.String, 50);

				sc.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sc.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;
				sc.Parameters["UserID"].Direction = ParameterDirection.InputOutput;
				sc.Parameters["IsAdmin"].Direction = ParameterDirection.InputOutput;
				sc.Parameters["NickName"].Direction = ParameterDirection.InputOutput;

				SqlConn.Open();
				sc.ExecuteNonQuery();

				stReturn.NReturn = System.Convert.ToInt32(sc.Parameters["rtn"].Value);
				stReturn.ExMsg = Apq.Convert.ChangeType<string>(sc.Parameters["ExMsg"].Value);
				stReturn.POuts.Add(sc.Parameters["UserID"].Value);	//POuts[0]:UserID
				stReturn.POuts.Add(CryptLoginPwd);					//POuts[1]:CryptLoginPwd
				stReturn.POuts.Add(sc.Parameters["NickName"].Value);//POuts[2]:NickName
				stReturn.POuts.Add(sc.Parameters["IsAdmin"].Value);//POuts[3]:IsAdmin
			}

			return stReturn;
		}
Exemple #29
0
		/// <summary>
		/// 编辑
		/// </summary>
		public static STReturn ApqUser_Edit(long UserID, int UserSrc, string UserName, byte AllowLogin)
		{
			STReturn stReturn = new STReturn();

			using (SqlConnection SqlConn = new SqlConnection(Apq.DB.GlobalObject.SqlConnectionString))
			{
				SqlCommand sc = new SqlCommand("dbo.ApqUser_Edit", SqlConn);
				sc.CommandType = CommandType.StoredProcedure;
				Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sc);
				dch.AddParameter("rtn", 0, DbType.Int32);
				dch.AddParameter("UserID", UserID, DbType.Int64);
				dch.AddParameter("UserSrc", UserSrc, DbType.Int32);
				dch.AddParameter("UserName", UserName);
				dch.AddParameter("AllowLogin", AllowLogin, DbType.Byte);
				sc.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
				sc.Parameters["UserID"].Direction = ParameterDirection.InputOutput;
				sc.Parameters["UserSrc"].Direction = ParameterDirection.InputOutput;
				sc.Parameters["UserName"].Direction = ParameterDirection.InputOutput;
				sc.Parameters["AllowLogin"].Direction = ParameterDirection.InputOutput;
				SqlConn.Open();
				sc.ExecuteNonQuery();

				stReturn.NReturn = System.Convert.ToInt32(sc.Parameters["rtn"].Value);
				stReturn.POuts.Add(sc.Parameters["UserID"].Value);
				stReturn.POuts.Add(sc.Parameters["UserSrc"].Value);
				stReturn.POuts.Add(sc.Parameters["UserName"].Value);
				stReturn.POuts.Add(sc.Parameters["AllowLogin"].Value);

				SqlConn.Close();
			}

			return stReturn;
		}
Exemple #30
0
		protected void Page_Load(object sender, EventArgs e)
		{
			//绑定对象

			//默认值
			txtRegTime.Text = DateTime.Now.ToString("yyyy-MM-dd");
			txtExpire.Text = DateTime.Now.AddYears(1).ToString("yyyy-MM-dd");

			string m = Request.QueryString["m"];
			switch (m)
			{
				//添加
				case "a":
				case "A":
					break;

				//查看
				//修改
				default:
					//获取数据
					using (SqlConnection SqlConn = new SqlConnection(Apq.DB.Common.GetSqlConnectionString("SqlConnectionString2")))
					{
						STReturn stReturn = new STReturn();
						SqlDataAdapter sda = new SqlDataAdapter("dtxc.dtxc_Users_ListOne", SqlConn);
						sda.SelectCommand.CommandType = CommandType.StoredProcedure;
						Apq.Data.Common.DbCommandHelper dch = new Apq.Data.Common.DbCommandHelper(sda.SelectCommand);
						dch.AddParameter("rtn", 0, DbType.Int32);
						dch.AddParameter("ExMsg", stReturn.ExMsg, DbType.String, -1);

						dch.AddParameter("UserID", ApqSession.UserID);

						sda.SelectCommand.Parameters["rtn"].Direction = ParameterDirection.ReturnValue;
						sda.SelectCommand.Parameters["ExMsg"].Direction = ParameterDirection.InputOutput;

						SqlConn.Open();
						sda.Fill(ds);

						stReturn.NReturn = System.Convert.ToInt32(sda.SelectCommand.Parameters["rtn"].Value);
						stReturn.ExMsg = sda.SelectCommand.Parameters["ExMsg"].Value.ToString();
						stReturn.FNReturn = ds.Tables[0];

						sda.Dispose();
						SqlConn.Close();
					}

					if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
					{
						//页面赋值
						txtUserID.Text = ds.Tables[0].Rows[0]["UserID"].ToString();
						txtName.Text = ds.Tables[0].Rows[0]["Name"].ToString();
						ddlSex.SelectedValue = ds.Tables[0].Rows[0]["Sex"].ToString();
						txtAlipay.Text = ds.Tables[0].Rows[0]["Alipay"].ToString();
						if (!Convert.IsDBNull(ds.Tables[0].Rows[0]["Birthday"]))
							txtBirthday.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["Birthday"]).ToString("yyyy-MM-dd");
						txtExpire.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["Expire"]).ToString("yyyy-MM-dd");
						txtRegTime.Text = Convert.ToDateTime(ds.Tables[0].Rows[0]["RegTime"]).ToString("yyyy-MM-dd");
						txtIntroUserID.Text = ds.Tables[0].Rows[0]["IntroUserID"].ToString();
						txtIDCard.Text = ds.Tables[0].Rows[0]["IDCard"].ToString();
					}
					break;
			}

			//设置只读
			if (m == "v" || m == "V")
			{
				txtUserID.Enabled = false;
				txtName.Enabled = false;
				ddlSex.Enabled = false;
				txtAlipay.Enabled = false;
				txtBirthday.Enabled = false;
				txtIntroUserID.Enabled = false;
				txtIDCard.Enabled = false;
			}
		}