From ef80d35cdbabf2ac5fd83f84714b4254e6444fef Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期二, 28 九月 2021 14:22:27 +0800 Subject: [PATCH] 通讯录,账号密码 --- zhengcaioa/zhengcaioa/Views/AdmZhanghaomima/Edit.cshtml | 314 +++++++++ zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Edit.cshtml | 10 zhengcaioa/zhengcaioa/Views/AdmZhanghaomima/Index.cshtml | 123 +++ zhengcaioa/zhengcaioa/Views/AdmTongxunlu/Edit.cshtml | 309 +++++++++ zhengcaioa/Services/AdmZhanghaomimaService.cs | 222 ++++++ zhengcaioa/zhengcaioa/Startup.cs | 3 zhengcaioa/Model/AdmTongxunlu.cs | 22 zhengcaioa/IServices/IAdmTongxunluService.cs | 21 zhengcaioa/Model/zhengcaioaContext.cs | 112 +++ zhengcaioa/CommonToolsCore/AutoMapperConfigs.cs | 8 zhengcaioa/DTO/AdmTongxunluDTO.cs | 32 zhengcaioa/DTO/AdmZhanghaomimaDTO.cs | 32 zhengcaioa/Services/AdmTongxunluService.cs | 221 ++++++ zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Index.cshtml | 13 zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Ruku.cshtml | 32 zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Chuku.cshtml | 32 zhengcaioa/zhengcaioa/Controllers/admin/AdmTongxunluController.cs | 163 ++++ zhengcaioa/Model/AdmZhanghaomima.cs | 22 zhengcaioa/zhengcaioa/Controllers/admin/AdmGoodsManageController.cs | 18 zhengcaioa/zhengcaioa/Controllers/admin/AdmZhanghaomimaController.cs | 163 ++++ zhengcaioa/IServices/IAdmZhanghaomimaService.cs | 21 zhengcaioa/zhengcaioa/Views/AdmTongxunlu/Index.cshtml | 123 +++ 22 files changed, 1,994 insertions(+), 22 deletions(-) diff --git a/zhengcaioa/CommonToolsCore/AutoMapperConfigs.cs b/zhengcaioa/CommonToolsCore/AutoMapperConfigs.cs index 6e808e1..496f9c2 100644 --- a/zhengcaioa/CommonToolsCore/AutoMapperConfigs.cs +++ b/zhengcaioa/CommonToolsCore/AutoMapperConfigs.cs @@ -263,7 +263,13 @@ CreateMap<SysBaimingdan, SysBaimingdanDTO>(); CreateMap<SysBaimingdanDTO, SysBaimingdan>(); - + + CreateMap<AdmTongxunlu, AdmTongxunluDTO>(); + CreateMap<AdmTongxunluDTO, AdmTongxunlu>(); + + CreateMap<AdmZhanghaomima, AdmZhanghaomimaDTO>(); + CreateMap<AdmZhanghaomimaDTO, AdmZhanghaomima>(); + } } diff --git a/zhengcaioa/DTO/AdmTongxunluDTO.cs b/zhengcaioa/DTO/AdmTongxunluDTO.cs new file mode 100644 index 0000000..ea164fd --- /dev/null +++ b/zhengcaioa/DTO/AdmTongxunluDTO.cs @@ -0,0 +1,32 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; + +namespace DTO +{ + public class AdmTongxunluDTO + { + public string Id { get; set; } + public string TypeId { get; set; } + public string TypeName { get; set; } + public string DanweiName { get; set; } + public string Lianxiren { get; set; } + public string Lianxidianhua { get; set; } + public string Beuzhu { get; set; } + public string RecStatus { get; set; } + public string Creater { get; set; } + public DateTime Createtime { get; set; } + public string Modifier { get; set; } + public DateTime Modifytime { get; set; } + } + + public class AdmTongxunluDTOSearch : SearchEntity + { + public string TypeId { get; set; } + public string DanweiName { get; set; } + public string Creater { get; set; } + + + + } +} diff --git a/zhengcaioa/DTO/AdmZhanghaomimaDTO.cs b/zhengcaioa/DTO/AdmZhanghaomimaDTO.cs new file mode 100644 index 0000000..19e93ef --- /dev/null +++ b/zhengcaioa/DTO/AdmZhanghaomimaDTO.cs @@ -0,0 +1,32 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; + +namespace DTO +{ + public class AdmZhanghaomimaDTO + { + public string Id { get; set; } + public string TypeId { get; set; } + public string TypeName { get; set; } + public string Chanpinxiangmu { get; set; } + public string Zhanghao { get; set; } + public string Mima { get; set; } + public string Mibao { get; set; } + public string RecStatus { get; set; } + public string Creater { get; set; } + public DateTime Createtime { get; set; } + public string Modifier { get; set; } + public DateTime Modifytime { get; set; } + } + + public class AdmZhanghaomimaDTOSearch : SearchEntity + { + public string TypeId { get; set; } + public string Chanpinxiangmu { get; set; } + public string Creater { get; set; } + + + + } +} diff --git a/zhengcaioa/IServices/IAdmTongxunluService.cs b/zhengcaioa/IServices/IAdmTongxunluService.cs new file mode 100644 index 0000000..15c360b --- /dev/null +++ b/zhengcaioa/IServices/IAdmTongxunluService.cs @@ -0,0 +1,21 @@ +锘縰sing DTO; +using System; +using System.Collections.Generic; +using System.Text; + + +namespace IServices +{ + public interface IAdmTongxunluService + { + ResultEntity save(AdmTongxunluDTO dto); + + AdmTongxunluDTO Get(string id); + + ResultDataEntity<AdmTongxunluDTO> SearchByPaging(AdmTongxunluDTOSearch searchEntity); + + ResultEntity ModifyStatus(string id, string userid); + + List<AdmTongxunluDTO> GetList(); + } +} diff --git a/zhengcaioa/IServices/IAdmZhanghaomimaService.cs b/zhengcaioa/IServices/IAdmZhanghaomimaService.cs new file mode 100644 index 0000000..9d5b37e --- /dev/null +++ b/zhengcaioa/IServices/IAdmZhanghaomimaService.cs @@ -0,0 +1,21 @@ +锘縰sing DTO; +using System; +using System.Collections.Generic; +using System.Text; + + +namespace IServices +{ + public interface IAdmZhanghaomimaService + { + ResultEntity save(AdmZhanghaomimaDTO dto); + + AdmZhanghaomimaDTO Get(string id); + + ResultDataEntity<AdmZhanghaomimaDTO> SearchByPaging(AdmZhanghaomimaDTOSearch searchEntity); + + ResultEntity ModifyStatus(string id, string userid); + + List<AdmZhanghaomimaDTO> GetList(); + } +} diff --git a/zhengcaioa/Model/AdmTongxunlu.cs b/zhengcaioa/Model/AdmTongxunlu.cs new file mode 100644 index 0000000..f849b82 --- /dev/null +++ b/zhengcaioa/Model/AdmTongxunlu.cs @@ -0,0 +1,22 @@ +锘縰sing System; +using System.Collections.Generic; + +#nullable disable + +namespace zhengcaioa.Models +{ + public partial class AdmTongxunlu + { + public string Id { get; set; } + public string TypeId { get; set; } + public string DanweiName { get; set; } + public string Lianxiren { get; set; } + public string Lianxidianhua { get; set; } + public string Beuzhu { get; set; } + public string RecStatus { get; set; } + public string Creater { get; set; } + public DateTime Createtime { get; set; } + public string Modifier { get; set; } + public DateTime Modifytime { get; set; } + } +} diff --git a/zhengcaioa/Model/AdmZhanghaomima.cs b/zhengcaioa/Model/AdmZhanghaomima.cs new file mode 100644 index 0000000..23c7ca2 --- /dev/null +++ b/zhengcaioa/Model/AdmZhanghaomima.cs @@ -0,0 +1,22 @@ +锘縰sing System; +using System.Collections.Generic; + +#nullable disable + +namespace zhengcaioa.Models +{ + public partial class AdmZhanghaomima + { + public string Id { get; set; } + public string TypeId { get; set; } + public string Chanpinxiangmu { get; set; } + public string Zhanghao { get; set; } + public string Mima { get; set; } + public string Mibao { get; set; } + public string RecStatus { get; set; } + public string Creater { get; set; } + public DateTime Createtime { get; set; } + public string Modifier { get; set; } + public DateTime Modifytime { get; set; } + } +} diff --git a/zhengcaioa/Model/zhengcaioaContext.cs b/zhengcaioa/Model/zhengcaioaContext.cs index 39503d7..b031650 100644 --- a/zhengcaioa/Model/zhengcaioaContext.cs +++ b/zhengcaioa/Model/zhengcaioaContext.cs @@ -51,6 +51,8 @@ public virtual DbSet<AdmGoodsClassify> AdmGoodsClassifies { get; set; } public virtual DbSet<AdmGoodsManage> AdmGoodsManages { get; set; } public virtual DbSet<AdmPieceCheck> AdmPieceChecks { get; set; } + public virtual DbSet<AdmTongxunlu> AdmTongxunlus { get; set; } + public virtual DbSet<AdmZhanghaomima> AdmZhanghaomimas { get; set; } public virtual DbSet<Area> Areas { get; set; } public virtual DbSet<Cgf> Cgfs { get; set; } public virtual DbSet<CooperOrder> CooperOrders { get; set; } @@ -1892,6 +1894,116 @@ .HasComment("宸ヤ綔鏃堕棿"); }); + modelBuilder.Entity<AdmTongxunlu>(entity => + { + entity.ToTable("adm_tongxunlu"); + + entity.Property(e => e.Id).HasMaxLength(50); + + entity.Property(e => e.Beuzhu) + .HasMaxLength(500) + .HasColumnName("beuzhu"); + + entity.Property(e => e.Creater) + .IsRequired() + .HasMaxLength(50) + .HasColumnName("creater") + .HasDefaultValueSql("('1')"); + + entity.Property(e => e.Createtime) + .HasColumnType("datetime") + .HasColumnName("createtime") + .HasDefaultValueSql("(getdate())"); + + entity.Property(e => e.DanweiName) + .HasMaxLength(100) + .HasColumnName("danwei_name"); + + entity.Property(e => e.Lianxidianhua) + .HasMaxLength(100) + .HasColumnName("lianxidianhua"); + + entity.Property(e => e.Lianxiren) + .HasMaxLength(100) + .HasColumnName("lianxiren"); + + entity.Property(e => e.Modifier) + .IsRequired() + .HasMaxLength(50) + .HasColumnName("modifier") + .HasDefaultValueSql("('1')"); + + entity.Property(e => e.Modifytime) + .HasColumnType("datetime") + .HasColumnName("modifytime") + .HasDefaultValueSql("(getdate())"); + + entity.Property(e => e.RecStatus) + .IsRequired() + .HasMaxLength(1) + .HasColumnName("rec_status") + .HasDefaultValueSql("('A')"); + + entity.Property(e => e.TypeId) + .HasMaxLength(50) + .HasColumnName("type_id"); + }); + + modelBuilder.Entity<AdmZhanghaomima>(entity => + { + entity.ToTable("adm_zhanghaomima"); + + entity.Property(e => e.Id).HasMaxLength(50); + + entity.Property(e => e.Chanpinxiangmu) + .HasMaxLength(100) + .HasColumnName("chanpinxiangmu"); + + entity.Property(e => e.Creater) + .IsRequired() + .HasMaxLength(50) + .HasColumnName("creater") + .HasDefaultValueSql("('1')"); + + entity.Property(e => e.Createtime) + .HasColumnType("datetime") + .HasColumnName("createtime") + .HasDefaultValueSql("(getdate())"); + + entity.Property(e => e.Mibao) + .HasMaxLength(100) + .HasColumnName("mibao"); + + entity.Property(e => e.Mima) + .HasMaxLength(100) + .HasColumnName("mima"); + + entity.Property(e => e.Modifier) + .IsRequired() + .HasMaxLength(50) + .HasColumnName("modifier") + .HasDefaultValueSql("('1')"); + + entity.Property(e => e.Modifytime) + .HasColumnType("datetime") + .HasColumnName("modifytime") + .HasDefaultValueSql("(getdate())"); + + entity.Property(e => e.RecStatus) + .IsRequired() + .HasMaxLength(1) + .HasColumnName("rec_status") + .HasDefaultValueSql("('A')"); + + entity.Property(e => e.TypeId) + .HasMaxLength(50) + .HasColumnName("type_id"); + + entity.Property(e => e.Zhanghao) + .HasMaxLength(100) + .HasColumnName("zhanghao"); + }); + modelBuilder.Entity<Area>(entity => { entity.HasKey(e => e.CodeId); diff --git a/zhengcaioa/Services/AdmTongxunluService.cs b/zhengcaioa/Services/AdmTongxunluService.cs new file mode 100644 index 0000000..1ae77af --- /dev/null +++ b/zhengcaioa/Services/AdmTongxunluService.cs @@ -0,0 +1,221 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using AutoMapper; +using DTO; +using IServices; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.EntityFrameworkCore; +using zhengcaioa.Models; + + + +namespace Services +{ + public class AdmTongxunluService: IAdmTongxunluService + { + private readonly zhengcaioaContext _context; + private readonly IMapper _mapper; + public AdmTongxunluService(zhengcaioaContext context, IMapper mapper) + { + _context = context; + _mapper = mapper; + } + public ResultEntity save(AdmTongxunluDTO dto) + { + ResultEntity resultEntity = new ResultEntity(); + try + { + + + var entity = _mapper.Map<AdmTongxunlu>(dto); + + + if (String.IsNullOrEmpty(entity.Id)) + { + entity.Id = Guid.NewGuid().ToString(); + dto.Id = entity.Id; + _context.AdmTongxunlus.Add(entity); + } + else + { + var updateproject = _context.AdmTongxunlus.Find(entity.Id); + + updateproject.TypeId = entity.TypeId; + updateproject.DanweiName = entity.DanweiName; + + + updateproject.Lianxidianhua = entity.Lianxidianhua; + updateproject.Lianxiren = entity.Lianxiren; + updateproject.Beuzhu = entity.Beuzhu; + + updateproject.RecStatus = entity.RecStatus; + updateproject.Modifier = entity.Modifier; + updateproject.Modifytime = entity.Modifytime; + + } + + _context.SaveChanges(); + resultEntity.ReturnID = entity.Id; + resultEntity.Result = true; + } + catch (Exception ex) + { + resultEntity.Result = false; + resultEntity.Message = "淇濆瓨澶辫触锛岃鑱旂郴绠$悊鍛�"; + + } + return resultEntity; + } + + public AdmTongxunluDTO Get(string id) + { + + var entity = _context.AdmTongxunlus.Find(id); + + if (entity.RecStatus != "A") + { + entity = new AdmTongxunlu(); + } + + var result = _mapper.Map<AdmTongxunluDTO>(entity); + + + return result; + } + + public ResultDataEntity<AdmTongxunluDTO> SearchByPaging(AdmTongxunluDTOSearch searchEntity) + { + + + + ResultDataEntity<AdmTongxunluDTO> data = new ResultDataEntity<AdmTongxunluDTO>(); + List<AdmTongxunluDTO> list = new List<AdmTongxunluDTO>(); + + + + var listCode = (from a in _context.SysCodeDtls + join b in _context.SysCodes + on a.CodeId equals b.Id + where a.RecStatus == "A" + && b.RecStatus == "A" + select new CodeDataEntity() + { + CodeId = b.Id, + CodeTable = b.CodeTable, + CodeField = b.CodeField, + CodeSn = a.CodeSn, + Comments = a.Comments, + Contents = a.Contents, + RecStatus = a.RecStatus, + Sort = a.Sort + } + ); + + ///AdmTongxunlus + var query = (from a in _context.AdmTongxunlus + + + join e in listCode.Where(x => x.CodeTable == "adm_tongxunlu" && x.CodeField == "type_id") + on a.TypeId equals e.CodeSn + into esssss + from eee in esssss.DefaultIfEmpty() + + + + + + + where a.RecStatus == "A" + + && (string.IsNullOrWhiteSpace(searchEntity.TypeId) || a.TypeId == searchEntity.TypeId.Trim()) + && (string.IsNullOrWhiteSpace(searchEntity.DanweiName) || a.DanweiName.Contains(searchEntity.DanweiName.Trim())) + && (string.IsNullOrWhiteSpace(searchEntity.Creater) || a.Creater == searchEntity.Creater.Trim()) + + + + + + + select new AdmTongxunluDTO + { + Id = a.Id, + TypeId = a.TypeId, + TypeName = eee.Comments, + DanweiName = a.DanweiName, + Lianxiren = a.Lianxiren, + Lianxidianhua = a.Lianxidianhua, + // DocContent = a.DocContent, + Beuzhu = a.Beuzhu, + + + + + + + + Creater = a.Creater, + Createtime = a.Createtime, + + RecStatus = a.RecStatus, + Modifier = a.Modifier, + Modifytime = a.Modifytime, + + } + ).OrderByDescending(x => x.Modifytime).ToList(); + + + + //if (searchEntity.totalrows == 0) + searchEntity.totalrows = query.Count(); + var lianlist = query.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList(); + data.LoadData(searchEntity, lianlist); + return data; + } + + + + + + + /// <summary> + /// 淇敼涓昏〃鐘舵�� + /// </summary> + /// <param name="id">涓籭d</param> + /// <param name="userid">鐢ㄦ埛</param> + /// <returns></returns> + public ResultEntity ModifyStatus(string id, string userid) + { + ResultEntity result = new ResultEntity(); + result.Result = true; + + var model = _context.AdmTongxunlus.Find(id); + if (model != null) + { + model.RecStatus = "D"; + model.Modifier = userid; + model.Modifytime = DateTime.Now; + _context.SaveChanges(); + } + + return result; + } + + + /// <summary> + /// 鑾峰彇鎵�鏈夋湁鏁堣鑹� + /// </summary> + /// <returns></returns> + public List<AdmTongxunluDTO> GetList() + { + + + var listRole = _context.AdmTongxunlus.Where(r => r.RecStatus == "A").ToList(); + + + var list = _mapper.Map<List<AdmTongxunluDTO>>(listRole); + return list; + } + } +} diff --git a/zhengcaioa/Services/AdmZhanghaomimaService.cs b/zhengcaioa/Services/AdmZhanghaomimaService.cs new file mode 100644 index 0000000..cbe1fa2 --- /dev/null +++ b/zhengcaioa/Services/AdmZhanghaomimaService.cs @@ -0,0 +1,222 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using AutoMapper; +using DTO; +using IServices; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.EntityFrameworkCore; +using zhengcaioa.Models; + + + +namespace Services +{ + public class AdmZhanghaomimaService: IAdmZhanghaomimaService + { + private readonly zhengcaioaContext _context; + private readonly IMapper _mapper; + public AdmZhanghaomimaService(zhengcaioaContext context, IMapper mapper) + { + _context = context; + _mapper = mapper; + } + public ResultEntity save(AdmZhanghaomimaDTO dto) + { + ResultEntity resultEntity = new ResultEntity(); + try + { + + + var entity = _mapper.Map<AdmZhanghaomima>(dto); + + + if (String.IsNullOrEmpty(entity.Id)) + { + entity.Id = Guid.NewGuid().ToString(); + dto.Id = entity.Id; + _context.AdmZhanghaomimas.Add(entity); + } + else + { + var updateproject = _context.AdmZhanghaomimas.Find(entity.Id); + + updateproject.TypeId = entity.TypeId; + updateproject.Chanpinxiangmu = entity.Chanpinxiangmu; + + + updateproject.Zhanghao = entity.Zhanghao; + updateproject.Mima = entity.Mima; + updateproject.Mibao = entity.Mibao; + + updateproject.RecStatus = entity.RecStatus; + updateproject.Modifier = entity.Modifier; + updateproject.Modifytime = entity.Modifytime; + + } + + _context.SaveChanges(); + resultEntity.ReturnID = entity.Id; + resultEntity.Result = true; + } + catch (Exception ex) + { + resultEntity.Result = false; + resultEntity.Message = "淇濆瓨澶辫触锛岃鑱旂郴绠$悊鍛�"; + + } + return resultEntity; + } + + public AdmZhanghaomimaDTO Get(string id) + { + + var entity = _context.AdmZhanghaomimas.Find(id); + + if (entity.RecStatus != "A") + { + entity = new AdmZhanghaomima(); + } + + var result = _mapper.Map<AdmZhanghaomimaDTO>(entity); + + + return result; + } + + public ResultDataEntity<AdmZhanghaomimaDTO> SearchByPaging(AdmZhanghaomimaDTOSearch searchEntity) + { + + + + ResultDataEntity<AdmZhanghaomimaDTO> data = new ResultDataEntity<AdmZhanghaomimaDTO>(); + List<AdmZhanghaomimaDTO> list = new List<AdmZhanghaomimaDTO>(); + + + + var listCode = (from a in _context.SysCodeDtls + join b in _context.SysCodes + on a.CodeId equals b.Id + where a.RecStatus == "A" + && b.RecStatus == "A" + select new CodeDataEntity() + { + CodeId = b.Id, + CodeTable = b.CodeTable, + CodeField = b.CodeField, + CodeSn = a.CodeSn, + Comments = a.Comments, + Contents = a.Contents, + RecStatus = a.RecStatus, + Sort = a.Sort + } + ); + + ///AdmZhanghaomimas + var query = (from a in _context.AdmZhanghaomimas + + + join e in listCode.Where(x => x.CodeTable == "adm_zhanghaomima" && x.CodeField == "type_id") + on a.TypeId equals e.CodeSn + into esssss + from eee in esssss.DefaultIfEmpty() + + + + + + + where a.RecStatus == "A" + + && (string.IsNullOrWhiteSpace(searchEntity.TypeId) || a.TypeId == searchEntity.TypeId.Trim()) + && (string.IsNullOrWhiteSpace(searchEntity.Chanpinxiangmu) || a.Chanpinxiangmu.Contains(searchEntity.Chanpinxiangmu.Trim())) + && (string.IsNullOrWhiteSpace(searchEntity.Creater) || a.Creater == searchEntity.Creater.Trim()) + + + + + + + select new AdmZhanghaomimaDTO + { + Id = a.Id, + TypeId = a.TypeId, + TypeName = eee.Comments, + Chanpinxiangmu = a.Chanpinxiangmu, + Zhanghao = a.Zhanghao, + Mima = a.Mima, + // DocContent = a.DocContent, + Mibao = a.Mibao, + + + + + + + + + Creater = a.Creater, + Createtime = a.Createtime, + + RecStatus = a.RecStatus, + Modifier = a.Modifier, + Modifytime = a.Modifytime, + + } + ).OrderByDescending(x => x.Modifytime).ToList(); + + + + //if (searchEntity.totalrows == 0) + searchEntity.totalrows = query.Count(); + var lianlist = query.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList(); + data.LoadData(searchEntity, lianlist); + return data; + } + + + + + + + /// <summary> + /// 淇敼涓昏〃鐘舵�� + /// </summary> + /// <param name="id">涓籭d</param> + /// <param name="userid">鐢ㄦ埛</param> + /// <returns></returns> + public ResultEntity ModifyStatus(string id, string userid) + { + ResultEntity result = new ResultEntity(); + result.Result = true; + + var model = _context.AdmZhanghaomimas.Find(id); + if (model != null) + { + model.RecStatus = "D"; + model.Modifier = userid; + model.Modifytime = DateTime.Now; + _context.SaveChanges(); + } + + return result; + } + + + /// <summary> + /// 鑾峰彇鎵�鏈夋湁鏁堣鑹� + /// </summary> + /// <returns></returns> + public List<AdmZhanghaomimaDTO> GetList() + { + + + var listRole = _context.AdmZhanghaomimas.Where(r => r.RecStatus == "A").ToList(); + + + var list = _mapper.Map<List<AdmZhanghaomimaDTO>>(listRole); + return list; + } + } +} diff --git a/zhengcaioa/zhengcaioa/Controllers/admin/AdmGoodsManageController.cs b/zhengcaioa/zhengcaioa/Controllers/admin/AdmGoodsManageController.cs index 0f16229..a4c75bd 100644 --- a/zhengcaioa/zhengcaioa/Controllers/admin/AdmGoodsManageController.cs +++ b/zhengcaioa/zhengcaioa/Controllers/admin/AdmGoodsManageController.cs @@ -153,7 +153,7 @@ return new JsonResult(_admGoodsManageService.SearchByPaging(search)); } - public IActionResult Edit(string id = null) + public IActionResult Edit(string id = null,string ClassifyIds = "") { var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; @@ -163,9 +163,9 @@ { dto = _admGoodsManageService.Get(id); } - + ViewBag.ClassifyIds = ClassifyIds; @@ -219,13 +219,17 @@ - public IActionResult Chuku() + public IActionResult Chuku(string id = null) { var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; AdmGoodsManageDTO dto = new AdmGoodsManageDTO(); - + if (!String.IsNullOrEmpty(id)) + { + dto = _admGoodsManageService.Get(id); + } + ViewBag.ClassifyId = _admGoodsClassifyService.GetList(); ViewBag.Goods = _admGoodsManageService.GetList().Where(x => x.GoodsStatus == "A").ToList(); @@ -280,12 +284,16 @@ - public IActionResult Ruku() + public IActionResult Ruku(string id=null) { var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); ViewData["curentuser"] = curentuser; AdmGoodsManageDTO dto = new AdmGoodsManageDTO(); + if (!String.IsNullOrEmpty(id)) + { + dto = _admGoodsManageService.Get(id); + } ViewBag.ClassifyId = _admGoodsClassifyService.GetList(); diff --git a/zhengcaioa/zhengcaioa/Controllers/admin/AdmTongxunluController.cs b/zhengcaioa/zhengcaioa/Controllers/admin/AdmTongxunluController.cs new file mode 100644 index 0000000..066271e --- /dev/null +++ b/zhengcaioa/zhengcaioa/Controllers/admin/AdmTongxunluController.cs @@ -0,0 +1,163 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using AutoMapper; +using AngleSharp.Html.Parser; +using DTO; +using IServices; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Bot.Builder.Integration.AspNet.Core; +using Microsoft.Extensions.Logging; +using Newtonsoft.Json; +using System.Net.Http; +using System.Threading.Tasks; +using zhengcaioa.Models; +using zhengcaioa.IService; +using CommonToolsCore; +using Services; +using System.Transactions; + + +namespace zhengcaioa.Controllers.admin +{ + public class AdmTongxunluController : Controller + { + private readonly ILogger<AdmTongxunluController> _logger; + private readonly ILiaotianService _liaotianService; + private readonly IAdmTongxunluService _admTongxunluService; + + + + public AdmTongxunluController(ILogger<AdmTongxunluController> logger, ILiaotianService liaotianService, IAdmTongxunluService admTongxunluService) { + _logger = logger; + _liaotianService = liaotianService; + _admTongxunluService = admTongxunluService; + + + } + + public IActionResult Index() + { + var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); + ViewData["curentuser"] = curentuser; + List<ActionEntity> actionlist = new List<ActionEntity>(); + ActionEntity actionEntity = new ActionEntity(); + actionEntity.OpenType = 0; + actionEntity.ActionUrl = ""; + actionEntity.ActionFun = "Search"; + actionEntity.PageIco = "fa fa-search"; + actionEntity.ActionName = "鏌ヨ"; + actionlist.Add(actionEntity); + + + + + + ActionEntity actionEntity1 = new ActionEntity(); + actionEntity1.OpenType = 0; + actionEntity1.ActionUrl = ""; + actionEntity1.ActionFun = "Add"; + actionEntity1.PageIco = "fa fa-plus"; + actionEntity1.ActionName = "鏂板"; + actionlist.Add(actionEntity1); + + + + + + ViewData["ActionInfo"] = actionlist; + + + + + ViewBag.TypeId = _liaotianService.GetSYScode("adm_tongxunlu", "type_id").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); + + + + + + return View(); + + } + + public IActionResult GetList(AdmTongxunluDTOSearch search) + { + var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); + ViewData["curentuser"] = curentuser; + search.Creater = curentuser.Id; + //JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver()); + return new JsonResult(_admTongxunluService.SearchByPaging(search)); + } + + public IActionResult Edit(string id = null) + { + var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); + ViewData["curentuser"] = curentuser; + + AdmTongxunluDTO dto = new AdmTongxunluDTO(); + if (!String.IsNullOrEmpty(id)) + { + dto = _admTongxunluService.Get(id); + } + + + + + + ViewBag.TypeId = _liaotianService.GetSYScode("adm_tongxunlu", "type_id"); + + ViewData.Model = dto; + return View(); + } + + + /// <summary> + /// 淇濆瓨 + /// </summary> + /// <param name="data">宀椾綅瀹炰綋绫诲璞�</param> + /// <returns></returns> + /// + [HttpPost] + public IActionResult Save(AdmTongxunluDTO data) + { + // data.DocContent = data.DocContent.Replace("锛�", ";"); + ResultEntity resultEntity = new ResultEntity(); + using (TransactionScope scope = new TransactionScope()) + { + var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); + ViewData["curentuser"] = curentuser; + data.RecStatus = "A"; + if (String.IsNullOrEmpty(data.Id)) + { + data.Creater = curentuser.Id; + data.Createtime = DateTime.Now; + } + data.Modifier = curentuser.Id; + data.Modifytime = DateTime.Now; + + resultEntity = _admTongxunluService.save(data); + scope.Complete(); + } + + + return new JsonResult(resultEntity); + } + + + /// <summary> + /// 鍒犻櫎涓讳俊鎭� + /// </summary> + /// <param name="info">瀹炰綋</param> + /// <returns></returns> + /// + public IActionResult Nullify(string Id = "") + { + var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); + ViewData["curentuser"] = curentuser; + return new JsonResult(_admTongxunluService.ModifyStatus(Id, curentuser.Id)); + } + + } +} diff --git a/zhengcaioa/zhengcaioa/Controllers/admin/AdmZhanghaomimaController.cs b/zhengcaioa/zhengcaioa/Controllers/admin/AdmZhanghaomimaController.cs new file mode 100644 index 0000000..4e5136f --- /dev/null +++ b/zhengcaioa/zhengcaioa/Controllers/admin/AdmZhanghaomimaController.cs @@ -0,0 +1,163 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using AutoMapper; +using AngleSharp.Html.Parser; +using DTO; +using IServices; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Bot.Builder.Integration.AspNet.Core; +using Microsoft.Extensions.Logging; +using Newtonsoft.Json; +using System.Net.Http; +using System.Threading.Tasks; +using zhengcaioa.Models; +using zhengcaioa.IService; +using CommonToolsCore; +using Services; +using System.Transactions; + +namespace zhengcaioa.Controllers.admin +{ + public class AdmZhanghaomimaController : Controller + { + + private readonly ILogger<AdmZhanghaomimaController> _logger; + private readonly ILiaotianService _liaotianService; + private readonly IAdmZhanghaomimaService _admZhanghaomimaService; + + + + public AdmZhanghaomimaController(ILogger<AdmZhanghaomimaController> logger, ILiaotianService liaotianService, IAdmZhanghaomimaService admZhanghaomimaService) + { + _logger = logger; + _liaotianService = liaotianService; + _admZhanghaomimaService = admZhanghaomimaService; + + + } + + public IActionResult Index() + { + var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); + ViewData["curentuser"] = curentuser; + List<ActionEntity> actionlist = new List<ActionEntity>(); + ActionEntity actionEntity = new ActionEntity(); + actionEntity.OpenType = 0; + actionEntity.ActionUrl = ""; + actionEntity.ActionFun = "Search"; + actionEntity.PageIco = "fa fa-search"; + actionEntity.ActionName = "鏌ヨ"; + actionlist.Add(actionEntity); + + + + + + ActionEntity actionEntity1 = new ActionEntity(); + actionEntity1.OpenType = 0; + actionEntity1.ActionUrl = ""; + actionEntity1.ActionFun = "Add"; + actionEntity1.PageIco = "fa fa-plus"; + actionEntity1.ActionName = "鏂板"; + actionlist.Add(actionEntity1); + + + + + + ViewData["ActionInfo"] = actionlist; + + + + + ViewBag.TypeId = _liaotianService.GetSYScode("adm_zhanghaomima", "type_id").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList(); + + + + + + return View(); + + } + + public IActionResult GetList(AdmZhanghaomimaDTOSearch search) + { + var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); + ViewData["curentuser"] = curentuser; + search.Creater = curentuser.Id; + //JsonResult jsonResult = new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver()); + return new JsonResult(_admZhanghaomimaService.SearchByPaging(search)); + } + + public IActionResult Edit(string id = null) + { + var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); + ViewData["curentuser"] = curentuser; + + AdmZhanghaomimaDTO dto = new AdmZhanghaomimaDTO(); + if (!String.IsNullOrEmpty(id)) + { + dto = _admZhanghaomimaService.Get(id); + } + + + + + + ViewBag.TypeId = _liaotianService.GetSYScode("adm_zhanghaomima", "type_id"); + + ViewData.Model = dto; + return View(); + } + + + /// <summary> + /// 淇濆瓨 + /// </summary> + /// <param name="data">宀椾綅瀹炰綋绫诲璞�</param> + /// <returns></returns> + /// + [HttpPost] + public IActionResult Save(AdmZhanghaomimaDTO data) + { + // data.DocContent = data.DocContent.Replace("锛�", ";"); + ResultEntity resultEntity = new ResultEntity(); + using (TransactionScope scope = new TransactionScope()) + { + var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); + ViewData["curentuser"] = curentuser; + data.RecStatus = "A"; + if (String.IsNullOrEmpty(data.Id)) + { + data.Creater = curentuser.Id; + data.Createtime = DateTime.Now; + } + data.Modifier = curentuser.Id; + data.Modifytime = DateTime.Now; + + resultEntity = _admZhanghaomimaService.save(data); + scope.Complete(); + } + + + return new JsonResult(resultEntity); + } + + + /// <summary> + /// 鍒犻櫎涓讳俊鎭� + /// </summary> + /// <param name="info">瀹炰綋</param> + /// <returns></returns> + /// + public IActionResult Nullify(string Id = "") + { + var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); + ViewData["curentuser"] = curentuser; + return new JsonResult(_admZhanghaomimaService.ModifyStatus(Id, curentuser.Id)); + } + } +} diff --git a/zhengcaioa/zhengcaioa/Startup.cs b/zhengcaioa/zhengcaioa/Startup.cs index 3d56be9..f13e6d3 100644 --- a/zhengcaioa/zhengcaioa/Startup.cs +++ b/zhengcaioa/zhengcaioa/Startup.cs @@ -146,6 +146,9 @@ services.AddScoped(typeof(IOrderBanciOrderService), typeof(OrderBanciOrderService)); services.AddScoped(typeof(ISysBaimingdanService), typeof(SysBaimingdanService)); + services.AddScoped(typeof(IAdmZhanghaomimaService), typeof(AdmZhanghaomimaService)); + services.AddScoped(typeof(IAdmTongxunluService), typeof(AdmTongxunluService)); + services.AddScoped(typeof(IAskService), typeof(AskService)); //zcweb diff --git a/zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Chuku.cshtml b/zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Chuku.cshtml index 17122a0..c52535a 100644 --- a/zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Chuku.cshtml +++ b/zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Chuku.cshtml @@ -107,9 +107,18 @@ @foreach (var item in ClassifyId) { - <option value="@item.Id" hassubinfo="true"> - @item.ClassifyName - </option> + @if (!item.Id.Equals(Model.ClassifyId)) + { + <option value="@item.Id" hassubinfo="true"> + @item.ClassifyName + </option> + } + else + { + <option value="@item.Id" hassubinfo="true" selected="selected"> + @item.ClassifyName + </option> + } } @@ -125,9 +134,18 @@ @foreach (var item in Goods) { - <option value="@item.Id" hassubinfo="true"> - @item.GoodsName - </option> + @if (!item.Id.Equals(Model.Id)) + { + <option value="@item.Id" hassubinfo="true"> + @item.GoodsName + </option> + } + else + { + <option value="@item.Id" hassubinfo="true" selected="selected"> + @item.GoodsName + </option> + } } @@ -144,7 +162,7 @@ <label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">鍓╀綑鏁伴噺</label> <div class="col-sm-2 col-md-2" grouptype="Vdata"> - <input class="form-control" label="鍓╀綑鏁伴噺" name="GoodsLeft" id="GoodsLeft" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="number" value="" readonly=""> + <input class="form-control" label="鍓╀綑鏁伴噺" name="GoodsLeft" id="GoodsLeft" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="number" value="@Model.GoodsLeft" readonly=""> </div> diff --git a/zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Edit.cshtml b/zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Edit.cshtml index 32c82aa..86850ac 100644 --- a/zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Edit.cshtml +++ b/zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Edit.cshtml @@ -10,6 +10,8 @@ List<SysCodeDtl> shifou = ViewData["shifou"] as List<SysCodeDtl>; //鐗╁搧鐘舵�� + string ClassifyIds = ViewData["ClassifyIds"] as string; //鐗╁搧绫诲瀷 + } @{ Layout = null; @@ -304,7 +306,11 @@ } else { $("#GoodsStatus").val("A"); + $("#ClassifyId").val("@ClassifyIds"); } + + + }); @@ -377,7 +383,7 @@ toastr.warning("鏄惁鑰楁潗涓嶈兘涓虹┖"); return; } - + @@ -398,7 +404,7 @@ if (data.Result) { // parent._afterSave(true); parent.layer.msg('鎴愬姛淇濆瓨', { icon: 6 }); - window.location = "/AdmGoodsManage/Edit"; + window.location = "/AdmGoodsManage/Edit?ClassifyIds=" + $("#ClassifyId").val(); //try { diff --git a/zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Index.cshtml b/zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Index.cshtml index 1daba6c..0645e97 100644 --- a/zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Index.cshtml +++ b/zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Index.cshtml @@ -29,7 +29,18 @@ { label: '鍓╀綑鏁伴噺', name: 'GoodsLeft', labtype: 'txt', hidden: false, width: 100 }, { label: '鐗╁搧鐘舵��', name: 'GoodsStatusName', labtype: 'txt', hidden: false, width: 100 }, - + { + label: '鍏ュ簱', name: 'GoodsName', labtype: 'txt', hidden: false, width: 50, + formatter: function (cellvalue, options, rowObject) { + return "<a onclick=\"OpenWindow('鍏ュ簱','98%','100%', '/AdmGoodsManage/Ruku?id=" + rowObject.Id + "')\" >鍏ュ簱</a>"; + } + }, + { + label: '鍑哄簱', name: 'GoodsName', labtype: 'txt', hidden: false, width: 50, + formatter: function (cellvalue, options, rowObject) { + return "<a onclick=\"OpenWindow('鍑哄簱','98%','100%', '/AdmGoodsManage/Chuku?id=" + rowObject.Id + "')\" >鍑哄簱</a>"; + } + }, ]; dataUrl = "/AdmGoodsManage/GetList"; searchCol = [ diff --git a/zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Ruku.cshtml b/zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Ruku.cshtml index 2870a79..af481f9 100644 --- a/zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Ruku.cshtml +++ b/zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Ruku.cshtml @@ -106,11 +106,20 @@ <option value="" hassubinfo="true">璇烽�夋嫨</option> @foreach (var item in ClassifyId) { - + + @if (!item.Id.Equals(Model.ClassifyId)) + { <option value="@item.Id" hassubinfo="true"> @item.ClassifyName </option> - + } + else + { + <option value="@item.Id" hassubinfo="true" selected="selected"> + @item.ClassifyName + </option> + } + } @@ -124,10 +133,21 @@ <option value="" hassubinfo="true">璇烽�夋嫨</option> @foreach (var item in Goods) { + @if (!item.Id.Equals(Model.Id)) + { + <option value="@item.Id" hassubinfo="true"> + @item.GoodsName + </option> + } + else + { + <option value="@item.Id" hassubinfo="true" selected="selected"> + @item.GoodsName + </option> + } - <option value="@item.Id" hassubinfo="true"> - @item.GoodsName - </option> + + } @@ -144,7 +164,7 @@ <label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">鍓╀綑鏁伴噺</label> <div class="col-sm-2 col-md-2" grouptype="Vdata"> - <input class="form-control" label="鍓╀綑鏁伴噺" name="GoodsLeft" id="GoodsLeft" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="number" value="" readonly=""> + <input class="form-control" label="鍓╀綑鏁伴噺" name="GoodsLeft" id="GoodsLeft" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="number" value="@Model.GoodsLeft" readonly=""> </div> diff --git a/zhengcaioa/zhengcaioa/Views/AdmTongxunlu/Edit.cshtml b/zhengcaioa/zhengcaioa/Views/AdmTongxunlu/Edit.cshtml new file mode 100644 index 0000000..bac36f2 --- /dev/null +++ b/zhengcaioa/zhengcaioa/Views/AdmTongxunlu/Edit.cshtml @@ -0,0 +1,309 @@ +锘緻model DTO.AdmTongxunluDTO +@using DTO; +@using zhengcaioa.Models; +@{ + + + List<SysCodeDtl> TypeId = ViewData["TypeId"] as List<SysCodeDtl>; //鐗╁搧鐘舵�� + + + +} +@{ + Layout = null; +} + +<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> + <meta name="description" content=""> + <meta name="author" content="ThemeBucket"> + <title>@(SiteConfig.SiteName)</title> + <link href="~/css/bootstrap.min.css" rel="stylesheet"> + <link href="~/css/font-awesome.min.css" rel="stylesheet"> + <link href="~/css/animate.min.css" rel="stylesheet"> + + @*<link href="~/css/plugins/iCheck/custom.css" rel="stylesheet">*@ + <link href="~/css/style.min.css" rel="stylesheet"> + <link href="~/css/plugins/chosen/chosen.css" rel="stylesheet"> + @*<link href="~/js/plugins/layer/skin/layer.css" rel="stylesheet">*@ + @*<link href="~/css/plugins/datapicker/datepicker3.css" rel="stylesheet">*@ + <link href="~/css/style.min.css" rel="stylesheet"> + <link href="~/css/plugins/toastr/toastr.min.css" rel="stylesheet" /> + <link href="~/css/plugins/webuploader/webuploader.css" rel="stylesheet" /> + + <style type="text/css"> + .webuploader-pick { + position: relative; + display: inline-block; + cursor: pointer; + background: #00b7ee; + padding: 8px 14px 7px 14px; + color: #fff; + text-align: center; + border-radius: 3px; + overflow: hidden; + } + + div.clearfix > label { + padding-top: 8px; + } + + .chosen-container { + border-radius: 1px; + border: 1px solid #e5e6e7; + } + + .col-md-1.control-label { + padding-right: 0px; + font-weight: 400; + } + </style> + + <!-- jqgrid--> + @*<link href="~/css/plugins/jqgrid/ui.jqgrid.css" rel="stylesheet">*@ + <script language="javascript" src="~/js/jquery.min.js" type="text/javascript"></script> + <script src="~/js/bootstrap.min.js"></script> + @*<script src="~/js/plugins/bootstro/bootstro.js"></script>*@ + + <!--瀹瑰櫒--> + @*<script language="javascript" src="~/js/datehelper.js" type="text/javascript"></script>*@ + @*<script language="javascript" src="~/js/plugins/query/jquery.query-object.js" type="text/javascript"></script>*@ + @*<script language="javascript" src="~/js/plugins/iCheck/icheck.min.js" type="text/javascript"></script>*@ + <script language="javascript" src="~/js/plugins/chosen/chosen.jquery.js" type="text/javascript"></script> + @*<script language="javascript" src="~/js/plugins/datapicker/bootstrap-datepicker.js" type="text/javascript"></script>*@ + <script language="javascript" src="~/js/plugins/layer/layer.js" type="text/javascript"></script> + @*<script src="~/js/plugins/jqgrid/jquery.jqGrid.min.js" type="text/javascript"></script>*@ + @*<script src="~/js/plugins/jqgrid/i18n/grid.locale-cn.js" type="text/javascript"></script>*@ + <script src="~/js/plugins/toastr/toastr.min.js" type="text/javascript"></script> + <script src="~/js/plugins/webuploader/webuploader.min.js"></script> + + <script language="javascript" src="~/js/common-layout.js" type="text/javascript"></script> + <script src="~/js/plugins/layer/laydate/laydate.js" type="text/javascript"></script> + @*<script src="~/js/plugins/iTexbox/itextbox.js" type="text/javascript"></script>*@ + @*<script src="~/js/plugins/iuploader/iuploader.js"></script>*@ + <script src="~/js/TUJS.js"></script> +</head> +<body class="gray-bg" style="overflow:auto"> + <form id="formtest"> + <div class="wrapper wrapper-content" id="ibox-content" style="padding:15px;"> + <div class="row"> + <div class="col-sm-12"> + <div class="ibox float-e-margins"> + <div class="ibox-title"> + <h5> <i class="fa fa-list"></i> 鍩烘湰淇℃伅</h5> + </div> + <div id="div_content" class="ibox-content" style="background-color:white;"> + <div class="row"> + <div class="clearfix layer-area" style="padding-bottom:15px;"> + <label class="text-right col-sm-1 col-md-1 control-label">绫诲埆<i class="red">*</i></label> + <div class="col-sm-2 col-md-2"> + <select id="TypeId" class="form-control" name="TypeId" data-placeholder="閫夋嫨 搴忓垪 ..."> + <option value="" hassubinfo="true">璇烽�夋嫨</option> + @foreach (var item in TypeId) + { + @if (!item.CodeSn.Equals(Model.TypeId)) + { + <option value="@item.CodeSn" hassubinfo="true"> + @item.Comments + </option> + } + else + { + <option value="@item.CodeSn" hassubinfo="true" selected="selected"> + @item.Comments + </option> + } + + } + + </select> + <input type="hidden" id="Id" name="Id" value="@Model.Id" /> + </div> + <label class="text-right col-sm-1 col-md-1 control-label">鍗曚綅鍚嶇О<i class="red">*</i></label> + <div class="col-sm-2 col-md-2"> + <input id="DanweiName" class="form-control" label="鍗曚綅鍚嶇О" name="DanweiName" labtype="txt" addvisible="true" editvisible="true" maxlength="100" reg="" ismust="true" type="text" value="@Model.DanweiName"> + + </div> + + + </div> + + <div class="clearfix layer-area" style="padding-bottom:15px;"> + + + <label class="text-right col-sm-1 col-md-1 control-label">鑱旂郴浜�<i class="red">*</i></label> + <div class="col-sm-2 col-md-2"> + <input id="Lianxiren" class="form-control" label="鑱旂郴浜�" name="Lianxiren" labtype="txt" addvisible="true" editvisible="true" maxlength="100" reg="" ismust="true" type="text" value="@Model.Lianxiren"> + + </div> + + <label class="text-right col-sm-1 col-md-1 control-label">鑱旂郴鐢佃瘽<i class="red">*</i></label> + <div class="col-sm-2 col-md-2"> + <input id="Lianxidianhua" class="form-control" label="鑱旂郴鐢佃瘽" name="Lianxidianhua" labtype="txt" addvisible="true" editvisible="true" maxlength="100" reg="" ismust="true" type="text" value="@Model.Lianxidianhua"> + + </div> + + + </div> + + + <div class="clearfix layer-area" style="padding-bottom:15px;"> + <label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">澶囨敞</label> + <div class="col-sm-11 col-md-11"> + <textarea class="form-control bt" id="Beuzhu" name="Beuzhu" title="澶囨敞" isempty="" maxlength="500" length="long" style="resize:none;overflow-y:hidden; min-height:60px;" onpropertychange="this.style.height=this.scrollHeight + 'px'" oninput="this.style.height=this.scrollHeight + 'px'">@Model.Beuzhu</textarea> + </div> + </div> + + + + + + </div> + + + + + + + + + + + + + + + </div> + </div> + </div> + </div> + </div> + </div> + <div class="wrapper wrapper-content" style="margin-top:0px"></div> + <div class="ibox-content" id="top" style="z-index:100; position:fixed; height:50px; width:100%;bottom:0; text-align: right; padding-top:8px "> + <div class="" style="float:right;" data-bootstro-width="500px" data-bootstro-content="鍔熻兘鎸夐挳锛氣�滀繚瀛樷�濓紝鈥滃垹闄も��"> + + + <a class="btn btn-success" href="javascript:void(0)" onclick="savePosition();" style="margin-left:4px; border-radius:4px;"> + <i class="glyphicon glyphicon-ok"></i> <span class="bold">鎻愪氦</span> + </a> + </div> + </div> + + </form> + + <script type="text/javascript"> + var hh = document.body.clientHeight - $('.ibox-title').height() - $("#top").height() * 2 - 95; + $("#div_content").height(hh); + + toastr.options = { + "closeButton": true, + "debug": false, + "progressBar": true, + "positionClass": "toast-bottom-right", + "onclick": null, + "showDuration": "300", + "hideDuration": "600", + "timeOut": "4500", + "extendedTimeOut": "600", + "showEasing": "swing", + "hideEasing": "linear", + "showMethod": "fadeIn", + "hideMethod": "fadeOut" + }; + + var Beuzhu = document.getElementById("Beuzhu"); + + Beuzhu.style.height = Beuzhu.scrollHeight + 'px'; + + var id = '@Model.Id'; + + + + + + // 淇濆瓨宀椾綅淇℃伅 + var savePosition = function () { + + + + if ($("#TypeId").val() == '') { + toastr.warning("绫诲埆涓嶈兘涓虹┖"); + return; + } + if ($.trim($("#DanweiName").val()) == '') { + toastr.warning("鍗曚綅鍚嶇О涓嶈兘涓虹┖"); + return; + } + + if ($.trim($("#Lianxiren").val()) == '') { + toastr.warning("鑱旂郴浜轰笉鑳戒负绌�"); + return; + } + if ($.trim($("#Lianxidianhua").val()) == '') { + toastr.warning("鑱旂郴鐢佃瘽涓嶈兘涓虹┖"); + return; + } + + + + + + + + // var data = { id: $("#Id").val(), DocType: $("#DocType").val(), DocDept: $("#DocDept").val(), PublishTime: $("#PublishTime").val(), DocNo: $("#DocNo").val(), DocTitle: $("#DocTitle").val(), DocContent: ueue, DocZtc: $("#DocZtc").val(), Printtimes: $("#Printtimes").val(), DocCsdw: $("#DocCsdw").val(), PrintStatus: $("#PrintStatus").val()} + $.ajax({ + type: "POST", + url: "/AdmTongxunlu/Save", + dataType: "json", + global: false, + data: $('form').serializeArray(), + success: function (data) { + + + + if (data.Result) { + // parent._afterSave(true); + parent.layer.msg('鎴愬姛淇濆瓨', { icon: 6 }); + + + + try { + _pageAutoClose();//鑷姩鍏抽棴椤甸潰鏂规硶 + } + catch (err) { + parent._CloseTab1("/AdmTongxunlu/Edit/"); + } + + } + else { + // toastr.error("澶辫触"); + parent.layer.msg(data.Message, { icon: 5 }); + } + + }, + error: function () { + + + parent.layer.msg('澶辫触', { icon: 5 }); + } + }); + } + + + + + function _pageAutoClose() { + parent.window._reloadPageData(); + var index = parent.layer.getFrameIndex(window.name); + parent.layer.isRefresh = true; + parent.layer.closeAll('loading'); + parent.layer.close(index); + return false; + } + </script> +</body> +</html> \ No newline at end of file diff --git a/zhengcaioa/zhengcaioa/Views/AdmTongxunlu/Index.cshtml b/zhengcaioa/zhengcaioa/Views/AdmTongxunlu/Index.cshtml new file mode 100644 index 0000000..36e517d --- /dev/null +++ b/zhengcaioa/zhengcaioa/Views/AdmTongxunlu/Index.cshtml @@ -0,0 +1,123 @@ +锘緻{ + ViewBag.Title = "AdmTongxunlu"; + Layout = "~/Views/Shared/_Layout_Search.cshtml"; +} +@section headerStyle{ + <script type="text/javascript"> + + var TypeId = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.TypeId))'; + + + + + dataCol = [ + { label: 'id', name: 'Id', labtype: 'txt', hidden: true }, + { + label: '绫诲埆', name: 'TypeName', labtype: 'txt', hidden: false, width: 100 + }, + + { + label: '鍗曚綅鍚嶇О', name: 'DanweiName', labtype: 'txt', hidden: false, width: 100 + }, + { label: '鑱旂郴浜�', name: 'Lianxiren', labtype: 'txt', hidden: true, width: 100 }, + + { label: '鑱旂郴鐢佃瘽', name: 'Lianxidianhua', labtype: 'txt', hidden: false, width: 100 }, + { label: '澶囨敞', name: 'Beuzhu', labtype: 'txt', hidden: false, width: 100 }, + + + { + label: '鎿嶄綔', name: 'caozuo', labtype: 'txt', hidden: false, width: 50, + formatter: function (cellvalue, options, rowObject) { + return "<a onclick=\"OpenWindow('淇敼','98%','100%', '/AdmTongxunlu/Edit?id=" + rowObject.Id + "')\" >淇敼</a> <a onclick=\"_pagedel('" + rowObject.Id + "')\" >鍒犻櫎</a>"; + } + }, + + ]; + dataUrl = "/AdmTongxunlu/GetList"; + searchCol = [ + + { label: '绫诲埆', name: 'TypeId', labtype: 'combox', hidden: false, data: JSON.parse(TypeId), cwidth: '5%', cccwidth: '15%' }, + { label: '鍗曚綅鍚嶇О', name: 'DanweiName', labtype: 'txt', hidden: false }, + + + + + + + + + ]; + + + var _pageAdd = function () { + OpenWindow("鏂板鐗╁搧", "98%", "90%", "/AdmTongxunlu/Edit/"); + } + + var _pagedel = function (id) { + if (confirm('鏄惁鍒犻櫎璁板綍')) { + $.ajax({ + type: "GET", + url: "/AdmTongxunlu/Nullify?Id=" + id, + dataType: "json", + global: false, + data: '', + success: function (data) { + + + if (data.Result) { + + layer.msg('鍒犻櫎鎴愬姛', { icon: 6 }); + window._reloadPageData(); + } + else { + // toastr.error(""); + layer.msg('鍒犻櫎澶辫触', { icon: 5 }); + } + + }, + error: function () { + if ($.isNumber(imgLoad)) { + layer.close(imgLoad); + } + //toastr.error("淇濆瓨澶辫触"); + + layer.msg('淇濆瓨澶辫触', { icon: 5 }); + } + }); + } + + + } + + + + + var _afterSave = function (result) { + if (result) { + toastr.success("淇濆瓨鎴愬姛"); + } else { + toastr.error("淇濆瓨澶辫触"); + } + } + + var _afterDel = function (result) { + if (result) { + toastr.success("鍒犻櫎鎴愬姛"); + } else { + /**/ + toastr.error("鍒犻櫎鎴愬姛"); + /**/ + } +} + </script> +} + +@section footerScripts{ + <script type="text/javascript"> + + + + + + </script> +} diff --git a/zhengcaioa/zhengcaioa/Views/AdmZhanghaomima/Edit.cshtml b/zhengcaioa/zhengcaioa/Views/AdmZhanghaomima/Edit.cshtml new file mode 100644 index 0000000..efea82a --- /dev/null +++ b/zhengcaioa/zhengcaioa/Views/AdmZhanghaomima/Edit.cshtml @@ -0,0 +1,314 @@ +锘緻model DTO.AdmZhanghaomimaDTO +@using DTO; +@using zhengcaioa.Models; +@{ + + + List<SysCodeDtl> TypeId = ViewData["TypeId"] as List<SysCodeDtl>; //鐗╁搧鐘舵�� + + + +} +@{ + Layout = null; +} + +<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> + <meta name="description" content=""> + <meta name="author" content="ThemeBucket"> + <title>@(SiteConfig.SiteName)</title> + <link href="~/css/bootstrap.min.css" rel="stylesheet"> + <link href="~/css/font-awesome.min.css" rel="stylesheet"> + <link href="~/css/animate.min.css" rel="stylesheet"> + + @*<link href="~/css/plugins/iCheck/custom.css" rel="stylesheet">*@ + <link href="~/css/style.min.css" rel="stylesheet"> + <link href="~/css/plugins/chosen/chosen.css" rel="stylesheet"> + @*<link href="~/js/plugins/layer/skin/layer.css" rel="stylesheet">*@ + @*<link href="~/css/plugins/datapicker/datepicker3.css" rel="stylesheet">*@ + <link href="~/css/style.min.css" rel="stylesheet"> + <link href="~/css/plugins/toastr/toastr.min.css" rel="stylesheet" /> + <link href="~/css/plugins/webuploader/webuploader.css" rel="stylesheet" /> + + <style type="text/css"> + .webuploader-pick { + position: relative; + display: inline-block; + cursor: pointer; + background: #00b7ee; + padding: 8px 14px 7px 14px; + color: #fff; + text-align: center; + border-radius: 3px; + overflow: hidden; + } + + div.clearfix > label { + padding-top: 8px; + } + + .chosen-container { + border-radius: 1px; + border: 1px solid #e5e6e7; + } + + .col-md-1.control-label { + padding-right: 0px; + font-weight: 400; + } + </style> + + <!-- jqgrid--> + @*<link href="~/css/plugins/jqgrid/ui.jqgrid.css" rel="stylesheet">*@ + <script language="javascript" src="~/js/jquery.min.js" type="text/javascript"></script> + <script src="~/js/bootstrap.min.js"></script> + @*<script src="~/js/plugins/bootstro/bootstro.js"></script>*@ + + <!--瀹瑰櫒--> + @*<script language="javascript" src="~/js/datehelper.js" type="text/javascript"></script>*@ + @*<script language="javascript" src="~/js/plugins/query/jquery.query-object.js" type="text/javascript"></script>*@ + @*<script language="javascript" src="~/js/plugins/iCheck/icheck.min.js" type="text/javascript"></script>*@ + <script language="javascript" src="~/js/plugins/chosen/chosen.jquery.js" type="text/javascript"></script> + @*<script language="javascript" src="~/js/plugins/datapicker/bootstrap-datepicker.js" type="text/javascript"></script>*@ + <script language="javascript" src="~/js/plugins/layer/layer.js" type="text/javascript"></script> + @*<script src="~/js/plugins/jqgrid/jquery.jqGrid.min.js" type="text/javascript"></script>*@ + @*<script src="~/js/plugins/jqgrid/i18n/grid.locale-cn.js" type="text/javascript"></script>*@ + <script src="~/js/plugins/toastr/toastr.min.js" type="text/javascript"></script> + <script src="~/js/plugins/webuploader/webuploader.min.js"></script> + + <script language="javascript" src="~/js/common-layout.js" type="text/javascript"></script> + <script src="~/js/plugins/layer/laydate/laydate.js" type="text/javascript"></script> + @*<script src="~/js/plugins/iTexbox/itextbox.js" type="text/javascript"></script>*@ + @*<script src="~/js/plugins/iuploader/iuploader.js"></script>*@ + <script src="~/js/TUJS.js"></script> +</head> +<body class="gray-bg" style="overflow:auto"> + <form id="formtest"> + <div class="wrapper wrapper-content" id="ibox-content" style="padding:15px;"> + <div class="row"> + <div class="col-sm-12"> + <div class="ibox float-e-margins"> + <div class="ibox-title"> + <h5> <i class="fa fa-list"></i> 鍩烘湰淇℃伅</h5> + </div> + <div id="div_content" class="ibox-content" style="background-color:white;"> + <div class="row"> + <div class="clearfix layer-area" style="padding-bottom:15px;"> + <label class="text-right col-sm-1 col-md-1 control-label">绫诲埆<i class="red">*</i></label> + <div class="col-sm-2 col-md-2"> + <select id="TypeId" class="form-control" name="TypeId" data-placeholder="閫夋嫨 搴忓垪 ..."> + <option value="" hassubinfo="true">璇烽�夋嫨</option> + @foreach (var item in TypeId) + { + @if (!item.CodeSn.Equals(Model.TypeId)) + { + <option value="@item.CodeSn" hassubinfo="true"> + @item.Comments + </option> + } + else + { + <option value="@item.CodeSn" hassubinfo="true" selected="selected"> + @item.Comments + </option> + } + + } + + </select> + <input type="hidden" id="Id" name="Id" value="@Model.Id" /> + </div> + <label class="text-right col-sm-1 col-md-1 control-label">浜у搧椤圭洰<i class="red">*</i></label> + <div class="col-sm-2 col-md-2"> + <input id="Chanpinxiangmu" class="form-control" label="浜у搧椤圭洰" name="Chanpinxiangmu" labtype="txt" addvisible="true" editvisible="true" maxlength="100" reg="" ismust="true" type="text" value="@Model.Chanpinxiangmu"> + + </div> + + + </div> + + <div class="clearfix layer-area" style="padding-bottom:15px;"> + + + <label class="text-right col-sm-1 col-md-1 control-label">璐﹀彿<i class="red">*</i></label> + <div class="col-sm-2 col-md-2"> + <input id="Zhanghao" class="form-control" label="璐﹀彿" name="Zhanghao" labtype="txt" addvisible="true" editvisible="true" maxlength="100" reg="" ismust="true" type="text" value="@Model.Zhanghao"> + + </div> + + <label class="text-right col-sm-1 col-md-1 control-label">瀵嗙爜<i class="red">*</i></label> + <div class="col-sm-2 col-md-2"> + <input id="Mima" class="form-control" label="瀵嗙爜" name="Mima" labtype="txt" addvisible="true" editvisible="true" maxlength="100" reg="" ismust="true" type="text" value="@Model.Mima"> + + </div> + + + </div> + + <div class="clearfix layer-area" style="padding-bottom:15px;"> + + + + + <label class="text-right col-sm-1 col-md-1 control-label">瀵嗕繚</label> + <div class="col-sm-2 col-md-2"> + <input id="Mibao" class="form-control" label="瀵嗕繚" name="Mibao" labtype="txt" addvisible="true" editvisible="true" maxlength="100" reg="" ismust="true" type="text" value="@Model.Mibao"> + + </div> + + + </div> + + + + + + + </div> + + + + + + + + + + + + + + + </div> + </div> + </div> + </div> + </div> + </div> + <div class="wrapper wrapper-content" style="margin-top:0px"></div> + <div class="ibox-content" id="top" style="z-index:100; position:fixed; height:50px; width:100%;bottom:0; text-align: right; padding-top:8px "> + <div class="" style="float:right;" data-bootstro-width="500px" data-bootstro-content="鍔熻兘鎸夐挳锛氣�滀繚瀛樷�濓紝鈥滃垹闄も��"> + + + <a class="btn btn-success" href="javascript:void(0)" onclick="savePosition();" style="margin-left:4px; border-radius:4px;"> + <i class="glyphicon glyphicon-ok"></i> <span class="bold">鎻愪氦</span> + </a> + </div> + </div> + + </form> + + <script type="text/javascript"> + var hh = document.body.clientHeight - $('.ibox-title').height() - $("#top").height() * 2 - 95; + $("#div_content").height(hh); + + toastr.options = { + "closeButton": true, + "debug": false, + "progressBar": true, + "positionClass": "toast-bottom-right", + "onclick": null, + "showDuration": "300", + "hideDuration": "600", + "timeOut": "4500", + "extendedTimeOut": "600", + "showEasing": "swing", + "hideEasing": "linear", + "showMethod": "fadeIn", + "hideMethod": "fadeOut" + }; + + + + var id = '@Model.Id'; + + + + + + // 淇濆瓨宀椾綅淇℃伅 + var savePosition = function () { + + + + if ($("#TypeId").val() == '') { + toastr.warning("绫诲埆涓嶈兘涓虹┖"); + return; + } + if ($.trim($("#Chanpinxiangmu").val()) == '') { + toastr.warning("浜у搧椤圭洰涓嶈兘涓虹┖"); + return; + } + + if ($.trim($("#Zhanghao").val()) == '') { + toastr.warning("璐﹀彿涓嶈兘涓虹┖"); + return; + } + if ($.trim($("#Mima").val()) == '') { + toastr.warning("瀵嗙爜涓嶈兘涓虹┖"); + return; + } + + + + + + + + // var data = { id: $("#Id").val(), DocType: $("#DocType").val(), DocDept: $("#DocDept").val(), PublishTime: $("#PublishTime").val(), DocNo: $("#DocNo").val(), DocTitle: $("#DocTitle").val(), DocContent: ueue, DocZtc: $("#DocZtc").val(), Printtimes: $("#Printtimes").val(), DocCsdw: $("#DocCsdw").val(), PrintStatus: $("#PrintStatus").val()} + $.ajax({ + type: "POST", + url: "/AdmZhanghaomima/Save", + dataType: "json", + global: false, + data: $('form').serializeArray(), + success: function (data) { + + + + if (data.Result) { + // parent._afterSave(true); + parent.layer.msg('鎴愬姛淇濆瓨', { icon: 6 }); + + + + try { + _pageAutoClose();//鑷姩鍏抽棴椤甸潰鏂规硶 + } + catch (err) { + parent._CloseTab1("/AdmZhanghaomima/Edit/"); + } + + } + else { + // toastr.error("澶辫触"); + parent.layer.msg(data.Message, { icon: 5 }); + } + + }, + error: function () { + + + parent.layer.msg('澶辫触', { icon: 5 }); + } + }); + } + + + + + function _pageAutoClose() { + parent.window._reloadPageData(); + var index = parent.layer.getFrameIndex(window.name); + parent.layer.isRefresh = true; + parent.layer.closeAll('loading'); + parent.layer.close(index); + return false; + } + </script> +</body> +</html> \ No newline at end of file diff --git a/zhengcaioa/zhengcaioa/Views/AdmZhanghaomima/Index.cshtml b/zhengcaioa/zhengcaioa/Views/AdmZhanghaomima/Index.cshtml new file mode 100644 index 0000000..9934e52 --- /dev/null +++ b/zhengcaioa/zhengcaioa/Views/AdmZhanghaomima/Index.cshtml @@ -0,0 +1,123 @@ +锘緻{ + ViewBag.Title = "AdmZhanghaomima"; + Layout = "~/Views/Shared/_Layout_Search.cshtml"; +} +@section headerStyle{ + <script type="text/javascript"> + + var TypeId = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.TypeId))'; + + + + + dataCol = [ + { label: 'id', name: 'Id', labtype: 'txt', hidden: true }, + { + label: '绫诲埆', name: 'TypeName', labtype: 'txt', hidden: false, width: 100 + }, + + { + label: '浜у搧椤圭洰', name: 'Chanpinxiangmu', labtype: 'txt', hidden: false, width: 100 + }, + { label: '璐﹀彿', name: 'Zhanghao', labtype: 'txt', hidden: true, width: 100 }, + + { label: '瀵嗙爜', name: 'Mima', labtype: 'txt', hidden: false, width: 100 }, + { label: '瀵嗕繚', name: 'Mibao', labtype: 'txt', hidden: false, width: 100 }, + + + { + label: '鎿嶄綔', name: 'caozuo', labtype: 'txt', hidden: false, width: 50, + formatter: function (cellvalue, options, rowObject) { + return "<a onclick=\"OpenWindow('淇敼','98%','100%', '/AdmZhanghaomima/Edit?id=" + rowObject.Id + "')\" >淇敼</a> <a onclick=\"_pagedel('" + rowObject.Id + "')\" >鍒犻櫎</a>"; + } + }, + + ]; + dataUrl = "/AdmZhanghaomima/GetList"; + searchCol = [ + + { label: '绫诲埆', name: 'TypeId', labtype: 'combox', hidden: false, data: JSON.parse(TypeId), cwidth: '5%', cccwidth: '15%' }, + { label: '浜у搧椤圭洰', name: 'Chanpinxiangmu', labtype: 'txt', hidden: false }, + + + + + + + + + ]; + + + var _pageAdd = function () { + OpenWindow("鏂板鐗╁搧", "98%", "90%", "/AdmZhanghaomima/Edit/"); + } + + var _pagedel = function (id) { + if (confirm('鏄惁鍒犻櫎璁板綍')) { + $.ajax({ + type: "GET", + url: "/AdmZhanghaomima/Nullify?Id=" + id, + dataType: "json", + global: false, + data: '', + success: function (data) { + + + if (data.Result) { + + layer.msg('鍒犻櫎鎴愬姛', { icon: 6 }); + window._reloadPageData(); + } + else { + // toastr.error(""); + layer.msg('鍒犻櫎澶辫触', { icon: 5 }); + } + + }, + error: function () { + if ($.isNumber(imgLoad)) { + layer.close(imgLoad); + } + //toastr.error("淇濆瓨澶辫触"); + + layer.msg('淇濆瓨澶辫触', { icon: 5 }); + } + }); + } + + + } + + + + + var _afterSave = function (result) { + if (result) { + toastr.success("淇濆瓨鎴愬姛"); + } else { + toastr.error("淇濆瓨澶辫触"); + } + } + + var _afterDel = function (result) { + if (result) { + toastr.success("鍒犻櫎鎴愬姛"); + } else { + /**/ + toastr.error("鍒犻櫎鎴愬姛"); + /**/ + } +} + </script> +} + +@section footerScripts{ + <script type="text/javascript"> + + + + + + </script> +} -- Gitblit v1.9.1