예제 #1
0
    // Use this for initialization
    void Start()
    {
        //createBackground = this.GetComponent<CreateBackground4>();
        //createShaftBackground = this.GetComponent<CreateShaftBackground>();
        //createWater = this.GetComponent<CreateWaterMesh>();
        //waterElevation = createWater.globalWaterElevation;
        worldResources = this.GetComponent<WorldResources>();
        createWater = this.GetComponent<CreateWater>();
        //GenerateTunnel(new Vector3(0f, 0f, 0f), 1, SelectTunnelTendency());

        GameObject.FindGameObjectWithTag("GameController").GetComponent<TideController>().tideEligible = true;
    }
예제 #2
0
        public ActionResult Word(Costing Model)
        {
            if (Model.Type == "0" || Model.Type == "1" || Model.Type == "6")
            {
                string         strFileName = "";
                CreateAnalysis cr          = new CreateAnalysis(Model);
                List <string>  appList     = new List <string>();
                appList = cr.CreateReportWord();
                #region 判断报告生成运行状态
                if (appList[0] == "1")
                {
                    FileInfo fr = new FileInfo(appList[1]);
                    fr.Delete();
                    return(Back("合同生成失败"));
                }
                if (appList[0] == "2")
                {
                    FileInfo fr = new FileInfo(appList[1]);
                    fr.Delete();
                    return(Back("合同生成失败"));
                }
                if (appList[0] == "3")
                {
                    FileInfo fr = new FileInfo(appList[1]);
                    fr.Delete();
                    return(Back("合同生成失败"));
                }

                #endregion

                strFileName = appList[1];
                //报告下载
                if (!string.IsNullOrEmpty(strFileName))
                {
                    string fileNewName = strFileName.Substring(strFileName.LastIndexOf("\\") + 1);
                    Response.Clear();
                    Response.ContentType     = "application/octet-stream";
                    Response.ContentEncoding = Encoding.UTF8;
                    Response.AppendHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileNewName, Encoding.UTF8));
                    Response.WriteFile(strFileName);
                    Response.End();
                }
                else
                {
                    return(Back("下载报告失败"));
                }
                return(Back("成功"));
            }
            else if (Model.Type == "2" || Model.Type == "4" || Model.Type == "5")
            {
                string        strFileName = "";
                CreateJianCe  cr          = new CreateJianCe(Model);
                List <string> appList     = new List <string>();
                appList = cr.CreateReportWord();
                #region 判断报告生成运行状态
                if (appList[0] == "1")
                {
                    FileInfo fr = new FileInfo(appList[1]);
                    fr.Delete();
                    return(Back("合同生成失败"));
                }
                if (appList[0] == "2")
                {
                    FileInfo fr = new FileInfo(appList[1]);
                    fr.Delete();
                    return(Back("合同生成失败"));
                }
                if (appList[0] == "3")
                {
                    FileInfo fr = new FileInfo(appList[1]);
                    fr.Delete();
                    return(Back("合同生成失败"));
                }

                #endregion

                strFileName = appList[1];
                //报告下载
                if (!string.IsNullOrEmpty(strFileName))
                {
                    string fileNewName = strFileName.Substring(strFileName.LastIndexOf("\\") + 1);
                    Response.Clear();
                    Response.ContentType     = "application/octet-stream";
                    Response.ContentEncoding = Encoding.UTF8;
                    Response.AppendHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileNewName, Encoding.UTF8));
                    Response.WriteFile(strFileName);
                    Response.End();
                }
                else
                {
                    return(Back("下载报告失败"));
                }
                return(Back("成功"));
            }
            else
            {
                string        strFileName = "";
                CreateWater   cr          = new CreateWater(Model);
                List <string> appList     = new List <string>();
                appList = cr.CreateReportWord();
                #region 判断报告生成运行状态
                if (appList[0] == "1")
                {
                    FileInfo fr = new FileInfo(appList[1]);
                    fr.Delete();
                    return(Back("合同生成失败"));
                }
                if (appList[0] == "2")
                {
                    FileInfo fr = new FileInfo(appList[1]);
                    fr.Delete();
                    return(Back("合同生成失败"));
                }
                if (appList[0] == "3")
                {
                    FileInfo fr = new FileInfo(appList[1]);
                    fr.Delete();
                    return(Back("合同生成失败"));
                }

                #endregion

                strFileName = appList[1];
                //报告下载
                if (!string.IsNullOrEmpty(strFileName))
                {
                    string fileNewName = strFileName.Substring(strFileName.LastIndexOf("\\") + 1);
                    Response.Clear();
                    Response.ContentType     = "application/octet-stream";
                    Response.ContentEncoding = Encoding.UTF8;
                    Response.AppendHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileNewName, Encoding.UTF8));
                    Response.WriteFile(strFileName);
                    Response.End();
                }
                else
                {
                    return(Back("下载报告失败"));
                }
                return(Back("成功"));
            }
            // CreateContractControlResultEvaluation cr = new CreateContractControlResultEvaluation(Model);
        }