Example #1
0
 public void InitializeTests()
 {
     setName    = "TestSet";
     mapName    = "TestMap";
     IpForTests = IntellectualProperty.Marvel;
     mapFactory = new HeroClixMapFactory(IpForTests);
 }
Example #2
0
 /// <summary>
 /// Creates a standard sized HeroClix map of the specified type filled with clear Tiles.
 /// </summary>
 /// <param name="IP">The Intellectual Property that the HeroClix map being created belongs to.</param>
 /// <param name="setName">The name of the set that the HeroClix map being created belongs to.</param>
 /// <param name="mapName">The name of the HeroClix map being created.</param>
 /// <param name="mapType">The type of HeroClix map being created.</param>
 public HeroClixMap(IntellectualProperty IP, string setName, string mapName, MapType mapType)
     : this()
 {
     intellectualProperty = IP;
     set  = setName;
     name = mapName;
     type = mapType;
 }
Example #3
0
 /// <summary>
 /// Creates a HeroClix map using the specified 2D array of Tiles.
 /// </summary>
 /// <param name="IP">The Intellectual Property that the HeroClix map being created belongs to.</param>
 /// <param name="setName">The name of the set that the HeroClix map being created belongs to.</param>
 /// <param name="mapName">The name of the HeroClix map being created.</param>
 /// <param name="mapType">The type of HeroClix map being created.</param>
 /// <param name="tiles">The 2D array of Tiles which make up the map.</param>
 public HeroClixMap(IntellectualProperty IP, string setName, string mapName, MapType mapType, Tile[,] mapTiles)
 {
     intellectualProperty = IP;
     set   = setName;
     name  = mapName;
     type  = mapType;
     tiles = ValidateTiles(mapTiles);
 }
Example #4
0
        /// <summary>
        /// Creates a HeroClix map of the specified dimensions filled with clear Tiles.
        /// </summary>
        /// <param name="IP">The Intellectual Property that the HeroClix map being created belongs to.</param>
        /// <param name="setName">The name of the set that the HeroClix map being created belongs to.</param>
        /// <param name="mapName">The name of the HeroClix map being created.</param>
        /// <param name="mapType">The type of HeroClix map being created.</param>
        /// <param name="rows">The number of rows the map will have.</param>
        /// <param name="columns">The number of columns the map will have.</param>
        public HeroClixMap(IntellectualProperty IP, string setName, string mapName, MapType mapType, int rows, int columns)
        {
            intellectualProperty = IP;
            set   = setName;
            name  = mapName;
            type  = mapType;
            tiles = new Tile[rows, columns];

            for (int i = 0; i < rows; i++)
            {
                for (int j = 0; j < columns; j++)
                {
                    tiles[i, j] = new Tile();
                }
            }
        }
Example #5
0
        /// <summary>
        /// Creates a standard sized, indoor HeroClix map filled with clear Tiles.
        /// </summary>
        public HeroClixMap()
        {
            intellectualProperty = IntellectualProperty.Other;
            set   = "";
            name  = "";
            type  = MapType.Indoor;
            tiles = new Tile[STANDARD_ROWS, STANDARD_COLUMNS];

            for (int i = 0; i < STANDARD_ROWS; i++)
            {
                for (int j = 0; j < STANDARD_COLUMNS; j++)
                {
                    tiles[i, j] = new Tile();
                }
            }
        }
