migrate to new git
This commit is contained in:
73
web/App_Code/Model/Partial/accounting.cs
Normal file
73
web/App_Code/Model/Partial/accounting.cs
Normal file
@@ -0,0 +1,73 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
// 為對應資料表MODEL宣告額外參數類別(Metadata)
|
||||
// [JsonIgnore] 避免WEBAPI自動抓關聯資料
|
||||
[MetadataType(typeof(accountingMetadata))]
|
||||
public partial class accounting
|
||||
{
|
||||
private class accountingMetadata
|
||||
{
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual accounting_kind accounting_kind { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual accounting_kind2 accounting_kind2 { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual member member { get; set; }
|
||||
}
|
||||
|
||||
public const int KindLevelMax = 3; //收支層數
|
||||
public const int KindLevelMax2 = 1; //帳戶層數
|
||||
public const string Dir = "~/upload/accounting"; //圖片上傳位置
|
||||
public string log;
|
||||
|
||||
public enum type : int //收支類別
|
||||
{
|
||||
[Description("收入")]
|
||||
Receipts = 1,
|
||||
[Description("支出")]
|
||||
Expenses = 2
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public partial class accounting_kind
|
||||
{
|
||||
private class accounting_kindMetadata
|
||||
{
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<accounting> accountings { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public partial class accounting_kind2
|
||||
{
|
||||
private class accounting_kind2Metadata
|
||||
{
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<accounting> accountings { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<pro_order_record> pro_order_record { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
33
web/App_Code/Model/Partial/act_bom.cs
Normal file
33
web/App_Code/Model/Partial/act_bom.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Activities;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Http;
|
||||
using Model;
|
||||
|
||||
/// <summary>
|
||||
/// Summary description for act_bom
|
||||
/// </summary>
|
||||
// 為對應資料表MODEL宣告額外參數類別(Metadata)
|
||||
// [JsonIgnore] 避免WEBAPI自動抓關聯資料
|
||||
[MetadataType(typeof(act_bomMetadata))]
|
||||
public class act_bom
|
||||
{
|
||||
private class act_bomMetadata
|
||||
{
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<act_bom> act_bom1 { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual act_bom act_bom2 { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual actItem actItem { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
114
web/App_Code/Model/Partial/activity.cs
Normal file
114
web/App_Code/Model/Partial/activity.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
// 為對應資料表MODEL宣告額外參數類別(Metadata)
|
||||
// [JsonIgnore] 避免WEBAPI自動抓關聯資料
|
||||
[MetadataType(typeof(activityMetadata))]
|
||||
public partial class activity
|
||||
{
|
||||
private class activityMetadata
|
||||
{
|
||||
[JsonIgnore]
|
||||
public virtual activity_kind activity_kind { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual activity_category_kind activity_category_kind { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<activity_relating> activity_relating { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<activity_spares> activity_spares { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<activity_check> activity_check { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<news> news { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<pro_order> pro_order { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<stock> stocks { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<accounting> accountings { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<transfer_register> transfer_register { get; set; }
|
||||
|
||||
|
||||
}
|
||||
public const int KindLevelMax = 3; //活動分類頁面層數
|
||||
public const int ItemLevelMax = 3; //項目類別頁面層數
|
||||
|
||||
public enum category : int
|
||||
{
|
||||
[Description("報名項目")]
|
||||
SignUp = 1,
|
||||
[Description("掛單項目")]
|
||||
Order = 2,
|
||||
[Description("備品項目")]
|
||||
Spares = 3,
|
||||
[Description("贊助項目")]
|
||||
Patronize = 4
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
[MetadataType(typeof(actItemMetadata))]
|
||||
public partial class actItem
|
||||
{
|
||||
private class actItemMetadata
|
||||
{
|
||||
[JsonIgnore]
|
||||
public virtual actItem_kind actItem_kind { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<actItem_files> actItem_files { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<activity_kind_detail> activity_kind_detail { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<activity_relating> activity_relating { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<activity_spares> activity_spares { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<pro_order_detail> pro_order_detail { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<project> projects { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<stock> stocks { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<act_bom> act_bom { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<transfer_register> transfer_register { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
[MetadataType(typeof(activity_checkMetadata))]
|
||||
public partial class activity_check
|
||||
{
|
||||
private class activity_checkMetadata
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public enum keyin1 : int
|
||||
{
|
||||
[Description("報到")]
|
||||
CheckIn = 1,
|
||||
[Description("離開")]
|
||||
CheckOut = 2
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
183
web/App_Code/Model/Partial/admin.cs
Normal file
183
web/App_Code/Model/Partial/admin.cs
Normal file
@@ -0,0 +1,183 @@
|
||||
using MyWeb;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Data.Entity.Validation;
|
||||
using System.Data.OleDb;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
|
||||
|
||||
namespace Model
|
||||
{
|
||||
// 為對應資料表MODEL宣告額外參數類別(Metadata)
|
||||
// [JsonIgnore] 避免WEBAPI自動抓關聯資料
|
||||
[MetadataType(typeof(adminMetadata))]
|
||||
public partial class admin
|
||||
{
|
||||
private class adminMetadata
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static string MyIP
|
||||
{
|
||||
get
|
||||
{
|
||||
return ip.Get();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MetadataType(typeof(admin_logMetadata))]
|
||||
public partial class admin_log
|
||||
{
|
||||
private Model.ezEntities _db = new Model.ezEntities();
|
||||
|
||||
private class admin_logMetadata
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public enum Systems
|
||||
{
|
||||
[Description("公告")]
|
||||
News = 1,
|
||||
[Description("信眾")]
|
||||
Follower = 2,
|
||||
[Description("活動")]
|
||||
Activity = 3,
|
||||
[Description("報名")]
|
||||
Order = 4,
|
||||
[Description("專案")]
|
||||
Project = 5,
|
||||
[Description("品項")]
|
||||
Item = 6,
|
||||
[Description("套表列印")]
|
||||
Files = 7,
|
||||
[Description("掛單")]
|
||||
Bed = 8,
|
||||
[Description("帳務")]
|
||||
Accounting = 9,
|
||||
[Description("庫存")]
|
||||
Stock = 10,
|
||||
[Description("人事")]
|
||||
HR = 11,
|
||||
[Description("供應商")]
|
||||
Supplier = 12,
|
||||
[Description("權限")]
|
||||
Power = 13,
|
||||
|
||||
}
|
||||
public enum Status
|
||||
{
|
||||
[Description("登入")]
|
||||
Login = 1,
|
||||
[Description("新增")]
|
||||
Insert = 2,
|
||||
[Description("修改")]
|
||||
Update = 3,
|
||||
[Description("刪除")]
|
||||
Delete = 4,
|
||||
[Description("排序")]
|
||||
Sort = 5,
|
||||
[Description("列印")]
|
||||
Print = 6,
|
||||
[Description("匯出Excel")]
|
||||
Excel = 7,
|
||||
|
||||
}
|
||||
public enum Detail
|
||||
{
|
||||
[Description("登入成功")]
|
||||
Success = 1,
|
||||
[Description("帳號已停用")]
|
||||
Disable = 2,
|
||||
[Description("有效期限到期")]
|
||||
Expire = 3,
|
||||
[Description("帳號或密碼錯誤")]
|
||||
Incorrect = 4,
|
||||
[Description("帳號的群組不存在")]
|
||||
GroupNotExist = 5,
|
||||
[Description("未設定使用權限")]
|
||||
PermissionsNotSet = 6
|
||||
}
|
||||
|
||||
public static string UserAgent
|
||||
{
|
||||
get
|
||||
{
|
||||
string u = HttpContext.Current.Request.ServerVariables["HTTP_USER_AGENT"];
|
||||
Regex b = new Regex(@"android.+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino", RegexOptions.IgnoreCase | RegexOptions.Multiline);
|
||||
Regex v = new Regex(@"1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-", RegexOptions.IgnoreCase | RegexOptions.Multiline);
|
||||
if ((b.IsMatch(u) || v.IsMatch(u.Substring(0, 4))))
|
||||
return "手機";
|
||||
else
|
||||
return "電腦";
|
||||
}
|
||||
}
|
||||
|
||||
#region Log
|
||||
public string LogViewBtn(List<string> arr)
|
||||
{
|
||||
string html = "<a href=\"javascript:void(0)\" class=\"btn btn-default btn-sm btn-log\" onclick=\"msgbox($(this).parent().find(\'div.d-none\').html())\" >查看清單</a>";
|
||||
html += $"<div class=\"d-none\">{string.Join("<br>", arr)}</div>";
|
||||
return html;
|
||||
}
|
||||
public bool writeLog(string u_id, int? systems, int status, string word)
|
||||
{
|
||||
bool success = true;
|
||||
|
||||
try
|
||||
{
|
||||
Model.admin_log admin_log = new Model.admin_log();//新增
|
||||
admin_log.u_id = u_id;
|
||||
admin_log.login_time = DateTime.Now;
|
||||
admin_log.login_ip = MyWeb.admin.MyIP.Replace("本機", "127.0.0.1");
|
||||
admin_log.systems = systems;
|
||||
admin_log.status = status;
|
||||
admin_log.word = word;
|
||||
admin_log.agent = MyWeb.admin.LoginHistory.UserAgent;
|
||||
_db.admin_log.Add(admin_log);
|
||||
_db.SaveChanges();
|
||||
|
||||
}
|
||||
catch (DbEntityValidationException e)
|
||||
{
|
||||
success = false;
|
||||
foreach (var eve in e.EntityValidationErrors)
|
||||
{
|
||||
Console.WriteLine("Entity of type \"{0}\" in state \"{1}\" has the following validation errors:",
|
||||
eve.Entry.Entity.GetType().Name, eve.Entry.State);
|
||||
foreach (var ve in eve.ValidationErrors)
|
||||
{
|
||||
Console.WriteLine("- Property: \"{0}\", Error: \"{1}\"",
|
||||
ve.PropertyName, ve.ErrorMessage);
|
||||
}
|
||||
}
|
||||
throw;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
success = false;
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
99
web/App_Code/Model/Partial/bed.cs
Normal file
99
web/App_Code/Model/Partial/bed.cs
Normal file
@@ -0,0 +1,99 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Http;
|
||||
using System.Collections;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
// 為對應資料表MODEL宣告額外參數類別(Metadata)
|
||||
// [JsonIgnore] 避免WEBAPI自動抓關聯資料
|
||||
[MetadataType(typeof(bed_orderMetadata))]
|
||||
public partial class bed_order
|
||||
{
|
||||
private class bed_orderMetadata
|
||||
{
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<bed_order_detail> bed_order_detail { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual pro_order pro_order { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual pro_order_detail pro_order_detail { get; set; }
|
||||
|
||||
}
|
||||
public const int KindLevelMax = 2; //分類頁面層數
|
||||
|
||||
#region 單據狀態
|
||||
public struct keyin
|
||||
{
|
||||
public string Text;
|
||||
public string Value;
|
||||
public string Color;
|
||||
}
|
||||
public ArrayList keyin1_list()
|
||||
{
|
||||
ArrayList options = new ArrayList();
|
||||
keyin keyin;
|
||||
keyin.Value = "A1"; keyin.Text = "未入住"; keyin.Color = "#990000"; options.Add(keyin);
|
||||
keyin.Value = "A2"; keyin.Text = "已入住"; keyin.Color = "green"; options.Add(keyin);
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
|
||||
public static string keyin1_value_to_text(string v)
|
||||
{
|
||||
string tmp = "";
|
||||
ArrayList keyin1 = new pro_order().keyin1_list();
|
||||
foreach (keyin k in keyin1)
|
||||
{
|
||||
if (k.Value == v)
|
||||
{
|
||||
tmp = k.Text;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
[MetadataType(typeof(bed_kindMetadata))]
|
||||
public partial class bed_kind
|
||||
{
|
||||
private class bed_kindMetadata
|
||||
{
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<bed_kind_detail> bed_kind_detail { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<bed_order_detail> bed_order_detail { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<bed_order_detail> bed_order_detail1 { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public enum bed_type : int
|
||||
{
|
||||
[Description("單人床")]
|
||||
Single = 1,
|
||||
[Description("上舖")]
|
||||
Double = 2,
|
||||
[Description("下舖")]
|
||||
Bunk= 3,
|
||||
[Description("通舖")]
|
||||
Wide = 4
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
32
web/App_Code/Model/Partial/country.cs
Normal file
32
web/App_Code/Model/Partial/country.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
// 為對應資料表MODEL宣告額外參數類別(Metadata)
|
||||
// [JsonIgnore] 避免WEBAPI自動抓關聯資料
|
||||
[MetadataType(typeof(countryMetadata))]
|
||||
public partial class country
|
||||
{
|
||||
|
||||
private class countryMetadata
|
||||
{
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<follower> followers { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
29
web/App_Code/Model/Partial/files.cs
Normal file
29
web/App_Code/Model/Partial/files.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
// 為對應資料表MODEL宣告額外參數類別(Metadata)
|
||||
// [JsonIgnore] 避免WEBAPI自動抓關聯資料
|
||||
[MetadataType(typeof(filesMetadata))]
|
||||
public partial class file
|
||||
{
|
||||
private class filesMetadata
|
||||
{
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<actItem_files> actItem_files { get; set; }
|
||||
|
||||
}
|
||||
public static IEnumerable<Model.file> allFiles = new Model.ezEntities().files.AsEnumerable();
|
||||
}
|
||||
}
|
||||
|
||||
210
web/App_Code/Model/Partial/follower.cs
Normal file
210
web/App_Code/Model/Partial/follower.cs
Normal file
@@ -0,0 +1,210 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
// 為對應資料表MODEL宣告額外參數類別(Metadata)
|
||||
// [JsonIgnore] 避免WEBAPI自動抓關聯資料
|
||||
[MetadataType(typeof(followerMetadata))]
|
||||
public partial class follower
|
||||
{
|
||||
private class followerMetadata
|
||||
{
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<follower> followers1 { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual follower follower1 { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<activity_check> activity_check { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual country country1 { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<member> members { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<pro_order_detail> pro_order_detail { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<pro_order_detail> pro_order_detail1 { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<pro_order> pro_order { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<pro_order> pro_order1 { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<followers_tablet> followers_tablet { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual appellation appellation { get; set; }
|
||||
|
||||
|
||||
}
|
||||
public enum type : int
|
||||
{
|
||||
[Description("出家眾")]
|
||||
Monk = 1,// 4,
|
||||
[Description("個人")]
|
||||
Personal = 2, //1,
|
||||
[Description("法人")]
|
||||
Legal = 3, //2,
|
||||
[Description("往生菩薩")]
|
||||
Bodhisattva = 4, //3,
|
||||
[Description("蓮友")]
|
||||
Seeker = 10,
|
||||
}
|
||||
|
||||
public static IEnumerable<Model.follower> allFaollowers = new Model.ezEntities().followers.AsEnumerable();
|
||||
|
||||
//public static string identity_type_list()
|
||||
|
||||
#region 農曆生日&生肖
|
||||
|
||||
public enum chinese
|
||||
{
|
||||
鼠 = 1, 牛 = 2, 虎 = 3, 兔 = 4, 龍 = 5, 蛇 = 6,
|
||||
馬 = 7, 羊 = 8, 猴 = 9, 雞 = 10, 狗 = 11, 豬 = 12
|
||||
}
|
||||
enum heavenlyStems
|
||||
{
|
||||
甲 = 1, 乙, 丙, 丁, 戊, 己, 庚, 辛, 壬, 癸
|
||||
}
|
||||
|
||||
enum earthlyBranches
|
||||
{
|
||||
子 = 1, 丑, 寅, 卯, 辰, 巳, 午, 未, 申, 酉, 戌, 亥
|
||||
}
|
||||
|
||||
|
||||
public static string chagenSign(DateTime? date)
|
||||
{ //可改公用
|
||||
//生肖
|
||||
try
|
||||
{
|
||||
if (date != null)
|
||||
{
|
||||
DateTime d = date ?? DateTime.Now;
|
||||
int year = d.Year;
|
||||
int birthpet; //宣告生肖要用的變數
|
||||
|
||||
birthpet = year % 12; //西元年除12取餘數
|
||||
birthpet -= 3;
|
||||
//餘數-3
|
||||
if (birthpet <= 0) birthpet += 12;
|
||||
//判斷餘數是否大於0,小於0必須+12
|
||||
return Enum.GetName(typeof(chinese), birthpet);
|
||||
//return ((chinese)birthpet).ToString(); //也可以
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
//return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static string sexagenary(DateTime? date)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (date != null)
|
||||
{
|
||||
DateTime d = date ?? DateTime.Now;
|
||||
|
||||
//依農曆年計算,故同一年的1月跟6月會得不同結果
|
||||
//ChineseLunisolarCalendar chineseDate = new ChineseLunisolarCalendar();
|
||||
//int y = chineseDate.GetYear(d);// 農曆年分
|
||||
//int a = chineseDate.GetSexagenaryYear(d); // 獲取干支纪年值
|
||||
|
||||
//heavenlyStems tg = (heavenlyStems)chineseDate.GetCelestialStem(a);
|
||||
//earthlyBranches dz = (earthlyBranches)chineseDate.GetTerrestrialBranch(a);
|
||||
//return $"{tg}{dz}";
|
||||
|
||||
|
||||
int year = d.Year;
|
||||
if (year > 3)
|
||||
{
|
||||
int tgIndex = (year - 4) % 10;
|
||||
int dzIndex = (year - 4) % 12;
|
||||
|
||||
return $"{(heavenlyStems)(tgIndex + 1)}{(earthlyBranches)(dzIndex + 1)}";
|
||||
}
|
||||
//throw new ArgumentOutOfRangeException("無效的年份!");
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
//return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static string ChkNewFollower(Model.follower newFollower)
|
||||
{
|
||||
Model.ezEntities _db = new Model.ezEntities();
|
||||
if (string.IsNullOrWhiteSpace(newFollower.u_name))
|
||||
{
|
||||
return "姓名不應為空白";
|
||||
}
|
||||
|
||||
MyWeb.encrypt encrypt = new MyWeb.encrypt();
|
||||
|
||||
// 解密並只保留數字
|
||||
string decryptedNewPhone = !string.IsNullOrWhiteSpace(newFollower.phone)
|
||||
? new string(encrypt.DecryptAutoKey(newFollower.phone).Where(char.IsDigit).ToArray()) : "";
|
||||
string decryptedNewCellphone = !string.IsNullOrWhiteSpace(newFollower.cellphone)
|
||||
? new string(encrypt.DecryptAutoKey(newFollower.cellphone).Where(char.IsDigit).ToArray()) : "";
|
||||
|
||||
var existingFollowers = _db.followers.Where(f => f.u_name == newFollower.u_name).ToList();
|
||||
|
||||
if (!existingFollowers.Any())
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
foreach (var follower in existingFollowers)
|
||||
{
|
||||
string decryptedPhone = !string.IsNullOrWhiteSpace(follower.phone)
|
||||
? new string(encrypt.DecryptAutoKey(follower.phone).Where(char.IsDigit).ToArray()) : "";
|
||||
string decryptedCellphone = !string.IsNullOrWhiteSpace(follower.cellphone)
|
||||
? new string(encrypt.DecryptAutoKey(follower.cellphone).Where(char.IsDigit).ToArray()) : "";
|
||||
|
||||
if ((!string.IsNullOrWhiteSpace(decryptedNewPhone) && decryptedNewPhone == decryptedPhone) ||
|
||||
(!string.IsNullOrWhiteSpace(decryptedNewCellphone) && decryptedNewCellphone == decryptedCellphone))
|
||||
{
|
||||
return "姓名重複 + 電話或手機重複";
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
#endregion
|
||||
public static string generate_f_number(string sex = "男眾")
|
||||
{
|
||||
string selectedSex = sex;
|
||||
string f_number = selectedSex == "男眾" ? "M" : "F";
|
||||
var datePart = DateTime.Now.ToString("yyyyMMdd");
|
||||
f_number += datePart;
|
||||
|
||||
|
||||
int nextSerial = 1;
|
||||
|
||||
lock (GlobalVariables.FNumberLock)
|
||||
{
|
||||
nextSerial = (int)HttpContext.Current.Application["FNumberSerial"] + 1;
|
||||
HttpContext.Current.Application["FNumberSerial"] = nextSerial;
|
||||
}
|
||||
f_number += nextSerial.ToString("D5");
|
||||
return f_number;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
62
web/App_Code/Model/Partial/member.cs
Normal file
62
web/App_Code/Model/Partial/member.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
// 為對應資料表MODEL宣告額外參數類別(Metadata)
|
||||
// [JsonIgnore] 避免WEBAPI自動抓關聯資料
|
||||
[MetadataType(typeof(memberMetadata))]
|
||||
public partial class member
|
||||
{
|
||||
private class memberMetadata
|
||||
{
|
||||
[JsonIgnore]
|
||||
public virtual follower follower { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<member_check> member_check { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual member_group member_group { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual member_title member_title { get; set; }
|
||||
}
|
||||
public const int KindLevelMax = 3; //組別頁面層數
|
||||
public const int TitleLevelMax = 1; //職稱頁面層數
|
||||
public const string Dir = "~/upload/member"; //圖片上傳位置
|
||||
public const int picMax = 1; //圖片數量
|
||||
|
||||
|
||||
public class attendances
|
||||
{
|
||||
public enum type : int
|
||||
{
|
||||
[Description("上班")]
|
||||
Start = 1,
|
||||
[Description("下班")]
|
||||
GetOff = 2
|
||||
}
|
||||
|
||||
public enum login : int
|
||||
{
|
||||
[Description("主管補登")]
|
||||
Enter = 1,
|
||||
[Description("帳號密碼")]
|
||||
Account = 2
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
37
web/App_Code/Model/Partial/news.cs
Normal file
37
web/App_Code/Model/Partial/news.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
// 為對應資料表MODEL宣告額外參數類別(Metadata)
|
||||
// [JsonIgnore] 避免WEBAPI自動抓關聯資料
|
||||
[MetadataType(typeof(newsMetadata))]
|
||||
public partial class news
|
||||
{
|
||||
private class newsMetadata
|
||||
{
|
||||
[JsonIgnore]
|
||||
public virtual admin admin { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<news_files> news_files { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual news_kind news_kind { get; set; }
|
||||
}
|
||||
|
||||
public const int KindLevelMax = 3; //頁面層數
|
||||
public const string Dir = "~/upload/news"; //圖片上傳位置
|
||||
public string log;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
396
web/App_Code/Model/Partial/order.cs
Normal file
396
web/App_Code/Model/Partial/order.cs
Normal file
@@ -0,0 +1,396 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Http;
|
||||
using System.Collections;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
// 為對應資料表MODEL宣告額外參數類別(Metadata)
|
||||
// [JsonIgnore] 避免WEBAPI自動抓關聯資料
|
||||
[MetadataType(typeof(pro_orderMetadata))]
|
||||
public partial class pro_order
|
||||
{
|
||||
private class pro_orderMetadata
|
||||
{
|
||||
[JsonIgnore]
|
||||
public virtual activity activity { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual follower follower { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual follower follower1 { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<bed_order> bed_order { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<pro_order_detail> pro_order_detail { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
public string log;
|
||||
|
||||
#region 單據狀態
|
||||
public struct keyin
|
||||
{
|
||||
public string Text;
|
||||
public string Value;
|
||||
public string Color;
|
||||
}
|
||||
public ArrayList keyin1_list()
|
||||
{
|
||||
ArrayList options = new ArrayList();
|
||||
keyin keyin;
|
||||
keyin.Value = "A01"; keyin.Text = "報名中"; keyin.Color = "#990000"; options.Add(keyin);
|
||||
keyin.Value = "A02"; keyin.Text = "已報名"; keyin.Color = "black"; options.Add(keyin);
|
||||
keyin.Value = "A05"; keyin.Text = "取消報名"; keyin.Color = "green"; options.Add(keyin);
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
|
||||
public static string keyin1_value_to_text(string v)
|
||||
{
|
||||
string tmp = "";
|
||||
ArrayList keyin1 = new pro_order(). keyin1_list();
|
||||
foreach (keyin k in keyin1)
|
||||
{
|
||||
if (k.Value == v)
|
||||
{
|
||||
tmp = k.Text;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return tmp;
|
||||
}
|
||||
#endregion
|
||||
|
||||
public enum detailKeyin1 : int //報名狀態
|
||||
{
|
||||
[Description("未收款")]
|
||||
Unconfirmed = 1,
|
||||
[Description("分期")]
|
||||
Collection = 2,
|
||||
[Description("已收款")]
|
||||
Paied = 3,
|
||||
[Description("呆帳")]
|
||||
Finish = 4
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[MetadataType(typeof(pro_order_detailMetadata))]
|
||||
public partial class pro_order_detail
|
||||
{
|
||||
private class pro_order_detailMetadata
|
||||
{
|
||||
[JsonIgnore]
|
||||
public virtual actItem actItem { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<bed_order> bed_order { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual follower follower { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual follower follower1 { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual pro_order pro_order { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<pro_order_record> pro_order_record { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<accounting> accountings { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<transfer_register> transfer_register { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生成序列化ID(print_id)的方法,處理父項目和子項目的編號生成
|
||||
/// </summary>
|
||||
/// <returns>生成的序列化ID</returns>
|
||||
public string GenerateSequentialId()
|
||||
{
|
||||
Model.ezEntities _db = new Model.ezEntities();
|
||||
string r = this.print_id;
|
||||
try
|
||||
{
|
||||
bool chk = true;
|
||||
actItem actitem = null;
|
||||
int? actitem_id = null;
|
||||
|
||||
// 處理子項目的ID生成
|
||||
if (!(this.parent_num == null || this.parent_num == 0))
|
||||
{
|
||||
// 1. 查找父項目的資料
|
||||
var parent_order_item = _db.pro_order_detail.Where(
|
||||
q => q.num == this.parent_num).FirstOrDefault();
|
||||
|
||||
// 2. 確認父項目存在且當前項目還沒有 print_id
|
||||
if (parent_order_item != null && string.IsNullOrEmpty(this.print_id))
|
||||
{
|
||||
actitem_id = parent_order_item.actItem_num;
|
||||
string parent_print_id = parent_order_item.print_id;
|
||||
|
||||
// 1. 獲取當前子項目的品項前綴
|
||||
var currentActItem = _db.actItems
|
||||
.Where(q => q.num == this.actItem_num)
|
||||
.FirstOrDefault();
|
||||
|
||||
if (currentActItem != null && !string.IsNullOrEmpty(currentActItem.print_init))
|
||||
{
|
||||
var itemPrefix = currentActItem.print_init.Trim();
|
||||
|
||||
// 2. 獲取同父項目且同品項的子項目編號
|
||||
var siblings = _db.pro_order_detail
|
||||
.Where(q => q.parent_num == this.parent_num) // 找出同一個父項目的子項目
|
||||
.Where(q => q.actItem_num == this.actItem_num) // 同品項
|
||||
.Where(q => q.print_id != null) // Ensure print_id is not null
|
||||
.Select(q => q.print_id) // Just select the print_id
|
||||
.AsEnumerable() // Switch to in-memory operations
|
||||
.Where(q => q.StartsWith(parent_print_id)) // Now do string operations in memory
|
||||
.Where(q => q.Contains(itemPrefix))
|
||||
.Select(q => q.Trim().Replace("\t", ""))
|
||||
.Select(q => q.Replace($"{parent_print_id}-{itemPrefix}", ""))
|
||||
.ToList();
|
||||
|
||||
// 3. 將所有序號轉換為數字陣列並過濾無效值
|
||||
int[] intArray = siblings
|
||||
.Select(s =>
|
||||
{
|
||||
int result;
|
||||
return int.TryParse(s, out result) ? (int?)result : null;
|
||||
})
|
||||
.Where(i => i.HasValue && i.Value != 0)
|
||||
.Select(i => i.Value)
|
||||
.ToArray();
|
||||
|
||||
// 4. 生成新的序號(最大序號+1,並格式化為兩位數)
|
||||
int maxNum = 1 + (intArray.Any() ? intArray.Max() : 0);
|
||||
string formattedNum = maxNum < 10 ? "0" + maxNum : maxNum.ToString();
|
||||
|
||||
// 5. 組合新的 print_id(父項目ID-品項前綴序號)
|
||||
r = $"{parent_print_id}-{itemPrefix}{formattedNum}";
|
||||
}
|
||||
}
|
||||
}
|
||||
// 處理主項目的ID生成
|
||||
else
|
||||
{
|
||||
actitem_id = this.actItem_num;
|
||||
actitem = _db.actItems
|
||||
.Where(q => q.num == actitem_id).FirstOrDefault();
|
||||
var proorder = _db.pro_order.Where(q => q.order_no == this.order_no).FirstOrDefault();
|
||||
|
||||
// 檢查是否需要生成新的 print_id
|
||||
chk = String.IsNullOrEmpty(r) &&
|
||||
actitem != null &&
|
||||
proorder != null &&
|
||||
!string.IsNullOrEmpty(actitem.print_init);
|
||||
if (chk)
|
||||
{
|
||||
// 1. 組合活動和品項的前綴
|
||||
var print_init = string.IsNullOrEmpty(proorder?.activity?.print_init) ? "" : proorder?.activity?.print_init.Trim();
|
||||
var actitem_print_init = actitem.print_init.Trim();
|
||||
var combinedPrintInit = print_init + actitem_print_init;
|
||||
|
||||
// 2. 查找相同活動和品項的已存在編號
|
||||
var actitems = _db.pro_order_detail
|
||||
.Where(q => q.pro_order.activity_num == proorder.activity_num)
|
||||
.Where(q => q.actItem_num == this.actItem_num)
|
||||
.Where(q => !string.IsNullOrEmpty(q.print_id))
|
||||
.Where(q => q.print_id.StartsWith(combinedPrintInit))
|
||||
.Where(q => q.parent_num == 0 || q.parent_num == null)
|
||||
.Select(q => q.print_id)
|
||||
.ToList();
|
||||
|
||||
// 3. 獲取最大序號
|
||||
var maxNum = actitems
|
||||
.Select(item =>
|
||||
{
|
||||
var match = Regex.Match(item, @"\d+");
|
||||
return match.Success ? (int?)int.Parse(match.Value.TrimStart('0')) : null;
|
||||
})
|
||||
.Where(num => num.HasValue)
|
||||
.DefaultIfEmpty(0)
|
||||
.Max() ?? 0;
|
||||
|
||||
// 4. 生成新的序號(四位數格式)
|
||||
int newNum = maxNum + 1;
|
||||
string formattedNum = newNum.ToString().PadLeft(4, '0');
|
||||
|
||||
// 5. 組合最終的 print_id
|
||||
r = $"{combinedPrintInit}{formattedNum}";
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// 異常處理:記錄錯誤並返回原始 print_id
|
||||
Console.WriteLine($"Error generating sequential ID: {ex.Message}");
|
||||
r = this.print_id;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
[MetadataType(typeof(pro_order_recordMetadata))]
|
||||
public partial class pro_order_record
|
||||
{
|
||||
private class pro_order_recordMetadata
|
||||
{
|
||||
/// <summary>
|
||||
/// 主鍵,付款記錄編號
|
||||
/// </summary>
|
||||
[Display(Name = "付款記錄編號")]
|
||||
public int num { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 關聯到報名明細編號 (pro_order_detail.num)
|
||||
/// </summary>
|
||||
[Display(Name = "報名明細編號")]
|
||||
[Required(ErrorMessage = "報名明細編號為必填欄位")]
|
||||
public Nullable<int> detail_num { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 付款金額
|
||||
/// </summary>
|
||||
[Display(Name = "付款金額")]
|
||||
[Required(ErrorMessage = "付款金額為必填欄位")]
|
||||
[Range(0.01, double.MaxValue, ErrorMessage = "付款金額必須大於0")]
|
||||
public Nullable<float> price { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 付款方式 (1=現金, 2=匯款, 3=支票)
|
||||
/// </summary>
|
||||
[Display(Name = "付款方式")]
|
||||
[Required(ErrorMessage = "付款方式為必填欄位")]
|
||||
public Nullable<int> payment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 登記時間 (系統自動產生)
|
||||
/// </summary>
|
||||
[Display(Name = "登記時間")]
|
||||
public Nullable<System.DateTime> reg_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 付款日期
|
||||
/// </summary>
|
||||
[Display(Name = "付款日期")]
|
||||
[Required(ErrorMessage = "付款日期為必填欄位")]
|
||||
public Nullable<System.DateTime> pay_date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 付款機構 (銀行名稱等)
|
||||
/// </summary>
|
||||
[Display(Name = "付款機構")]
|
||||
[StringLength(100, ErrorMessage = "付款機構長度不能超過100個字元")]
|
||||
public string organization { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 銀行代碼或帳號後5碼
|
||||
/// </summary>
|
||||
[Display(Name = "帳號後5碼")]
|
||||
[StringLength(10, ErrorMessage = "帳號後5碼長度不能超過10個字元")]
|
||||
public string bank_code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 關聯到匯款登記編號 (transfer_register.num)
|
||||
/// </summary>
|
||||
[Display(Name = "匯款登記編號")]
|
||||
public Nullable<int> transfer_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 關聯到會計科目分類
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public virtual accounting_kind2 accounting_kind2 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 關聯到報名明細
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public virtual pro_order_detail pro_order_detail { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 關聯到匯款登記資料
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public virtual transfer_register transfer_register { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 付款方式列舉
|
||||
/// </summary>
|
||||
public enum pay_kind : int
|
||||
{
|
||||
/// <summary>
|
||||
/// 現金付款
|
||||
/// </summary>
|
||||
[Description("現金")]
|
||||
Cash = 1,
|
||||
|
||||
/// <summary>
|
||||
/// 匯款付款
|
||||
/// </summary>
|
||||
[Description("匯款")]
|
||||
ATM = 2,
|
||||
|
||||
/// <summary>
|
||||
/// 支票付款
|
||||
/// </summary>
|
||||
[Description("支票")]
|
||||
Check = 3
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 取得付款方式的中文描述
|
||||
/// </summary>
|
||||
/// <param name="paymentType">付款方式代碼</param>
|
||||
/// <returns>付款方式中文描述</returns>
|
||||
public static string GetPaymentDescription(int? paymentType)
|
||||
{
|
||||
if (!paymentType.HasValue) return "未指定";
|
||||
|
||||
switch (paymentType.Value)
|
||||
{
|
||||
case (int)pay_kind.Cash:
|
||||
return "現金";
|
||||
case (int)pay_kind.ATM:
|
||||
return "匯款";
|
||||
case (int)pay_kind.Check:
|
||||
return "支票";
|
||||
default:
|
||||
return "未知";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 取得付款方式的完整資訊
|
||||
/// </summary>
|
||||
/// <returns>包含付款方式、機構、帳號的完整資訊</returns>
|
||||
public string GetPaymentFullInfo()
|
||||
{
|
||||
string paymentDesc = GetPaymentDescription(this.payment);
|
||||
string fullInfo = paymentDesc;
|
||||
|
||||
if (!string.IsNullOrEmpty(this.organization))
|
||||
{
|
||||
fullInfo += $" - {this.organization}";
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.bank_code))
|
||||
{
|
||||
fullInfo += $" ({this.bank_code})";
|
||||
}
|
||||
|
||||
return fullInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
34
web/App_Code/Model/Partial/project.cs
Normal file
34
web/App_Code/Model/Partial/project.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
// 為對應資料表MODEL宣告額外參數類別(Metadata)
|
||||
// [JsonIgnore] 避免WEBAPI自動抓關聯資料
|
||||
[MetadataType(typeof(projectMetadata))]
|
||||
public partial class project
|
||||
{
|
||||
private class projectMetadata
|
||||
{
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual project_kind project_kind { get; set; }
|
||||
}
|
||||
|
||||
public const int KindLevelMax = 3; //頁面層數
|
||||
public string log;
|
||||
public const string Dir = "~/upload/project"; //圖片上傳位置
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
58
web/App_Code/Model/Partial/stock.cs
Normal file
58
web/App_Code/Model/Partial/stock.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
// 為對應資料表MODEL宣告額外參數類別(Metadata)
|
||||
// [JsonIgnore] 避免WEBAPI自動抓關聯資料
|
||||
[MetadataType(typeof(stockMetadata))]
|
||||
public partial class stock
|
||||
{
|
||||
private class stockMetadata
|
||||
{
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual actItem actItem { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual activity activity { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual member member { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<stock_files> stock_files { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual stock_kind stock_kind { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual stock_reason stock_reason { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual supplier supplier1 { get; set; }
|
||||
}
|
||||
|
||||
public const int KindLevelMax = 3; //頁面層數
|
||||
public const int ReasonLevelMax = 1; //頁面層數
|
||||
public const string Dir = "~/upload/stock"; //圖片上傳位置
|
||||
public string log;
|
||||
|
||||
public enum type : int //進出類型
|
||||
{
|
||||
[Description("庫存增加(+)")]
|
||||
Purchase = 1,
|
||||
[Description("庫存減少(-)")]
|
||||
Reduce = 2,
|
||||
[Description("租借(-)")]
|
||||
Rent = 3,
|
||||
[Description("租借歸還(+)")]
|
||||
Return = 4
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
34
web/App_Code/Model/Partial/supplier.cs
Normal file
34
web/App_Code/Model/Partial/supplier.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
// 為對應資料表MODEL宣告額外參數類別(Metadata)
|
||||
// [JsonIgnore] 避免WEBAPI自動抓關聯資料
|
||||
[MetadataType(typeof(supplierMetadata))]
|
||||
public partial class supplier
|
||||
{
|
||||
private class supplierMetadata
|
||||
{
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual supplier_kind supplier_kind { get; set; }
|
||||
}
|
||||
|
||||
public const int KindLevelMax = 3; //收支層數
|
||||
public const string Dir = "~/upload/supplier"; //圖片上傳位置
|
||||
public string log;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
177
web/App_Code/Model/Partial/transfer_register.cs
Normal file
177
web/App_Code/Model/Partial/transfer_register.cs
Normal file
@@ -0,0 +1,177 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Model
|
||||
{
|
||||
[MetadataType(typeof(transfer_registerMetadata))]
|
||||
public partial class transfer_register
|
||||
{
|
||||
private class transfer_registerMetadata
|
||||
{
|
||||
[JsonIgnore]
|
||||
public virtual accounting accounting { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual accounting_kind2 accounting_kind2 { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual activity activity { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual follower follower { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual follower follower1 { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual member member { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual actItem actItem { get; set; }
|
||||
[JsonIgnore]
|
||||
public virtual pro_order_detail pro_order_detail { get; set; }
|
||||
|
||||
[DisplayName("系統流水號")]
|
||||
public int id { get; set; }
|
||||
|
||||
[DisplayName("法會編號")]
|
||||
public int? activity_num { get; set; }
|
||||
|
||||
[DisplayName("姓名")]
|
||||
[StringLength(50)]
|
||||
public string name { get; set; }
|
||||
|
||||
[DisplayName("電話")]
|
||||
[StringLength(30)]
|
||||
public string phone { get; set; }
|
||||
|
||||
[DisplayName("支付方式")]
|
||||
public int? pay_type { get; set; }
|
||||
|
||||
[DisplayName("帳號後五碼")]
|
||||
[StringLength(10)]
|
||||
public string account_last5 { get; set; }
|
||||
|
||||
[DisplayName("支付金額")]
|
||||
public int? amount { get; set; }
|
||||
|
||||
[DisplayName("支付型態")]
|
||||
[StringLength(10)]
|
||||
public string pay_mode { get; set; }
|
||||
|
||||
[DisplayName("備註")]
|
||||
[StringLength(200)]
|
||||
public string note { get; set; }
|
||||
|
||||
[DisplayName("匯款憑證圖片檔名")]
|
||||
[StringLength(100)]
|
||||
public string proof_img { get; set; }
|
||||
|
||||
[DisplayName("信眾核對狀態(階段1)")]
|
||||
public int? status { get; set; }
|
||||
|
||||
[DisplayName("自動比對信眾編號")]
|
||||
public int? f_num_match { get; set; }
|
||||
|
||||
[DisplayName("信眾編號")]
|
||||
public int? f_num { get; set; }
|
||||
|
||||
[DisplayName("入帳銀行帳戶編號")]
|
||||
public int? acc_num { get; set; }
|
||||
|
||||
[DisplayName("入帳日期")]
|
||||
public DateTime? check_date { get; set; }
|
||||
|
||||
[DisplayName("入帳金額")]
|
||||
public int? check_amount { get; set; }
|
||||
|
||||
[DisplayName("帳簿備註")]
|
||||
[StringLength(200)]
|
||||
public string check_memo { get; set; }
|
||||
|
||||
[DisplayName("匯款核對狀態(階段2)")]
|
||||
public int? check_status { get; set; }
|
||||
|
||||
[DisplayName("入帳帳戶類型")]
|
||||
public int? acc_kind { get; set; }
|
||||
|
||||
[DisplayName("會員編號")]
|
||||
public int? member_num { get; set; }
|
||||
|
||||
[DisplayName("核對時間")]
|
||||
public DateTime? verify_time { get; set; }
|
||||
|
||||
[DisplayName("核對記錄")]
|
||||
[StringLength(200)]
|
||||
public string verify_note { get; set; }
|
||||
|
||||
[DisplayName("沖帳暫存資料(JSON)")]
|
||||
public string draft { get; set; }
|
||||
|
||||
[DisplayName("剩餘金額")]
|
||||
public int? remain_amount { get; set; }
|
||||
|
||||
[DisplayName("餘額處理-活動品項")]
|
||||
public int? balance_act_item { get; set; }
|
||||
|
||||
[DisplayName("餘額處理-訂單明細")]
|
||||
public int? balance_pro_order_detail { get; set; }
|
||||
|
||||
[DisplayName("建立時間")]
|
||||
public DateTime? create_time { get; set; }
|
||||
}
|
||||
|
||||
public const string Dir = "~/upload/transfer"; // 匯款證明圖片上傳位置
|
||||
public string log;
|
||||
|
||||
public enum PayType : int // 支付方式
|
||||
{
|
||||
[Description("現金")]
|
||||
Cash = 1,
|
||||
[Description("匯款")]
|
||||
Transfer = 2,
|
||||
[Description("支票")]
|
||||
Check = 3
|
||||
}
|
||||
|
||||
public enum Status : int // 信眾核對狀態 : 階段1
|
||||
{
|
||||
[Description("待確認")]
|
||||
Pending = 1,
|
||||
[Description("確認")]
|
||||
Confirmed = 2,
|
||||
[Description("作廢")]
|
||||
Void = 3
|
||||
}
|
||||
|
||||
public enum CheckStatus : int // 匯款核對狀態 : 階段2
|
||||
{
|
||||
[Description("未核對")]
|
||||
Unchecked = 1,
|
||||
[Description("核對")]
|
||||
Checked = 2,
|
||||
[Description("金額不符")]
|
||||
AmountMismatch = 3,
|
||||
[Description("其他問題")]
|
||||
OtherIssue = 4,
|
||||
[Description("作廢")]
|
||||
Void = 5,
|
||||
// 沖帳完成時, 若還有餘額未沖, 將 status 改為 98, 此值不可下拉
|
||||
[Description("沖帳有餘額")]
|
||||
Remained = 90,
|
||||
// 餘額沖帳相關狀態,
|
||||
[Description("未聯絡")]
|
||||
Uncontacted = 91,
|
||||
[Description("已聯絡")]
|
||||
Contacted = 92,
|
||||
[Description("餘額核銷")]
|
||||
BalanceVoided = 95,
|
||||
// 沖帳完成後, 若餘額為0, 將 status 改為 99, 此值不可下拉
|
||||
[Description("沖帳完成")]
|
||||
Voided = 99
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user