排班知识点

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值