protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            string str2;
            int    result = 0;

            int.TryParse(e.CommandArgument.ToString(), out result);
            if ((result > 0) && ((str2 = e.CommandName) != null))
            {
                if (str2 == "setdefault")
                {
                    DistributorGradeBrower.SetGradeDefault(result);
                    this.ReLoad(true);
                }
                else if (str2 == "del")
                {
                    string str3 = DistributorGradeBrower.DelOneGrade(result);
                    if (str3 != null)
                    {
                        if (str3 == "-1")
                        {
                            this.ShowMsg("不能删除,因为该等级下面已经有分销商!", false);
                            return;
                        }
                        if (str3 == "1")
                        {
                            this.ReLoad(true);
                            return;
                        }
                    }
                    this.ShowMsg("删除失败", false);
                }
            }
        }
示例#2
0
        protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            string str2;
            int    result = 0;

            int.TryParse(e.CommandArgument.ToString(), out result);
            if ((result > 0) && ((str2 = e.CommandName) != null))
            {
                if (!(str2 == "setdefault"))
                {
                    if (!(str2 == "del"))
                    {
                        return;
                    }
                }
                else
                {
                    DistributorGradeBrower.SetGradeDefault(result);
                    this.ReBind(true);
                    return;
                }
                switch (DistributorGradeBrower.DelOneGrade(result))
                {
                case "-1":
                    this.ShowMsg("不能删除,因为该等级下面已经有分销商!", false);
                    return;

                case "1":
                    this.ShowMsg("分销商等级删除成功!", true);
                    this.BindData();
                    return;
                }
                this.ShowMsg("删除失败", false);
            }
        }
示例#3
0
        protected void rptList_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e)
        {
            int num = 0;

            int.TryParse(e.CommandArgument.ToString(), out num);
            string commandName;

            if (num > 0 && (commandName = e.CommandName) != null)
            {
                if (commandName == "setdefault")
                {
                    DistributorGradeBrower.SetGradeDefault(num);
                    this.ReBind(true);
                    return;
                }
                if (!(commandName == "del"))
                {
                    return;
                }
                string text = DistributorGradeBrower.DelOneGrade(num);
                string a;
                if ((a = text) != null)
                {
                    if (a == "-1")
                    {
                        this.ShowMsg("不能删除,因为该等级下面已经有分销商!", false);
                        return;
                    }
                    if (a == "1")
                    {
                        this.ShowMsg("分销商等级删除成功!", true);
                        this.BindData();
                        return;
                    }
                }
                this.ShowMsg("删除失败", false);
            }
        }