Spiga

ajax 維護 div 的 scrollbar

2012-02-02 16:59 by Koy, 3 visits, 网摘, 收藏, 编辑
摘要:<!-- Maintain Scroll Position after Asynchronous Postback --><script type="text/javascript"> var xPos, yPos; var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_beginRequest(BeginRequestHandler); prm.add_endRequest(EndRequestHandler); function BeginRequestHandler(s 阅读全文

每日构建的好工具

2011-10-26 12:16 by Koy, 11 visits, 网摘, 收藏, 编辑
摘要:http://sourceforge.net/projects/r2build/ 阅读全文

修正了Flex Tree 控件在動態加載節點后 Scrollbar 沒有立即出現的問題

2011-09-16 15:49 by Koy, 21 visits, 网摘, 收藏, 编辑
摘要:var _loadSubFolder:Function = function(children:Array):void{node.children = new ArrayCollection(children);for each(var glossaryfolder:Object in node.children){if(glossaryfolder.child_count > 0){glossaryfolder.children = childrenMark; //replace the template}}//very important for showing tree scrol 阅读全文

根據基本目錄及文件的全路逕,創建相應的子目錄,爲保存文件作準備

2010-12-13 12:00 by Koy, 11 visits, 网摘, 收藏, 编辑
摘要:public static string GenerateDirectoryByFileFullPath(string basePath, string fileFullPath){ DirectoryInfo dirInfo = new DirectoryInfo(basePath); string fileName = new DirectoryInfo(fileFullPath).Name; string subDir = fileFullPath.Replace(basePath, "").Replace(fileName, "").Trim('\\'); return dirInfo 阅读全文

轉載:Sqlserver 2005 利用 with 創建臨時表進行遞歸查詢

2010-08-16 12:56 by Koy, 91 visits, 网摘, 收藏, 编辑
摘要:轉載1自:http://www.cnblogs.com/kingimg/archive/2009/02/05/1384410.html使用SQL2005 递归查询结合Row_Number()实现完全SQL端树排序在实际应用中,我们经常需要用到树型结构功能,数据库结构一般如下即用一个ParentID来标识该节点从属关系。为了最终生成一棵树,一般做法是把记录选出来,然后在程序里递归重新排好序后再呈现出... 阅读全文

計算某天屬於當月的第幾週的簡單方法(最終版)

2010-08-11 17:35 by Koy, 46 visits, 网摘, 收藏, 编辑
摘要:using System;using System.Collections.Generic;using System.Text;namespace PMSLib.Utils { public sealed class SpecialDateTime { private int _year, _month, _day; private int _week; private int _maxDays;... 阅读全文

轉載:Case具有两种格式。简单Case函数和Case搜索函数。

2010-08-11 11:05 by Koy, 24 visits, 网摘, 收藏, 编辑
摘要:轉載自:http://topic.csdn.net/u/20090304/15/e827ea69-3d56-4557-abae-d5701ee24330.htmlCase具有两种格式。简单Case函数和Case搜索函数。 --简单Case函数CASE sex WHEN '1' THEN '男' WHEN '2' THEN '女'ELSE '其他' END--Case搜索函数CASE WHEN se... 阅读全文

使用 Using 語句釋放有限的資源

2010-08-09 17:11 by Koy, 41 visits, 网摘, 收藏, 编辑
摘要:遇到一個老問題,開始很清楚解決辦法,後來變得不清楚了(因爲我解釋不了該辦法爲什麽是正確的)。相信很多人都遇到使用 SqlDataReader 的時候,出現連接池不足的問題,其根本原因就是打開數據庫連接而沒有關閉,即是 SqlConnection 對象連接的關閉。有很多人不放心使用 using 語句來關閉而選擇顯式的使用 SqlConnection.Close() 方法來關閉。很有可能是因爲對 us... 阅读全文

一個簡單的排班方法

2010-07-23 23:06 by Koy, 83 visits, 网摘, 收藏, 编辑
摘要:目的:排出 2010年1~12月的A.P.N排班記錄void Main(){ IList<Schedule> schedules = new List<Schedule>(); int year = 2010; int[] months = {1,2,3,4,5,6,7,8,9,10,11,12}; foreach(int i in months){ int maxD... 阅读全文

轉載:利用List的Sort()、Find()、FindAll()、Exist()來解決一些問題

2010-07-22 11:33 by Koy, 35 visits, 网摘, 收藏, 编辑
摘要:[ASP.NET]利用List的Sort()、Find()、FindAll()、Exist()來解決一些問題轉載自:http://www.dotblogs.com.tw/puma/archive/2009/05/28/asp.net-generic-list-sort-find-findall-exsit.aspx最近寫案子常常用到List<T>,這個東西還真好用因為它有下列東西:Li... 阅读全文