This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// スクリプトタグ削除(タグのみ削除、空白は削除しない) | |
function TagDelete(Text) { | |
if (Text == "" || Text == null) | |
return ""; | |
//スクリプト文字 | |
Text = Text.replace(/</g, "<");//"<"をコードに変換(タグ無効化) | |
Text = Text.replace(/>/g, ">"); //">"をコードに変換(タグ無効化) | |
Text = Text.replace(/(<([^>]+)>)/ig, ""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// timestampより経過時間を取得 | |
function GetLapsedTime(timestamp) { | |
if (timestamp == "" || timestamp == null || timestamp == "0") { | |
return ""; | |
} | |
//timestampをdateに変換 | |
var d = new Date(timestamp * 1000); | |
var year = d.getFullYear(); | |
var month = d.getMonth() + 1; | |
var day = d.getDate(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//指定した長さで文字列を切る | |
function GetStringByByte(str, num) { | |
len = 0; | |
estr = escape(str); | |
ostr = ""; | |
for (i = 0; i < estr.length; i++) { | |
len++; | |
ostr = ostr + estr.charAt(i); | |
if (estr.charAt(i) == "%") { | |
i++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<item> | |
<content> | |
<title>title1</title> | |
<desc>desc2</desc> | |
<flag>1</flag> | |
</content> | |
<content> | |
<title>title2</title> | |
<desc>desc2</desc> | |
<flag>2</flag> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DateTimeより経過時間を取得 | |
public static string GetLapsedTimeFromDateTime(DateTime dt) | |
{ | |
string timeString = string.Empty; | |
TimeSpan ts = DateTime.Now.Subtract(dt); | |
int DayPeriod = Math.Abs(ts.Days); | |
if (DayPeriod < 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using OfficeOpenXml; | |
// テンプレートファイルを元にDBから取得した値を指定したセルに設定したい場合、且つbyte[]をエクセルでファイルダウンロードさせる場合 | |
byte[] source; | |
MemoryStream stream = new MemoryStream(); | |
using (var template = System.IO.File.OpenRead(AppDomain.CurrentDomain.BaseDirectory + "/App_Data/template.xlsx")) | |
using (var package = new ExcelPackage(stream, template)) | |
{ | |
ExcelWorksheet worksheet = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Configuration; | |
using System.Runtime.InteropServices; | |
namespace Publisher.Network | |
{ | |
public class DriveSettings | |
{ | |
private enum ResourceScope | |
{ | |
RESOURCE_CONNECTED = 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using OfficeOpenXml; | |
using OfficeOpenXml.Style; | |
/// <summary> | |
/// Modelデータを元にExcel作成 | |
/// </summary> | |
/// <param name="excelModel"></param> | |
/// <returns>byte[]</returns> | |
public byte[] MakeDetailsAsExcel(ContractExcelModel excelModel) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using iTextSharp.text; | |
using iTextSharp.text.pdf; | |
/// <summary> | |
/// PDFファイルを作成 | |
/// ※1、フォーマット用のPDFファイルがある場合 | |
/// ※2、複数枚のPDFを連続に出力する場合も対応可能 | |
/// ※3、ウェブ・バッチ両方から呼ばれる場合を想定(共通ロジック) | |
/// </summary> | |
/// <param name="pdfStream">PDFストリーム</param> |
OlderNewer