Beispiel #1
0
        /// <summary>
        /// RETURN [PREFIX]+STRING
        /// </summary>
        public static string Encode(string source, bool genPrefix)
        {
            if (source == string.Empty)
            {
                return("");
            }

            if (genPrefix)
            {
                return(GetPrefix(PREFIX_LEN) + CEncoder.Encode(source));
            }
            else
            {
                return(CEncoder.Encode(source));
            }
        }
Beispiel #2
0
        private bool LoginOn(string user, string pwd, string warehouseCode)
        {
            //string password = CEncoder.Encode(pwd);
            string password = CEncoder.encryptMD5(pwd);
            string sql      = string.Format("select count(0) from ttx_user_password where code='{0}' and password ='******' ", user, password);

            if (DBConnect.GetDataSet(sql).Rows[0][0].ToString() != "")
            {
                loginUser.user              = user;
                loginUser.warehouseCode     = warehouseCode;
                loginUser.warehouseName     = cbxWarehouse.Text;
                loginUser.server            = cfg.Server;
                TTX_WebAPI_Helper.warehouse = loginUser.warehouseCode;
                TTX_WebAPI_Helper.user      = loginUser.user;
                return(true);
            }
            return(false);
        }