using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Web; using System.Web.Mvc; using PMS.Interface; using PMS.Interface.SysManager; using QWPlatform.SystemLibrary.ValidateCode; using QWPlatform.SystemLibrary.Web; using PMS.BusinessModels.Person; using System.Drawing; using QWPlatform.SystemLibrary.LogManager; using PMS.Interface.MessageManage; using PMS.BusinessModels.SMS; using PMS.Interface.Product; using PMS.BusinessModels.Product; using System.Data; using PMS.EntityModels.Product; namespace PMS.WebUI.Controllers { /// /// 创 建 人:王海洋 /// 创建日期:2018-12-10 /// 功能描述:账户管理控制类 /// [CheckLogin(false)] public class TestController : BaseController { IMessageManage notice = InterfaceFactory.CreateBusinessInstance(); IProductModule ProductModule = InterfaceFactory.CreateBusinessInstance(); // GET: Account public ActionResult Test() { Import(); return View(); //NotificationDto no = new NotificationDto(); //no.style = "3"; //no.template_code = "OIE51OsXeECnoPxGgPTQ7acXybc7t1plgAbdlH-mMWE"; //no.template_value ="{\"first\":{\"value\":\"您有新的消息通知。\",\"color\":\"#173177\"},\"keyword1\":{\"value\":\"2019-01-0211:08\",\"color\":\"#173177\"},\"keyword2\":{\"value\":\"你的问题有新的变更通知\",\"color\":\"#173177\"},\"remark\":{\"value\":\"感谢您的使用。\",\"color\":\"#173177\"}}"; //List list = new List(); //MessageDetailsDto mdd = new MessageDetailsDto(); //mdd.接收人 = "李艳春"; //mdd.接收人id = "oR2TM1RJcCi4E93BWPgz8i42vRcY"; //mdd.接收人电话 = "李艳春"; //list.Add(mdd); //no.record_items = list; //notice.SendWeChartTempletMessge(no); //return View(); } /// /// 导入功能模块 /// /// public ActionResult Import() { var column = new string[] { "ID", "上级ID", "名称", "编码", "开发方式", "开发状态", "研发人", "测试人", "测试人NEW", "说明", "类型" }; var dt= ProductModule.GetProductFunctionDataTable("2f436cb5-06b8-45a1-a3c3-652b0ea18529", "", ""); List CmodelList = new List(); for (int i = 0; i < dt.Rows.Count; i++) { var id = Guid.NewGuid().ToString(); if (dt.Rows[i]["上级ID"].ToString()=="") { FormProductFunModel Cmodel1 = new FormProductFunModel(); Cmodel1.id = id; Cmodel1.parentid = ""; Cmodel1.Coding = dt.Rows[i]["编码"].ToString(); Cmodel1.ProID = "19010664-4f49-4a98-9f5d-98722dca92fe"; Cmodel1.TestPer = ""; Cmodel1.TestPerID = ""; Cmodel1.DevelopmentModeID = "2"; Cmodel1.name = dt.Rows[i]["名称"].ToString(); Cmodel1.remark = dt.Rows[i]["说明"].ToString(); Cmodel1.ResearchPer = ""; Cmodel1.ResearchPerID = ""; Cmodel1.ProType = "0"; Cmodel1.DevelopmentStatusID = "3"; var jj= ProductModule.PostSaveProductFunInport(Cmodel1); for (int j = 0; j < dt.Rows.Count; j++) { if (dt.Rows[i]["ID"].ToString() == dt.Rows[j]["上级ID"].ToString()) { FormProductFunModel Cmodel = new FormProductFunModel(); Cmodel.id = Guid.NewGuid().ToString(); ; Cmodel.parentid = id; Cmodel.Coding = dt.Rows[j]["编码"].ToString(); Cmodel.ProID = "19010664-4f49-4a98-9f5d-98722dca92fe"; Cmodel.TestPer = ""; Cmodel.TestPerID = ""; Cmodel.DevelopmentModeID = "2"; Cmodel.name = dt.Rows[j]["名称"].ToString(); Cmodel.remark = dt.Rows[j]["说明"].ToString(); Cmodel.ResearchPer = ""; Cmodel.ResearchPerID = ""; Cmodel.DevelopmentStatusID = "3"; Cmodel.ProType = "0"; var r = ProductModule.PostSaveProductFunInport(Cmodel); } } } } return View(); } } }