public int EditByID(ref string ReturnDescription)
        {
            if (ID < 0)
            {
                throw new Exception("CardPassword 尚未初始化到具体的数据实例上,请先使用 GetInformation 等获取数据信息");
            }

            DataTable dt = new SLS.Dal.Tables.T_CardPasswordAgents().Open(PF.ConnectString, "", "[ID] = " + ID, "");

            if ((dt == null) || (dt.Rows.Count < 1))
            {
                ReturnDescription = "数据库读写错误";

                return(-1);
            }

            SLS.Dal.Tables.T_CardPasswordAgents t_CardPasswordAgents = new SLS.Dal.Tables.T_CardPasswordAgents();

            t_CardPasswordAgents.Company.Value  = Company;
            t_CardPasswordAgents.Password.Value = Password;
            t_CardPasswordAgents.Name.Value     = Name;
            t_CardPasswordAgents.State.Value    = State;
            t_CardPasswordAgents.Url.Value      = Url;

            t_CardPasswordAgents.Update(PF.ConnectString, "[ID] = " + ID.ToString());

            return(0);
        }
Example #2
0
        // 正常用户登录
        public int Login(ref string ReturnDescription)
        {
            DataTable dt = new SLS.Dal.Tables.T_CardPasswordAgents().Open(PF.ConnectString,"", "ID=" + ID, "");

            if ((dt == null) || (dt.Rows.Count < 1))
            {
                ReturnDescription = "用户不存在";

                return -1;
            }

            if (dt.Rows[0]["Password"].ToString() != PF.EncryptPassword(Password))
            {
                ReturnDescription = "密码错误";

                return -2;
            }

            //if (!Shove._Convert.StrToBool(dt.Rows[0]["State"].ToString(), false))
            if (dt.Rows[0]["State"].ToString() != "1")
            {
                ReturnDescription = "代理商帐号已经过期";

                return -2;
            }

            Name = dt.Rows[0]["Name"].ToString();
            Password = dt.Rows[0]["Password"].ToString();
            Company = dt.Rows[0]["Company"].ToString();
            Url = dt.Rows[0]["Url"].ToString();
            State = Shove._Convert.StrToShort(dt.Rows[0]["State"].ToString(), 0);

            // 校验成功
            SaveUserIDToCookie();

            return 0;
        }
        // 正常用户登录
        public int Login(ref string ReturnDescription)
        {
            DataTable dt = new SLS.Dal.Tables.T_CardPasswordAgents().Open(PF.ConnectString, "", "ID=" + ID, "");

            if ((dt == null) || (dt.Rows.Count < 1))
            {
                ReturnDescription = "用户不存在";

                return(-1);
            }

            if (dt.Rows[0]["Password"].ToString() != PF.EncryptPassword(Password))
            {
                ReturnDescription = "密码错误";

                return(-2);
            }

            //if (!Shove._Convert.StrToBool(dt.Rows[0]["State"].ToString(), false))
            if (dt.Rows[0]["State"].ToString() != "1")
            {
                ReturnDescription = "代理商帐号已经过期";

                return(-2);
            }

            Name     = dt.Rows[0]["Name"].ToString();
            Password = dt.Rows[0]["Password"].ToString();
            Company  = dt.Rows[0]["Company"].ToString();
            Url      = dt.Rows[0]["Url"].ToString();
            State    = Shove._Convert.StrToShort(dt.Rows[0]["State"].ToString(), 0);

            // 校验成功
            SaveUserIDToCookie();

            return(0);
        }
        public int GetInformationByID(ref string ReturnDescription)
        {
            if (ID < 0)
            {
                throw new Exception("CardPassword 尚未初始化到具体的数据实例上,请先使用 GetInformation 等获取数据信息");
            }

            DataTable dt = new SLS.Dal.Tables.T_CardPasswordAgents().Open(PF.ConnectString, "", "[ID] = " + ID, "");

            if ((dt == null) || (dt.Rows.Count < 1))
            {
                ReturnDescription = "数据库读写错误";

                return(-1);
            }

            Name     = dt.Rows[0]["Name"].ToString();
            Password = dt.Rows[0]["Password"].ToString();
            Company  = dt.Rows[0]["Company"].ToString();
            Url      = dt.Rows[0]["Url"].ToString();
            State    = Shove._Convert.StrToShort(dt.Rows[0]["State"].ToString(), 0);

            return(0);
        }
        public int GetInformationByName(ref string ReturnDescription)
        {
            if (Name == "")
            {
                throw new Exception("CardPassword 尚未初始化到具体的数据实例上,请先使用 GetInformation 等获取数据信息");
            }

            DataTable dt = new SLS.Dal.Tables.T_CardPasswordAgents().Open(PF.ConnectString, "", "[Name] = " + Shove._Web.Utility.FilteSqlInfusion(Name), "");

            if ((dt == null) || (dt.Rows.Count < 1))
            {
                ReturnDescription = "数据库读写错误";

                return(-1);
            }

            ID       = Shove._Convert.StrToInt(dt.Rows[0]["ID"].ToString(), 0);
            Password = dt.Rows[0]["Password"].ToString();
            Company  = dt.Rows[0]["Company"].ToString();
            Url      = dt.Rows[0]["Url"].ToString();
            State    = Shove._Convert.StrToShort(dt.Rows[0]["State"].ToString(), 0);

            return(0);
        }
