public ActionResult Edit(string id, FormCollection formcollection) { SystemGeneralModel _SystemGeneralModel_OpenDays = new SystemGeneralModel(); _SystemGeneralModel_OpenDays = _SystemGeneralModel_OpenDays.ReturnConfigure("OpenDays"); _SystemGeneralModel_OpenDays.ConfigureContent = formcollection["OpenDays"]; _SystemGeneralModel_OpenDays.Update(); SystemGeneralModel _SystemGeneralModel_EmptyContent = new SystemGeneralModel(); _SystemGeneralModel_EmptyContent = _SystemGeneralModel_EmptyContent.ReturnConfigure("EmptyContent"); _SystemGeneralModel_EmptyContent.ConfigureContent = formcollection["EmptyContent"]; _SystemGeneralModel_EmptyContent.Update(); SystemGeneralModel _SystemGeneralModel_ErrorContent = new SystemGeneralModel(); _SystemGeneralModel_ErrorContent = _SystemGeneralModel_ErrorContent.ReturnConfigure("ErrorContent"); _SystemGeneralModel_ErrorContent.ConfigureContent = formcollection["ErrorContent"]; _SystemGeneralModel_ErrorContent.Update(); SystemGeneralModel _SystemGeneralModel_OverDayContent = new SystemGeneralModel(); _SystemGeneralModel_OverDayContent = _SystemGeneralModel_OverDayContent.ReturnConfigure("OverDayContent"); _SystemGeneralModel_OverDayContent.ConfigureContent = formcollection["OverDayContent"]; _SystemGeneralModel_OverDayContent.Update(); return(RedirectToAction("Index")); }
// GET: Configure public ActionResult Index() { ConfigureViewModels _ConfigureViewModels = new ConfigureViewModels(); _ConfigureViewModels.OpenDays = SystemGeneralModel.GetConfigure(SystemGeneralModel.ConfigureClassEnum.OpenDays.ToString()).ConfigureContent; _ConfigureViewModels.EmptyContent = SystemGeneralModel.GetConfigure(SystemGeneralModel.ConfigureClassEnum.EmptyContent.ToString()).ConfigureContent; _ConfigureViewModels.ErrorContent = SystemGeneralModel.GetConfigure(SystemGeneralModel.ConfigureClassEnum.ErrorContent.ToString()).ConfigureContent; _ConfigureViewModels.OverDayContent = SystemGeneralModel.GetConfigure(SystemGeneralModel.ConfigureClassEnum.OverDayContent.ToString()).ConfigureContent; return(View(_ConfigureViewModels)); }
public ActionResult Filter(AdSearchViewModel collection, string id = "") { WorksSearchModel value = new WorksSearchModel() { Budget = collection.Budget, MaxDeep = collection.MaxDeep, MaxHeight = collection.MaxHeight, MaxLength = collection.MaxLength, MaxPrice = collection.Price_U, MaxTimeLength = collection.MaxTimeLength, MaxWidth = collection.MaxWidth, MineDeep = collection.MineDeep, MineHeight = collection.MineHeight, MineLength = collection.MineLength, MinePrice = collection.Price_L, MineTimeLength = collection.MineTimeLength, MineWidth = collection.MineWidth, WorksName = collection.WorksName, StyleNoList = collection.StyleNoList, AuthorNoList = collection.AuthorNoList, GenreNoList = collection.GenreNoList, GradedNoList = collection.GradedNoList, OrderbyType = MenuModel.WorkOrderbyTypeEnum.稱姓名小至大 }; PackagesModel pm = new PackagesModel(); if (string.IsNullOrEmpty(id)) { pm.PackagesName = "未命名" + DateTime.Now.ToString("yyMMddHHmmss"); short d = 1; Int16.TryParse(SystemGeneralModel.GetConfigure(SystemGeneralModel.ConfigureClassEnum.OpenDays.ToString()).ConfigureContent, out d); pm.EndDate = DateTime.Now.AddDays(d); pm.Create(); id = pm.PackagesNo; } pm = PackagesModel.GetPackageDetail(id); pm.PackagesName = ""; // 將搜尋結果加入PackagesModel 的WorksNos var model = value.Search(); for (int i = 0; i < model.Count; i++) { pm.PackageItems.Add(new PackagesModel.PackageItemModel() { WorksNo = model[i].WorksNo, IsJoin = "N" }); } pm.SearchJson = JsonConvert.SerializeObject(value); pm.Budget = collection.Budget; pm.Update(); //儲存篩選條件 return(RedirectToAction("Edit_WorksList", new { id = pm.PackagesNo })); }
// GET: Package/Create public ActionResult Create(string id = "") { if (string.IsNullOrEmpty(id)) { id = Guid.NewGuid().ToString(); PackagesModel pm = new PackagesModel(); pm.PackagesName = "未命名" + DateTime.Now.ToString("yyMMddHHmmss"); pm.PackageItems = new List <PackagesModel.PackageItemModel>(); short d = 1; Int16.TryParse(SystemGeneralModel.GetConfigure(SystemGeneralModel.ConfigureClassEnum.OpenDays.ToString()).ConfigureContent, out d); pm.EndDate = DateTime.Now.AddDays(d); pm.Create(); id = pm.PackagesNo; } return(RedirectToAction("Edit", new { id = id })); }
// GET: Package/Edit/5 public ActionResult Edit(string id) { PackagesModel value = new PackagesModel(); value = PackagesModel.GetPackageDetail(id); short d = 1; Int16.TryParse(SystemGeneralModel.GetConfigure(SystemGeneralModel.ConfigureClassEnum.OpenDays.ToString()).ConfigureContent, out d); PackageViewModel model = new PackageViewModel() { PG_No = value.PackagesNo, PG_Name = value.PackagesName, CreateDate = value.CreateDate, EndDate = value.EndDate ?? DateTime.Now.AddDays(d), Url = this.Url.Action("Detail_Works", "Package", new { id = id }, this.Request.Url.Scheme), QRImg = PackagesModel.DrawQRcodeToImgBase64sting(this.Url.Action("Detail_Works", "Package", new { id = id }, this.Request.Url.Scheme)), Remark = value.PackagesMemo, WorksAmount = value.ItemAmount, Budget = value.Budget, SumCost = value.SumCost, SumPrice = value.SumPrice, }; model.WorksList = new List <WorksInfoViewModel>(); var valueistem = PackagesModel.ReturnPackageItemList(id, true); for (int i = 0; i < valueistem.Count; i++) { model.WorksList.Add(new WorksInfoViewModel() { //No = valueistem[i].WorksNo, Author = valueistem[i].AuthorsName, //MiniImgBase64 = valueistem[i].WorksImgBase64, //MedImg = valueistem[i].WorksImg_m, //MiniImgID = valueistem[i].WorksImgID, Name = valueistem[i].WorksName, Price = valueistem[i].Price.ToString("#,#"), Years = valueistem[i].Year, Cost = valueistem[i].Cost.ToString("#,#") }); model.Summary += valueistem[i].Price; } return(View(model)); }
public ActionResult Expired() { ViewData["Message"] = SystemGeneralModel.GetConfigure(SystemGeneralModel.ConfigureClassEnum.EmptyContent.ToString()).ConfigureContent; return(PartialView()); }
public ActionResult ExceptionContent(string type) { ViewData["Message"] = SystemGeneralModel.GetConfigure(type).ConfigureContent; return(PartialView()); }