Exemplo n.º 1
0
 /// <summary>
 /// 根据用户编号查询密码
 /// </summary>
 /// <param name="userid">用户编号</param>
 /// <param name="pwd">密码</param>
 public void GetPassword(int userid, ref string pwd)
 {
     model = dal.GetModel(userid);
     if (model != null)
     {
         pwd = model.password;
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 初始化通知首选项(获取用户登录邮箱)
 /// </summary>
 /// <param name="userid">用户编号</param>
 /// <param name="email">用户登录邮箱</param>
 public void GetEmail(int userid, ref string email, ref string name)
 {
     model = dal.GetModel(userid);
     if (model != null)
     {
         email = model.email;
         name  = model.name;
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// 重载方法(获取用户表里的存款和付款ID)
 /// </summary>
 /// <param name="userid">用户编号</param>
 /// <param name="chargeId">付款编号</param>
 /// <param name="depositiId">存款编号</param>
 public void GetMethonId(int userid, ref int?chargeId, ref int?depositiId)
 {
     model = dal.GetMethonId(userid);
     if (model != null)
     {
         chargeId   = model.chargemethod;
         depositiId = model.depositmethod;
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// 初始化网站地址和永久地址ID
 /// </summary>
 /// <param name="userid">用户编号</param>
 /// <param name="website">网站地址</param>
 /// <param name="addressId">永久地址ID</param>
 /// <param name="error">错误信息</param>
 public void GetWebsite(int userid, ref string website, ref int?addressId, ref int?step)
 {
     model = dal.GetWebsite(userid);
     if (model != null)
     {
         website   = model.website;
         addressId = model.registered_address;
         step      = model.step;
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// 获取办公地址ID,正式注册ID,公司名称,商家标志
 /// </summary>
 /// <param name="userid">用户编号</param>
 public void GetCompanyInfo(int userid, ref int?business_address, ref int?registered_address, ref string name, ref string token)
 {
     model = dal.GetModel(userid);
     if (model != null)
     {
         business_address   = model.business_address;
         registered_address = model.registered_address;
         name  = model.name;
         token = model.token;
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// 初始化商品信息
 /// </summary>
 /// <param name="userid"></param>
 /// <param name="is_product_upc"></param>
 /// <param name="is_product_brand"></param>
 /// <param name="product_list"></param>
 public void GetCommodityInfo(int userid, ref int?is_product_upc, ref int?is_product_brand, ref int?product_list, ref int?step)
 {
     model = dal.GetModel(userid);
     if (model != null)
     {
         is_product_upc   = model.is_product_upc;
         is_product_brand = model.is_product_brand;
         product_list     = model.product_list;
         step             = model.step;
     }
 }
Exemplo n.º 7
0
 /// <summary>
 /// 获取用户表信息(name,email,pwd,telephone)
 /// </summary>
 /// <param name="userid">用户编号</param>
 /// <returns></returns>
 public string GetUserLoginSetting(int userid)
 {
     model = dal.GetModel(userid);
     if (model != null)
     {
         return("\"name\":\"" + QGYHelper.FormatCode.FormatUrlEncode(model.name) + "\",\"email\":\"" + QGYHelper.FormatCode.FormatUrlEncode(model.email) + "\",\"password\":\"" + model.password + "\",\"telephone\":\"" + model.telephone + "\"");
     }
     else
     {
         return("");
     }
 }
Exemplo n.º 8
0
 /// <summary>
 /// 更新商户注册之卖家信息(获取永用户表里久地址ID)
 /// </summary>
 /// <param name="userid">用户ID</param>
 /// <param name="registered_address">永久地址ID</param>
 /// <param name="business_address">邮寄地址ID</param>
 public bool GetUserInfo4(int userid, ref int?registered_address, ref int?business_address)
 {
     model = dal.GetUserInfo4(userid);
     if (model.registered_address != null)
     {
         registered_address = model.registered_address;
         business_address   = model.business_address;
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 9
0
        /// <summary>
        /// 根据邮箱获取用户编号
        /// </summary>
        /// <param name="email">邮箱</param>
        /// <param name="user_id">用户编号</param>
        /// <returns></returns>
        //public bool SelectUserID(string email, ref int userID)
        //{
        //    model = dal.SelectUserID(email);
        //    if (model != null)
        //    {
        //        userID = model.user_id;
        //        return true;
        //    }
        //    return false;
        //}
        #endregion

        #region 初始化法人
        /// <summary>
        /// 初始化法人(返回法人)
        /// </summary>
        /// <param name="userid">用户编号</param>
        /// <param name="legal_name">返回法人信息</param>
        /// <param name="result">接口状态</param>
        /// <param name="error">错误信息</param>
        public void GetUserLegal_Name(int userid, ref string legal_name, ref int result, ref string error, ref int?step)
        {
            model = dal.GetUserLegal_Name(userid);
            if (model.legal_name != null && model.legal_name != "")
            {
                result     = 1;
                legal_name = model.legal_name;
                step       = model.step;
            }
            else
            {
                error = "请先添加法人";
            }
        }
Exemplo n.º 10
0
 /// <summary>
 /// 通过学生ID和实训模式(1,2)返回商户userID
 /// </summary>
 /// <param name="stuid">学生ID</param>
 /// <param name="trainingmode">实训模式(0,1)</param>
 /// <param name="userid">商户编号</param>
 /// <param name="isfinished">是否完成(1是 0否)</param>
 /// <param name="error">返回信息</param>
 public bool GetUserID1(int stuid, int trainingmode, ref int userid, ref int isfinished, ref string error, ref int step)
 {
     model = dal.GetUserID1(stuid, trainingmode);
     if (model != null)
     {
         userid     = model.user_id;
         isfinished = (model.step.Value == 6) ? 1 : 0;
         step       = model.step.Value;
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 11
0
 /// <summary>
 /// 初始化商户注册之账单存款(获取存款,收款,永久地址ID)
 /// </summary>
 /// <param name="userid">用户ID</param>
 /// <param name="registered_address">永久地址ID</param>
 /// <param name="business_address">邮寄地址ID</param>
 public void GetMethonId(int userid, ref int?chargeId, ref int?depositId, ref string error, ref int?registered_address, ref int?step)
 {
     model = dal.GetMethonId(userid);
     if (model != null)
     {
         chargeId           = model.chargemethod;
         depositId          = model.depositmethod;
         registered_address = model.registered_address;
         step = model.step;
     }
     else
     {
         error = "账单存款无信息,请先添加";
     }
 }
Exemplo n.º 12
0
 /// <summary>
 /// 获取用户登录邮箱和密码
 /// </summary>
 /// <param name="account">邮箱或者手机号</param>
 /// <param name="password">密码</param>
 /// <param name="result"></param>
 /// <param name="error"></param>
 public void LoginEmail(string account, string password, ref int result, ref string error)
 {
     if (account.Contains("@"))
     {
         model = dal.GetModelEmail(account);
         if (model != null)
         {
             if (password == model.password)
             {
                 result = 1;
             }
             else
             {
                 error = "密码错误";
             }
         }
         else
         {
             error = "邮箱不存在";
         }
     }
     else
     {
         model = dal.GetModelTelephone(account);
         if (model != null)
         {
             if (password == model.password)
             {
                 result = 1;
             }
             else
             {
                 error = "密码错误";
             }
         }
         else
         {
             error = "手机号不存在";
         }
     }
 }
Exemplo n.º 13
0
 /// <summary>
 /// 商户登录
 /// </summary>
 /// <param name="account">用户输入账号</param>
 /// <param name="pwd">密码</param>
 /// <param name="userID">用户编号</param>
 /// <param name="stuid">学生编号</param>
 /// <param name="trainingmode">实训模式(1 单项 2 综合)</param>
 /// <param name="userID">用户编号</param>
 /// <param name="step">注册步骤</param>
 /// <param name="error">错误信息</param>
 /// <returns></returns>
 public bool Login(string account, string pwd, int stuid, int trainingmode, ref int userID, ref int step, ref string error)
 {
     //检测账号类型(1 邮箱 2 手机)
     if (account.Contains("@"))
     {
         //邮箱,
         model = dal.GetModelEmail(account);
     }
     else
     {
         //手机号
         model = dal.GetModelTelephone(account);
     }
     if (model == null)
     {
         error = "账号错误";
         return(false);
     }
     else
     {
         if (pwd != model.password)
         {
             error = "密码错误";
             return(false);
         }
         else if (stuid != model.stu_id)
         {
             error = "卖家账号与学生账号不匹配";
             return(false);
         }
         else if (trainingmode != model.stu_training_mode)
         {
             error = "卖家账号与实训类型不匹配";
             return(false);
         }
         userID = model.user_id;
         step   = model.step.Value;
         return(true);
     }
 }
Exemplo n.º 14
0
 /// <summary>
 /// 商户找回密码之验证账号(通过邮箱地址或手机号码找回密码)
 /// </summary>
 /// <param name="account">用户输入账号(邮箱或者手机号)</param>
 /// <param name="result">返回值</param>
 /// <param name="token">商家标识</param>
 /// <param name="email">电子邮件</param>
 /// <returns></returns>
 public bool GetUserInfo(string account, int stuid, int trainingmode, ref int result, ref string token, ref string email, ref string error)
 {
     //检查账号类型
     if (account.Contains("@"))
     {
         //通过账号查询账户标志(token)和邮箱(email)
         model = dal.AdoptEmail(account);
     }
     else
     {
         //通过手机号
         model = dal.AdoptTelephone(account);
     }
     if (model == null)
     {
         error = "账号不存在";
         return(false);
     }
     else
     {
         if (stuid != model.stu_id)
         {
             error = "卖家账号与学生账号不匹配";
             return(false);
         }
         else
         {
             if (trainingmode != model.stu_training_mode)
             {
                 error = "卖家账号与实训类型不匹配";
                 return(false);
             }
         }
         token = model.token;
         email = model.email;
         return(true);
     }
 }