Example #6
0
        public int GetInformationByID(ref string ReturnDescription)
        {
            if (ID < 0)
            {
                throw new Exception("CardPassword 尚未初始化到具体的数据实例上,请先使用 GetInformation 等获取数据信息");
            }

            DataTable dt = new SLS.Dal.Tables.T_CardPasswordAgents().Open(PF.ConnectString,"", "[ID] = " + ID, "");

            if ((dt == null) || (dt.Rows.Count < 1))
            {
                ReturnDescription = "数据库读写错误";

                return -1;
            }

            Name = dt.Rows[0]["Name"].ToString();
            Password = dt.Rows[0]["Password"].ToString();
            Company = dt.Rows[0]["Company"].ToString();
            Url = dt.Rows[0]["Url"].ToString();
            State = Shove._Convert.StrToShort(dt.Rows[0]["State"].ToString(), 0);

            return 0;
        }
Example #7
0
        public int EditByID(ref string ReturnDescription)
        {
            if (ID < 0)
            {
                throw new Exception("CardPassword 尚未初始化到具体的数据实例上,请先使用 GetInformation 等获取数据信息");
            }

            DataTable dt = new SLS.Dal.Tables.T_CardPasswordAgents().Open(PF.ConnectString,"", "[ID] = " + ID, "");

            if ((dt == null) || (dt.Rows.Count < 1))
            {
                ReturnDescription = "数据库读写错误";

                return -1;
            }

            SLS.Dal.Tables.T_CardPasswordAgents t_CardPasswordAgents = new SLS.Dal.Tables.T_CardPasswordAgents();

            t_CardPasswordAgents.Company.Value = Company;
            t_CardPasswordAgents.Password.Value = Password;
            t_CardPasswordAgents.Name.Value = Name;
            t_CardPasswordAgents.State.Value = State;
            t_CardPasswordAgents.Url.Value = Url;

            t_CardPasswordAgents.Update(PF.ConnectString,"[ID] = " + ID.ToString());

            return 0;
        }
Example #8
0
        public int GetInformationByName(ref string ReturnDescription)
        {
            if (Name == "")
            {
                throw new Exception("CardPassword 尚未初始化到具体的数据实例上,请先使用 GetInformation 等获取数据信息");
            }

            DataTable dt = new SLS.Dal.Tables.T_CardPasswordAgents().Open(PF.ConnectString,"", "[Name] = " + Shove._Web.Utility.FilteSqlInfusion(Name), "");

            if ((dt == null) || (dt.Rows.Count < 1))
            {
                ReturnDescription = "数据库读写错误";

                return -1;
            }

            ID = Shove._Convert.StrToInt(dt.Rows[0]["ID"].ToString(), 0);
            Password = dt.Rows[0]["Password"].ToString();
            Company = dt.Rows[0]["Company"].ToString();
            Url = dt.Rows[0]["Url"].ToString();
            State = Shove._Convert.StrToShort(dt.Rows[0]["State"].ToString(), 0);

            return 0;
        }