入职开发工作3个月的总结

1、JS中使用c#变量  @+变量名

    js中变量转换  转为int型:Number(变量名),转为字符串:String("变量名")  

2、js弹出窗口传值

   父页面:var reValue = window.showModalDialog('TotalProgess?id='+subStr, obj, 'dialogWidth=400px;dialogHeight=200px;');

   父页面使用值:reValue[0],reValue[1] .....

   子页面:

var arr = new Array();
arr[0] = _ProcessDescript;
arr[1] = _ProduceDescript;
arr[2] = _DeliverDt;
arr[3] = _Remark;
window.returnValue = arr;

3、SQL拼接字符串:

select ApproveDt=case when ApproveDtaa=case when DATEDIFF(DAY,ApproveDt,GETDATE())>20 then '未开始' else '11' end
from tablename

4、ViewData传递datatable

                  控制器代码:

List lisdt = new List();
lisdt.Add(dt);
lisdt.Add(dt2);
ViewData["lis"] = lisdt;

视图代码:

@using System.Web;
@model System.Data.DataTable
@using System.Data;
@{List lis = ViewData["lis"] as List;
}

视图跳转页面传递datatable









@Html.Partial("test1", lis[0])


@Html.Partial("test2", lis[1])



5、SQL合并行

ALTER FUNCTION [dbo].[GetProcessByOrder]
(
@OrderNo varchar(30)
)
RETURNS [nvarchar](4000)
AS
BEGIN
DECLARE @ReturnValue [nvarchar](4000)
SET @ReturnValue = ''
SELECT @ReturnValue=@ReturnValue + RTRIM(LTRIM(state)) + ','
FROM TableName
WHERE OrderNO = @OrderNo
SET @ReturnValue = substring(@ReturnValue,1,len(@ReturnValue)-1)
RETURN @ReturnValue
END
GO

转载于:https://www.cnblogs.com/lovejunjuan/p/4971223.html

你可能感兴趣的:(入职开发工作3个月的总结)