using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace FineUIPro.Web
{
    public partial class GetUserInfo : System.Web.UI.Page
    {
        private string action = string.Empty;
        private string useraccount = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            this.action = Request.Params[nameof(action)];
            this.useraccount = Request.Params[nameof(useraccount)];
            if (!IsPostBack)
            {
                if (this.action.ToLower() == "get") {
                   var result= GetPasswordByUserAccount(this.useraccount);
                    Response.Write(result);
                }
            }
        }

       private string GetPasswordByUserAccount(string account)
       {
            JsonResult json = new JsonResult();
            var user = BLL.Sys_UserService.GetUserByAccount(account);
            if (user == null)
            {
                json.Code = "0";
                json.Data = string.Empty;
                json.Message = "该账号不存在";
                return BLL.JsonHelper.ObjectToJSON(json);
            }
            json.Code = "1";
            json.Data = user.Password.ToUpper();
            json.Message = "获取成功";
            return BLL.JsonHelper.ObjectToJSON(json);
       }
    }
    public class JsonResult
    {
        public string Code { get; set; }
        public string Data { get; set; }

        public string Message { get; set; }
    }
}