private void AddJobTitle(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "input", Title = "職稱", Width = (int)FieldWidth.Half }); fieldIds.Add(id); }
private void AddLodging(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "checkbox", Title = "住宿需求", Width = (int)FieldWidth.Full, OptionArray = true, Options = "不住宿;要住宿;單人房;雙人房;三人房;四人房;團體房" }); fieldIds.Add(id); }
private void AddName(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "input", Title = "名稱", Width = (int)FieldWidth.Half, Requied = true, ShowInList = true }); fieldIds.Add(id); }
private void AddIndustrial(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "select", Title = "產業", Width = (int)FieldWidth.Half, Options = "產業;批發╱零售╱傳直銷業;文教相關業;大眾傳播相關業;旅遊╱休閒╱運動業;一般服務業;電子資訊 ╱軟體╱半導體相關業;一般製造業;農林漁牧水電資源業;運輸物流及倉儲;政治宗教及社福相關業;金融投顧及保險業;法律╱會計╱顧問╱研發╱設計業;建築營造及不動產相關業;醫療保健及環境衛生業;礦業及土石採取業;住宿╱餐飲服務業" }); fieldIds.Add(id); }
private void AddSatisfaction(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "radio", Title = "滿意度調查", Width = (int)FieldWidth.Full, OptionArray = true, Options = "非常滿意;滿意;普通;不滿意;非常不滿意" }); fieldIds.Add(id); }
private void AddUrgentPhone(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "input", Title = "緊急聯絡人電話", Width = (int)FieldWidth.Quarter }); fieldIds.Add(id); }
private void AddUrgentEmail(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "input", Title = "緊急聯絡人Email", Width = (int)FieldWidth.Half, Fomat = true, FomatType = (int)FieldInputFormat.Email }); fieldIds.Add(id); }
private void AddPhoto(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "image", Title = "照片", Width = (int)FieldWidth.Half, IsDescription = true, Description = "限制上傳檔案格式 (jpg、png、gif)", Fomat = true, FomatType = (int)FieldFileFormat.圖檔 }); fieldIds.Add(id); }
private void AddUrgentMobile(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "input", Title = "緊急聯絡人手機", Width = (int)FieldWidth.Quarter, Fomat = true, FomatType = (int)FieldInputFormat.台灣手機號 }); fieldIds.Add(id); }
private void AddReceiveMessage(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "radio", Title = "是否願意收到本站資訊?", Width = (int)FieldWidth.Half, OptionArray = true, Options = "是;否" }); fieldIds.Add(id); }
private void AddYearlyIncome(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "select", Title = "年收入", Width = (int)FieldWidth.Half, Options = "30萬以下;31~60萬;60萬~100萬;101萬~200萬;200萬以上" }); fieldIds.Add(id); }
private void AddSource(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "checkbox", Title = "如何得知此訊息?", Width = (int)FieldWidth.Full, OptionArray = true, Options = "本網站;廣告;EDM;本站社群平台;親友介紹;海報;宣傳單" }); fieldIds.Add(id); }
private void AddDegree(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "select", Title = "學歷", Width = (int)FieldWidth.Half, Options = "小學;國中;高中\\高職;大學\\技術學院;碩士;博士" }); fieldIds.Add(id); }
private void AddProfession(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "select", Title = "職業", Width = (int)FieldWidth.Half, Options = "行政\\秘書;執行\\管理;金融服務;建築;法律;醫師;軍人\\民政服務;零售;退休;行銷\\市場;學生;教師;技士工程;旅遊\\飯店;非營利義工" }); fieldIds.Add(id); }
private void AddMarital(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "radio", Title = "婚姻狀況", Width = (int)FieldWidth.Half, OptionArray = true, Options = "未婚;已婚;離婚;喪偶" }); fieldIds.Add(id); }
private void AddAddress(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "address", Title = "地址", Width = (int)FieldWidth.Full }); fieldIds.Add(id); }
private void AddMessage(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "textarea", Title = "留言", Width = (int)FieldWidth.Full, High = (int)FieldHeight.五行 }); fieldIds.Add(id); }
private void AddDinner(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "checkbox", Title = "用餐需求", Width = (int)FieldWidth.Full, OptionArray = true, Options = "不用餐;要用餐;全素;奶蛋素;不吃牛;不吃豬;不吃羊;不吃海鮮" }); fieldIds.Add(id); }
private void AddMobile(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, DefaultType = (int)FieldDefaultType.電話, TypeID = "input", Title = "手機", Width = (int)FieldWidth.Quarter, Requied = true, Fomat = true, FomatType = (int)FieldInputFormat.台灣手機號, ShowInList = true }); fieldIds.Add(id); }
private void AddEmail(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, DefaultType = (int)FieldDefaultType.Email, TypeID = "input", Title = "Email", Width = (int)FieldWidth.Half, Requied = true, Fomat = true, FomatType = (int)FieldInputFormat.Email, ShowInList = true }); fieldIds.Add(id); }
private void AddSpeciality(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "checkbox", Title = "專長", Width = (int)FieldWidth.Full, OptionArray = true, Options = "" }); fieldIds.Add(id); }
private void AddBirthday(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "datetime", Title = "出生年月日", Width = (int)FieldWidth.Quarter, Fomat = true, FomatType = (int)FieldDateFormat.西元日期, IsDescription = true, Description = "YYYY/MM/DD" }); fieldIds.Add(id); }
public ActionResult FieldCopy(long id) { FieldModel field = FieldDAO.GetItem(id); field.ID = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(field); FormModel form = FormDAO.GetItem(field.ParentID); ViewBag.UploadDesignUrl = Golbal.UpdFileInfo.GetVPathBySiteID((long)form.SiteID, formDesignFileDir).TrimEnd('/'); return(View("FieldDesignView", new FieldModel[] { field })); }
private void AddPartner(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "radio", Title = "是否會攜伴參加?", Width = (int)FieldWidth.Quarter, OptionArray = true, Options = "是;否" }); fieldIds.Add(id); id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, TypeID = "input", Title = "如果攜伴,會帶幾人?", Width = (int)FieldWidth.Quarter, Fomat = true, FomatType = (int)FieldInputFormat.數字 }); fieldIds.Add(id); }
private void AddNameSex(long formId, List <long> fieldIds) { long id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, DefaultType = (int)FieldDefaultType.姓名, TypeID = "input", Title = "姓名", Width = (int)FieldWidth.Quarter, Requied = true, ShowInList = true }); fieldIds.Add(id); id = WorkLib.GetItem.NewSN(); FieldDAO.SetItem(new FieldModel { ID = id, ParentID = formId, DefaultType = (int)FieldDefaultType.性別, TypeID = "radio", Width = (int)FieldWidth.Quarter, OptionArray = true, Options = "先生;女士", Requied = true }); fieldIds.Add(id); }
public ActionResult Edit(long siteId, long menuId) { FormModel item = FormDAO.GetItemFromSourceID(menuId); if (item == null) { item = new FormModel { ID = WorkLib.GetItem.NewSN(), SiteID = siteId, ForceStatement = true, SourceID = menuId }; FormDAO.SetItem(item); FieldDAO.SetItem(new FieldModel { ID = WorkLib.GetItem.NewSN(), ParentID = item.ID, SN = 1, DefaultType = (int)FieldDefaultType.姓名, TypeID = "input", Title = "姓名", Width = (int)FieldWidth.Quarter, Requied = true, ShowInList = true }); FieldDAO.SetItem(new FieldModel { ID = WorkLib.GetItem.NewSN(), ParentID = item.ID, SN = 2, DefaultType = (int)FieldDefaultType.性別, TypeID = "radio", Width = (int)FieldWidth.Quarter, OptionArray = true, Options = "先生;女士", Requied = true }); FieldDAO.SetItem(new FieldModel { ID = WorkLib.GetItem.NewSN(), ParentID = item.ID, SN = 3, DefaultType = (int)FieldDefaultType.Email, TypeID = "input", Title = "Email", Width = (int)FieldWidth.Half, Requied = true, Fomat = true, FomatType = (int)FieldInputFormat.Email, ShowInList = true }); FieldDAO.SetItem(new FieldModel { ID = WorkLib.GetItem.NewSN(), ParentID = item.ID, SN = 4, DefaultType = (int)FieldDefaultType.電話, TypeID = "input", Title = "手機", Width = (int)FieldWidth.Half, Requied = true, Fomat = true, FomatType = (int)FieldInputFormat.台灣手機號, ShowInList = true }); } ViewBag.UploadUrl = Golbal.UpdFileInfo.GetVPathBySiteID(siteId, formDesignFileDir).TrimEnd('/'); ViewBag.SiteID = siteId; ViewBag.MenuID = menuId; ViewBag.SitePage = FormDAO.GetFormPage(item.ID); ViewBag.Int64Convert = new WorkV3.Golbal.Int64Converter(); return(View(item)); }
public ActionResult FieldSetting(long formId, FieldModel item, byte?oldRepeatLimit) { item.ParentID = formId; FormModel form = FormDAO.GetItem(formId); if (!string.IsNullOrWhiteSpace(item.Template)) { ResourceFilesModels fileModel = JsonConvert.DeserializeObject <ResourceFilesModels>(item.Template); if (fileModel.Id == 0) // 新上傳的檔案 { HttpPostedFileBase postedFile = Request.Files["fTemplate"]; if (postedFile == null || postedFile.ContentLength == 0) { item.Template = string.Empty; } else { item.Template = Golbal.UpdFileInfo.SaveFilesBySiteID(postedFile, (long)form.SiteID, formDesignFileDir); } } else { item.Template = fileModel.FileInfo; } } if (!string.IsNullOrWhiteSpace(item.Image)) { ResourceImagesModels imgModel = JsonConvert.DeserializeObject <ResourceImagesModels>(item.Image); if (imgModel.ID == 0) // 新上傳的圖片 { HttpPostedFileBase postedFile = Request.Files["fImage"]; if (postedFile == null || postedFile.ContentLength == 0) { item.Image = string.Empty; } else { item.Image = Golbal.UpdFileInfo.SaveFilesBySiteID(postedFile, (long)form.SiteID, formDesignFileDir); } } else { item.Image = imgModel.Img; } } if (!string.IsNullOrWhiteSpace(item.VideoCustomPhoto)) { ResourceImagesModels imgModel = JsonConvert.DeserializeObject <ResourceImagesModels>(item.VideoCustomPhoto); if (imgModel.ID == 0) { // 新上傳的圖片 HttpPostedFileBase postedFile = Request.Files["youtubeCustomImg"]; if (postedFile == null || postedFile.ContentLength == 0) { item.VideoCustomPhoto = string.Empty; } else { item.VideoCustomPhoto = Golbal.UpdFileInfo.SaveFilesBySiteID(postedFile, (long)form.SiteID, formDesignFileDir); } } else { item.VideoCustomPhoto = imgModel.Img; } } FieldDAO.SetItem(item); ViewBag.UploadUrl = Golbal.UpdFileInfo.GetVPathBySiteID((long)form.SiteID, formDesignFileDir).TrimEnd('/'); ViewBag.SiteID = form.SiteID; ViewBag.MenuID = form.SourceID; ViewBag.FormID = formId; ViewBag.CustomFolder = formDesignFileDir; ViewBag.Exit = true; if (item.TypeID == "input" && oldRepeatLimit == (byte)FieldRepeatLimit.可任意報名 && item.RepeatLimit != (byte)FieldRepeatLimit.可任意報名) { ViewBag.IsFirst = true; } return(View($"Field{ item.TypeID }", item)); }