zoukankan      html  css  js  c++  java
  • 排班知识点

    1.Sql中getDate()在查询语句中的用法

    select *  FROM V_MANAGERPLAN  where  
    (SEAT_ID in (45,46)) and  (GETDATE() between  BeginTime and  EndTime) 
     order by Shift_sortid,seatSort
    View Code

    2.日期加星期(示例:2017-12-22 星期五)

    <span class="sWeek">
                    <%=DateTime.Now.ToString("yyyy-MM-dd") %> <%=System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.DayOfWeek)%></span>
    View Code

    3.定时器间隔多少毫秒执行

    var time1=$.trim($("#sUserName1").html() == "暂无排班信息")==true?30000:1800000;
            setInterval(function () { LoadScheduling(); }, time1);
    View Code

    4.日期js(示例:2017/12/22)

     var nowtime = new Date();
            var time = nowtime.getFullYear() + "-" + nowtime.getMonth() + "-" + nowtime.getDate();
            var starttime = time + " 8:40";
            var endtime = time + " 9:40";
            var stime = new Date(starttime.replace("-", "/").replace("-", "/"));
            var etime = new Date(endtime.replace("-", "/").replace("-", "/"));
    View Code

    5.下边款虚线

    border-bottom: 1px dashed #666;
    View Code

    5.圆角、子间距

        border-radius: 19px;
        letter-spacing: 2px;
    View Code

    6.MVC跳转列表,打开新窗口

     <a href="/Desktop/Scheduling"
                    target="_blank"><span class="<%=btnclass %>"><%=seeAll %></span></a>
    View Code

    7.sql为账户指定默认数据库

    8.Regex正则

     Regex reg = new Regex(@"^[0-9]*$");
                    sid = !reg.IsMatch(t) ? "" : sid;
    View Code

    IsMatch():指定的输入字符串中找到的匹配项,找到返回true,否则返回false.

    9.允许为null

    public ActionResult Scheduling(DateTime? StartTime, DateTime? EndTime, string sid)
            {
                DateTime stime = StartTime == null ? DateTime.Now.AddDays(-1) : DateTime.Parse(StartTime.ToString());
                DateTime etime = EndTime == null ? DateTime.Now.AddDays(1) : DateTime.Parse(EndTime.ToString());
    View Code

    10.??

    string strParam = Request.Params["param"];
    if ( strParam== null )
    {
        strParam= "";
    }
     
    string strParam=
      Request.Params["param"] == null ? "": Request.Params["param"];
    
    //如果左边为null,取所赋值??右边的
    //比如int y = x ?? -1 如果x为空,那么y的值为-1.
    string strParam= Request.Params["param"]?? "";
    View Code
    另外还有”?(单问号)“修饰符,是System.Nullable的缩写形式,比如int?代表是可空的整形,
    例如:int? a = 1 或者 int? b=null
    收藏
    关注
    评论
  • 相关阅读:
    rsync 配置
    DNS主从服务,子域授权,view视图,日志系统,压力测试
    ubuntu VNC server 黑屏 yum源更新(ubuntu16.04)
    HTTPD服务 openssl的https服务机制
    vmware Esxi 更换管理网卡IP
    httpd 虚拟主机建立之访问机制及其日志定义
    pxe kickstart 配置+TFTP+NFS多版本系统部署
    Linux nohup不输出日志文件的方法
    Tomcat部署时war和war exploded区别
    vim编辑超大文件
  • 原文地址:https://www.cnblogs.com/yidengbone/p/8085387.html
Copyright © 2011-2022 走看看