zoukankan      html  css  js  c++  java
  • .net变量判断

        <div class="AccountLevel" style="margin-top: 15px;">
                    <span style="float: left;">账户安全等级:</span>
                    @{
                        int levelValue = 0;
                        string levelName = "低";
                        string progressBarName = "progress-bar-warning";默认橘黄色
                        if (Model.CustomerInfo != null)
                        {
                            if (Model.CustomerInfo.IsPassWord != null && Model.CustomerInfo.IsPassWord.Value)
                            {
                                levelValue += 25;
                            }
                            if (Model.CustomerInfo.IsMobile != null && Model.CustomerInfo.IsMobile.Value)
                            {
                                levelValue += 25;
                            }
                            if (Model.CustomerInfo.IsEmail != null && Model.CustomerInfo.IsEmail.Value)
                            {
                                levelValue += 25;
                            }
                            if (Model.CustomerInfo.IsIdentity != null && Model.CustomerInfo.IsIdentity.Value)
                            {
                                levelValue += 25;
                            }
                            if (levelValue >= 50 && levelValue < 75)
                            {
                                levelName = "中";
                            }
                            else if (levelValue >= 75)
                            {
                                levelName = "高";
                                progressBarName = "progress-bar-success";判断之后绿色
                            }
                        }
                        string level = levelValue + "%";
                        <div class="progress progressDiv" style="margin-top: 10px;">
                            <div class="progress-bar @progressBarName" role="progressbar"
                                            aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style=" @level; line-height: 12px;"
                                            id="accountLevel">
                                <span id="accountLevelValue">@level</span>
                            </div>
                        </div>
                        <span id="accountLevelName">@levelName</span>
                                               if (levelName != "高")
                                               {
                        <span class="Enhance"><a href="/AccountSetting/Index?tab=safety">提升</a></span>
                                               }
                    }
                </div>

  • 相关阅读:
    Vue 3 组件开发:搭建基于SpreadJS的表格编辑系统(环境搭建)
    纵观 ActiveX 平台的兴衰史,看开发控件的技术演变
    mysql函数
    SQL Server 连接字符串和身份验证
    http Content type
    C中二叉排序树的非递归和递归插入操作以及中序遍历代码实现【可运行】
    带头结点和不带头结点的链栈基本操作
    小程序开发日记-14悼篮球兄弟
    小程序开发日记-13 NetworkTimeout
    小程序开发日记-12 SSL证书及相关
  • 原文地址:https://www.cnblogs.com/zhouyx/p/5201474.html
Copyright © 2011-2022 走看看