chore: 首次簽入 Thinkyu ASP.NET 專案
- 加入 Visual Studio / ASP.NET .gitignore - 排除建置輸出、IDE 設定、NuGet packages、大型 MSI 安裝檔
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using Wellan.Data;
|
||||
|
||||
public partial class forms_basedata_fmBTME : Wellan.Web.UI.WUserControlBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
//if (IsPostBack)
|
||||
// gvBTME.DataBind();
|
||||
}
|
||||
|
||||
protected override void OnInit(EventArgs e)
|
||||
{
|
||||
base.OnInit(e);
|
||||
Form_View = fvBTME;
|
||||
Grid_View = gvBTME;
|
||||
CustomMessage = cvMessage;
|
||||
}
|
||||
|
||||
protected override bool CheckInput(IOrderedDictionary values)
|
||||
{
|
||||
var BTNME = WDAC.GetStringValue(values["BTNME"]).Trim();
|
||||
var BTSTM = WDAC.GetStringValue(values["BTSTM"]).Trim();
|
||||
var BTETM = WDAC.GetStringValue(values["BTETM"]).Trim();
|
||||
var BTRST = WDAC.GetStringValue(values["BTRST"]).Trim();
|
||||
var BTRED = WDAC.GetStringValue(values["BTRED"]).Trim();
|
||||
|
||||
bool result = true;
|
||||
CustomMessage.ErrorMessage = string.Empty;
|
||||
CustomMessage.IsValid = true;
|
||||
|
||||
if (string.IsNullOrEmpty(BTNME))
|
||||
{
|
||||
result = false;
|
||||
CustomMessage.IsValid = false;
|
||||
CustomMessage.ErrorMessage += "班表名稱必須輸入<br/>";
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(BTSTM))
|
||||
{
|
||||
result = false;
|
||||
CustomMessage.IsValid = false;
|
||||
CustomMessage.ErrorMessage += "上班時間必須輸入<br/>";
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(BTETM))
|
||||
{
|
||||
result = false;
|
||||
CustomMessage.IsValid = false;
|
||||
CustomMessage.ErrorMessage += "下班時間必須輸入<br/>";
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(BTSTM) && !string.IsNullOrEmpty(BTETM) && BTSTM.CompareTo(BTETM) >= 0)
|
||||
{
|
||||
result = false;
|
||||
CustomMessage.IsValid = false;
|
||||
CustomMessage.ErrorMessage += "上班時間必須早於下班時間<br/>";
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(BTRST) ^ string.IsNullOrEmpty(BTRED))
|
||||
{
|
||||
result = false;
|
||||
CustomMessage.IsValid = false;
|
||||
CustomMessage.ErrorMessage += "午休開始時間與午休結束時間必須同時輸入或同時不輸入<br/>";
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(BTRST) && !string.IsNullOrEmpty(BTRED) && BTRST.CompareTo(BTRED) >= 0)
|
||||
{
|
||||
result = false;
|
||||
CustomMessage.IsValid = false;
|
||||
CustomMessage.ErrorMessage += "午休開始時間必須早於午休結束時間<br/>";
|
||||
}
|
||||
|
||||
ProcessCustomValidatorMessage(CustomMessage);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user