Example #6
0
 public NewErrorModel Save([FromBody] IntellectualProperty evection)
 {
     try
     {
         EFHelper <IntellectualProperty> eFHelper = new EFHelper <IntellectualProperty>();
         eFHelper.Add(evection);
         return(new NewErrorModel()
         {
             error = new Error(0, "保存成功!", "")
             {
             },
         });
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #7
0
        public NewErrorModel Read(string taskId)
        {
            try
            {
                EFHelper <IntellectualProperty> eFHelper        = new EFHelper <IntellectualProperty>();
                IntellectualProperty            materialRelease = eFHelper.GetListBy(t => t.TaskId == taskId).ToList().First();

                return(new NewErrorModel()
                {
                    data = materialRelease,
                    error = new Error(0, "读取成功!", "")
                    {
                    },
                });
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #8
0
        public object Modify([FromBody] IntellectualProperty evection)
        {
            try
            {
                using (DDContext context = new DDContext())
                {
                    context.Entry <IntellectualProperty>(evection).State = EntityState.Modified;
                    context.SaveChanges();
                }

                return(new NewErrorModel()
                {
                    error = new Error(0, "修改成功!", "")
                    {
                    },
                });
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #9
0
 /// <summary>
 /// Creates an Indoor/Outdoor HeroClix map using the specified 2D array of Tiles.
 /// </summary>
 /// <param name="IP">The Intellectual Property that the HeroClix map being created belongs to.</param>
 /// <param name="setName">The name of the set that the HeroClix map being created belongs to.</param>
 /// <param name="mapName">The name of the HeroClix map being created.</param>
 /// <param name="tiles">The 2D array of Tiles which make up the map.</param>
 public IndoorOutdoorMap(IntellectualProperty IP, string setName, string mapName, Tile[,] mapTiles)
     : base(IP, setName, mapName, MapType.IndoorOutdoor, mapTiles)
 {
     // no op
 }
Example #10
0
 /// <summary>
 /// Creates an Indoor/Outdoor HeroClix map of the specified dimensions filled with clear Tiles.
 /// </summary>
 /// <param name="IP">The Intellectual Property that the HeroClix map being created belongs to.</param>
 /// <param name="setName">The name of the set that the HeroClix map being created belongs to.</param>
 /// <param name="mapName">The name of the HeroClix map being created.</param>
 /// <param name="rows">The number of rows the map will have.</param>
 /// <param name="columns">The number of columns the map will have.</param>
 public IndoorOutdoorMap(IntellectualProperty IP, string setName, string mapName, int rows, int columns)
     : base(IP, setName, mapName, MapType.IndoorOutdoor, rows, columns)
 {
     // no op
 }
Example #11
0
 /// <summary>
 /// Creates a standard sized, indoor HeroClix map filled with clear Tiles.
 /// </summary>
 public IndoorMap(IntellectualProperty IP, string setName, string mapName)
     : base(IP, setName, mapName, MapType.Indoor)
 {
     // no op
 }
Example #12
0
 /// <summary>
 /// Creates a new HeroClixMapFactory.
 /// </summary>
 /// <param name="IP">The IntellectualProperty of the HeroClixMaps that will be made by this factory.</param>
 public HeroClixMapFactory(IntellectualProperty IP)
 {
     this.intellectualProperty = IP;
 }
Example #13
0
        public async Task <NewErrorModel> Print(PrintModelCom printAndSendModel)
        {
            try
            {
                string    TaskId    = printAndSendModel.TaskId;
                string    UserId    = printAndSendModel.UserId;
                PDFHelper pdfHelper = new PDFHelper();
                using (DDContext context = new DDContext())
                {
                    //获取表单信息
                    Tasks  tasks     = context.Tasks.Where(t => t.TaskId.ToString() == TaskId && t.NodeId == 0).First();
                    string FlowId    = tasks.FlowId.ToString();
                    string ProjectId = tasks.ProjectId;
                    //判断流程是否已结束
                    List <Tasks> tasksList = context.Tasks.Where(t => t.TaskId.ToString() == TaskId && t.State == 0 && t.IsSend == false).ToList();
                    if (tasksList.Count > 0)
                    {
                        return(new NewErrorModel()
                        {
                            error = new Error(1, "流程未结束!", "")
                            {
                            },
                        });
                    }

                    IntellectualProperty IntellectualPropertyList = context.IntellectualProperty.Where(u => u.TaskId == TaskId).FirstOrDefault();

                    List <NodeInfo> NodeInfoList = context.NodeInfo.Where(u => u.FlowId == FlowId && u.NodeId != 0 && u.IsSend != true && u.NodeName != "结束").ToList();
                    foreach (NodeInfo nodeInfo in NodeInfoList)
                    {
                        if (string.IsNullOrEmpty(nodeInfo.NodePeople))
                        {
                            string strNodePeople = context.Tasks.Where(q => q.TaskId.ToString() == TaskId && q.NodeId == nodeInfo.NodeId).First().ApplyMan;
                            string ApplyTime     = context.Tasks.Where(q => q.TaskId.ToString() == TaskId && q.NodeId == nodeInfo.NodeId).First().ApplyTime;
                            nodeInfo.NodePeople = strNodePeople + "  " + ApplyTime;
                        }
                        else
                        {
                            string ApplyTime = context.Tasks.Where(q => q.TaskId.ToString() == TaskId && q.NodeId == nodeInfo.NodeId).First().ApplyTime;
                            nodeInfo.NodePeople = nodeInfo.NodePeople + "  " + ApplyTime;
                        }
                    }
                    DataTable   dtApproveView = ClassChangeHelper.ToDataTable(NodeInfoList);
                    string      FlowName      = context.Flows.Where(f => f.FlowId.ToString() == FlowId).First().FlowName.ToString();
                    ProjectInfo projectInfo   = context.ProjectInfo.Where(p => p.ProjectId == ProjectId).First();
                    string      ProjectName   = projectInfo.ProjectName;
                    string      ProjectNo     = projectInfo.ProjectId;

                    Dictionary <string, string> keyValuePairs = new Dictionary <string, string>();
                    keyValuePairs.Add("申请名称", IntellectualPropertyList.Name);
                    keyValuePairs.Add("申请类别", IntellectualPropertyList.Type);
                    keyValuePairs.Add("申请发明人", IntellectualPropertyList.Inventor);
                    keyValuePairs.Add("发明人或设计人", IntellectualPropertyList.ActualInventor);
                    keyValuePairs.Add("申报名称", IntellectualPropertyList.ActualName);
                    keyValuePairs.Add("申报单位", IntellectualPropertyList.Company);
                    keyValuePairs.Add("申报类别", IntellectualPropertyList.ActualType);

                    string path = pdfHelper.GeneratePDF(FlowName, TaskId, tasks.ApplyMan, tasks.Dept, tasks.ApplyTime,
                                                        ProjectName, ProjectNo, "2", 300, 650, null, null, null, dtApproveView, keyValuePairs);
                    string RelativePath = "~/UploadFile/PDF/" + Path.GetFileName(path);

                    List <string> newPaths = new List <string>();
                    RelativePath = AppDomain.CurrentDomain.BaseDirectory + RelativePath.Substring(2, RelativePath.Length - 2).Replace('/', '\\');
                    newPaths.Add(RelativePath);
                    string SavePath = string.Format(@"{0}\UploadFile\Ionic\{1}.zip", AppDomain.CurrentDomain.BaseDirectory, FlowName + DateTime.Now.ToString("yyyyMMddHHmmss"));
                    //文件压缩打包
                    IonicHelper.CompressMulti(newPaths, SavePath, false);

                    //上传盯盘获取MediaId
                    SavePath = string.Format(@"~\UploadFile\Ionic\{0}", Path.GetFileName(SavePath));
                    DingTalkServersController dingTalkServersController = new DingTalkServersController();
                    var resultUploadMedia = await dingTalkServersController.UploadMedia(SavePath);

                    //推送用户
                    FileSendModel fileSendModel = JsonConvert.DeserializeObject <FileSendModel>(resultUploadMedia);
                    fileSendModel.UserId = UserId;
                    var result = await dingTalkServersController.SendFileMessage(fileSendModel);

                    return(new NewErrorModel()
                    {
                        error = new Error(0, result, "")
                        {
                        },
                    });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }