Exemple #1
0
        public static string IsCanUpdateDistributorSuperior(int userid, int tosuperuserid)
        {
            string text = "1";
            string result;

            if (userid == tosuperuserid)
            {
                result = "不能将自己设置为自己的上级";
            }
            else
            {
                int num = tosuperuserid;
                while (true)
                {
                    int distributorSuperiorId = DistributorsBrower.GetDistributorSuperiorId(num);
                    if (distributorSuperiorId == num || distributorSuperiorId == 0)
                    {
                        break;
                    }
                    num = distributorSuperiorId;
                    if (num == userid)
                    {
                        goto Block_4;
                    }
                }
                goto IL_63;
Block_4:
                text = "0";
IL_63:
                if (text != "1")
                {
                    text = "不能将同一主线上的下级分销商设置为自己的上级";
                }
                result = text;
            }
            return(result);
        }