本文整理汇总了C#中PIC.VDS2G.ACM.CAA.CAACommon.Get_Byte_Length方法的典型用法代码示例。如果您正苦于以下问题:C# CAACommon.Get_Byte_Length方法的具体用法?C# CAACommon.Get_Byte_Length怎么用?C# CAACommon.Get_Byte_Length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PIC.VDS2G.ACM.CAA.CAACommon
的用法示例。
在下文中一共展示了CAACommon.Get_Byte_Length方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Check_Condition
/// <summary>
/// 檢查條件
/// </summary>
/// <param name="s_Type"></param>
/// <returns></returns>
private ArrayList Check_Condition(string s_Type)
{
#region 宣告
CAAModel.CAACommon CAAComm = new CAAModel.CAACommon();
ArrayList arl_Return = new ArrayList();
arl_Return.Add(string.Empty);//該欄位放Focus欄位之ClientID
arl_Return.Add(string.Empty);//該欄位放錯誤訊息
#endregion
#region BUTTON [儲存]鈕,編輯狀態
if (s_Type == "BUTTON [儲存]鈕,編輯狀態")
{
#region 檢查日期格式
arl_Return = CAAComm.Check_Format_Date(this.slp_SAL_DATE.Text, "欄位[營業日期]日期格式錯誤", "1", this.slp_SAL_DATE.DateTextBox.ClientID, arl_Return);
arl_Return = CAAComm.Check_Format_Date(this.txt_COLL_DATE.Text, "欄位[交易日期]日期格式錯誤", "1", this.txt_COLL_DATE.ClientID, arl_Return);
arl_Return = CAAComm.Check_Format_Date(this.txt_COLL_TIME.Text, "欄位[交易時間]時間格式錯誤", "1", this.txt_COLL_TIME.ClientID, arl_Return);
#endregion
#region 檢查數字格式
arl_Return = CAAComm.Check_Format_Int(this.txt_COLL_SEQNO.Text, "欄位[交易序號]數字格式錯誤", "64", "1", this.txt_COLL_SEQNO.ClientID, arl_Return);
arl_Return = CAAComm.Check_Format_Int(this.txt_PAY_CHKNO.Text, "欄位[繳款識別碼]數字格式錯誤", "32", "1", this.txt_PAY_CHKNO.ClientID, arl_Return);
#endregion
#region 檢查欄位的Byte長度
if (CAAComm.Get_Byte_Length(this.txt_COLL_SEQNO.Text) > 10)
{ arl_Return = CAAComm.ToMakeUp_Err_ArrayList(arl_Return, "欄位[交易序號]長度不可大於 10 Byte", "1", this.txt_COLL_SEQNO.ClientID); }
if (CAAComm.Get_Byte_Length(this.txt_PAY_CHKNO.Text) > 9)
{ arl_Return = CAAComm.ToMakeUp_Err_ArrayList(arl_Return, "欄位[繳款識別碼]長度不可大於 9 Byte", "1", this.txt_PAY_CHKNO.ClientID); }
if (CAAComm.Get_Byte_Length(this.txt_MEMO.Text) > 200)
{ arl_Return = CAAComm.ToMakeUp_Err_ArrayList(arl_Return, "欄位[原因說明]長度不可大於 200 Byte", "1", this.txt_MEMO.ClientID); }
#endregion
#region 檢查必填欄位
arl_Return = CAAComm.Check_MustFillin_Column(this.slp_CHARGE.Text, "text", "欄位[手續費]為必填欄位", "1", this.slp_CHARGE.TextBox_Code.ClientID, arl_Return);
#endregion
}
#endregion
#region BUTTON [編輯]鈕,檢視狀態
else if (s_Type == "BUTTON [編輯]鈕,檢視狀態")
{
}
#endregion
return arl_Return;
}
示例2: Check_Condition
/// <summary>
/// 檢查條件
/// </summary>
/// <param name="s_Type"></param>
/// <returns></returns>
private ArrayList Check_Condition(string s_Type)
{
#region 宣告
BCO.CAACommon CAAComm = new BCO.CAACommon();
ArrayList arl_Return = new ArrayList();
arl_Return.Add(string.Empty);//該欄位放Focus欄位之ClientID
arl_Return.Add(string.Empty);//該欄位放錯誤訊息
#endregion
#region SLP轉型
#region 銷或折讓維護區
TextBox txt_STORE_ID = (TextBox)this.slp_STORE_ID.FindControl("TextBoxCode");//店號
TextBox txt_ROOT_NO = (TextBox)this.slp_ROOT_NO.FindControl("TextBoxCode");//商品群分類
TextBox txt_DISC_DATE = (TextBox)this.slp_DISC_DATE.FindControl("TextBoxCode");//折讓日期
TextBox txt_CHG_DISC_DATE = (TextBox)this.slp_CHG_DISC_DATE.FindControl("TextBoxCode");//異動折讓日期
TextBox txt_PROOF_DATE = (TextBox)this.slp_PROOF_DATE.FindControl("TextBoxCode");//憑證已回日期
TextBox txt_CANCEL_DATE = (TextBox)this.slp_CANCEL_DATE.FindControl("TextBoxCode");//作廢日期
TextBox txt_PERIOD_DATE = (TextBox)this.slp_PERIOD_DATE.FindControl("TextBoxCode");//申報日期
TextBox txt_TEMPORAL_DATE = (TextBox)this.slp_TEMPORAL_DATE.FindControl("TextBoxCode");//暫收日期
TextBox txt_DISC_UAMT = (TextBox)this.slp_DISC_UAMT.FindControl("TextBoxCode");//折讓金額(未稅)
TextBox txt_DISC_TAX = (TextBox)this.slp_DISC_TAX.FindControl("TextBoxCode");//折讓稅額
TextBox txt_DISC_AMT = (TextBox)this.slp_DISC_AMT.FindControl("TextBoxCode");//總金額
TextBox txt_CLOSE_MONTH = (TextBox)((ASP.wui_slp_slp_numberupdown_ascx)this.slp_CLOSE_MONTH.FindControl("SLP_NumberUpDown1")).FindControl("TextBoxCode");//結帳年月
DropDownList drop_DISC_SOURCE = (DropDownList)this.slp_DISC_SOURCE.FindControl("D1");//來源
DropDownList drop_DISC_TYPE = (DropDownList)this.slp_DISC_TYPE.FindControl("D1");//型式
DropDownList drop_TAX_TYPE = (DropDownList)this.slp_TAX_TYPE.FindControl("D1");//稅別
#endregion
#region 折讓項目區
TextBox txt_Disc_INV_DATE = (TextBox)this.slp_Disc_INV_DATE.FindControl("TextBoxCode");//發票日期
TextBox txt_Disc_DISC_UAMT = (TextBox)this.slp_Disc_DISC_UAMT.FindControl("TextBoxCode");//折讓金額(未稅)
TextBox txt_Disc_DISC_TAX = (TextBox)this.slp_Disc_DISC_TAX.FindControl("TextBoxCode");//折讓稅額
TextBox txt_Disc_NON_INV_UAMT = (TextBox)this.slp_Disc_NON_INV_UAMT.FindControl("TextBoxCode");//發票餘額(未稅)
TextBox txt_Disc_NON_INV_TAX = (TextBox)this.slp_Disc_NON_INV_TAX.FindControl("TextBoxCode");//發票稅額
#endregion
#endregion
#region BUTTON [儲存]鈕
#region 新增狀態
if (s_Type == "BUTTON [儲存]鈕,新增狀態")
{
#region 檢查欄位的Byte長度
if (CAAComm.Get_Byte_Length(this.txt_ACT_DISC_NO.Text) > 13)
{ arl_Return = CAAComm.ToMakeUp_Err_ArrayList(arl_Return, "欄位[財會折讓單號]長度不可大於 13 Byte", "1", this.txt_ACT_DISC_NO.ClientID); }
if (CAAComm.Get_Byte_Length(this.txt_REPROOF_NO.Text) > 12)
{ arl_Return = CAAComm.ToMakeUp_Err_ArrayList(arl_Return, "欄位[發票號碼/收據]長度不可大於 12 Byte", "1", this.txt_REPROOF_NO.ClientID); }
if (CAAComm.Get_Byte_Length(this.txt_RFNO.Text) > 10)
{ arl_Return = CAAComm.ToMakeUp_Err_ArrayList(arl_Return, "欄位[統一編號]長度不可大於 10 Byte", "1", this.txt_RFNO.ClientID); }
if (CAAComm.Get_Byte_Length(this.txt_MEMO.Text) > 200)
{ arl_Return = CAAComm.ToMakeUp_Err_ArrayList(arl_Return, "欄位[備註]長度不可大於 200 Byte", "1", this.txt_MEMO.ClientID); }
#endregion
#region 檢查SLP日期格式
arl_Return = CAAComm.Check_Format_Date(this.slp_DISC_DATE.Text, "欄位[折讓日期]日期格式錯誤", "1", txt_DISC_DATE.ClientID, arl_Return);
arl_Return = CAAComm.Check_Format_Date(this.slp_CHG_DISC_DATE.Text, "欄位[異動折讓日期]日期格式錯誤", "1", txt_DISC_DATE.ClientID, arl_Return);
arl_Return = CAAComm.Check_Format_Date(this.slp_PROOF_DATE.Text, "欄位[憑證已回日期]日期格式錯誤", "1", txt_PROOF_DATE.ClientID, arl_Return);
arl_Return = CAAComm.Check_Format_Date(this.slp_CANCEL_DATE.Text, "欄位[作廢日期]日期格式錯誤", "1", txt_CANCEL_DATE.ClientID, arl_Return);
arl_Return = CAAComm.Check_Format_Date(this.slp_PERIOD_DATE.Text, "欄位[申報日期]日期格式錯誤", "1", txt_PERIOD_DATE.ClientID, arl_Return);
arl_Return = CAAComm.Check_Format_Date(this.slp_TEMPORAL_DATE.Text, "欄位[暫收日期]日期格式錯誤", "1", txt_TEMPORAL_DATE.ClientID, arl_Return);
#endregion
#region 檢查SLP數字格式
arl_Return = CAAComm.Check_Format_Int(this.slp_DISC_UAMT.Text, "欄位[折讓金額(未稅)]數字格式錯誤", "32", "1", txt_DISC_UAMT.ClientID, arl_Return);
arl_Return = CAAComm.Check_Format_Int(this.slp_DISC_TAX.Text, "欄位[折讓稅額]數字格式錯誤", "32", "1", txt_DISC_TAX.ClientID, arl_Return);
arl_Return = CAAComm.Check_Format_Int(Request[txt_DISC_AMT.UniqueID].ToString(), "欄位[總金額]數字格式錯誤", "32", "1", txt_DISC_AMT.ClientID, arl_Return);
#endregion
#region 檢查SLP年月格式
arl_Return = CAAComm.Check_Format_YearMonth(this.slp_CLOSE_MONTH.Text, "欄位[結帳年月]年月格式錯誤", "1", txt_CLOSE_MONTH.ClientID, arl_Return);
arl_Return = CAAComm.Check_Format_YearMonth(this.slp_CLOSE_MONTH_ACCT.Text, "欄位[結帳年月-財會]年月格式錯誤", "1", this.slp_CLOSE_MONTH_ACCT.TextBoxCode_Object.ClientID, arl_Return);
#endregion
#region 檢查必填欄位
arl_Return = CAAComm.Check_MustFillin_Column(drop_DISC_SOURCE.SelectedIndex.ToString(), "drop", "欄位[來源]為必填欄位", "1", string.Empty, arl_Return);
arl_Return = CAAComm.Check_MustFillin_Column(this.slp_STORE_ID.Text, "text", "欄位[店號]為必填欄位", "1", txt_STORE_ID.ClientID, arl_Return);
//.........这里部分代码省略.........
示例3: Collate_Information_Disc
//.........这里部分代码省略.........
string s_Disc_Total_String = string.Empty;
#endregion
//一張折讓對帳單是[一式四份]
for (int b = 0; b < 4; b++)
{
#region 將發票資料寫入TempTable
//一式包含[五張發票]
for (int c = 0; c < 5; c++)
{
if (arl_Inv_Statistics.Count > 0 &&
arl_Inv_Statistics[a * 5 + c].ToString() != "空白")
{
int i_dr_Temp_Main2_Count = int.Parse(((string[])(arl_Inv_Statistics[a * 5 + c]))[1].ToString());
#region 將發票日期由西元年轉換成民國年
DateTime d_INV_DATE = DateTime.Parse(dr_Temp_Main2[i_dr_Temp_Main2_Count]["INV_DATE"].ToString());
string s_INV_Year = g_TaiwanCalendar.GetYear(d_INV_DATE).ToString(); //發票日期(年)
string s_INV_Month = g_TaiwanCalendar.GetMonth(d_INV_DATE).ToString(); //發票日期(月)
string s_INV_Date = g_TaiwanCalendar.GetDayOfMonth(d_INV_DATE).ToString(); //發票日期(日)
#endregion
#region 設定[字軌號碼][品名][數量]
BCO.CAACommon CAAComm = new BCO.CAACommon();
string s_Item_Name = string.Empty;
int i_Item_Name_Length = 0;
s_Item_Name = dr_Temp_Main2[i_dr_Temp_Main2_Count]["ITEM_NAME"].ToString().Trim();
i_Item_Name_Length = CAAComm.Get_Byte_Length(s_Item_Name);
//如果[品名]的byte長度超過16,則一次減掉一個字
//減到[品名]的byte長度小於或等於16,則跳出迴圈
if (i_Item_Name_Length > 16)
{
for (int i_Length = 0; i_Length < s_Item_Name.Length; i_Length++)
{
if (CAAComm.Get_Byte_Length(s_Item_Name.Substring(0, s_Item_Name.Length - i_Length)) <= 16)
{
s_Item_Name = s_Item_Name.Substring(0, s_Item_Name.Length - i_Length) + string.Empty.PadRight(16 - CAAComm.Get_Byte_Length(s_Item_Name.Substring(0, s_Item_Name.Length - i_Length)), ' ');
break;
}
}
}
else
{ s_Item_Name = s_Item_Name + string.Empty.PadRight(16 - CAAComm.Get_Byte_Length(s_Item_Name), ' '); }
#endregion
#region 將資料寫入Temp Table
dr_Temp_Result["MAIN_RIGHT_Detl_" + b.ToString() + "_" + c.ToString() + "_0"] = dr_Temp_Main2[i_dr_Temp_Main2_Count]["INV_FORM"].ToString();//聯式
dr_Temp_Result["MAIN_RIGHT_Detl_" + b.ToString() + "_" + c.ToString() + "_1"] = s_INV_Year;//年
dr_Temp_Result["MAIN_RIGHT_Detl_" + b.ToString() + "_" + c.ToString() + "_2"] = s_INV_Month;//月
dr_Temp_Result["MAIN_RIGHT_Detl_" + b.ToString() + "_" + c.ToString() + "_3"] = s_INV_Date;//日
dr_Temp_Result["MAIN_RIGHT_Detl_" + b.ToString() + "_" + c.ToString() + "_4"] = dr_Temp_Main2[i_dr_Temp_Main2_Count]["INV_NO"].ToString().Trim();//字軌號碼
dr_Temp_Result["MAIN_RIGHT_Detl_" + b.ToString() + "_" + c.ToString() + "_4"] += string.Empty.PadLeft(1, ' ');//字軌號碼與品名之間的空白(全形空白)
dr_Temp_Result["MAIN_RIGHT_Detl_" + b.ToString() + "_" + c.ToString() + "_4"] += s_Item_Name;//品名
dr_Temp_Result["MAIN_RIGHT_Detl_" + b.ToString() + "_" + c.ToString() + "_4"] += string.Empty.PadLeft(1, ' ');//品名與數量之間的空白(全形空白)
dr_Temp_Result["MAIN_RIGHT_Detl_" + b.ToString() + "_" + c.ToString() + "_4"] += "1";//數量
dr_Temp_Result["MAIN_RIGHT_Detl_" + b.ToString() + "_" + c.ToString() + "_5"] = dr_Temp_Main2[i_dr_Temp_Main2_Count]["DISC_UAMT"].ToString();//末稅金額