protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { T_CellTmp_MDL mdl = new T_CellTmp_BLL().GetModel(Convert.ToInt32(Common.DNTRequest.GetQueryString("ID"))); // cellFilePath = Server.MapPath(mdl.FilePath); cellFilePath = "http://" + Request.ServerVariables["HTTP_HOST"] + "/" + mdl.FilePath.Substring(1).Replace(@"\", @"/"); } }
/// <summary> /// 绑定PDI=0的施工用表 /// </summary> public void DataBindEx() { T_CellTmp_BLL bll = new T_CellTmp_BLL(); DataSet ds = new DataSet(); ds = bll.GetList(" PID=0 "); if (ds.Tables.Count > 0) { ddlCellTmp.DataTextField = "Title"; ddlCellTmp.DataValueField = "CellID"; ddlCellTmp.DataSource = ds; ddlCellTmp.DataBind(); } ddlCellTmp.Items.Insert(0, new ListItem("无", "0")); }
protected void btnAdd002_Click(object sender, EventArgs e) { string selectList = ctrlGridEx1.GetFirstSelect(); if (selectList != "") { T_CellTmp_MDL mdl = new T_CellTmp_BLL().GetModel(Convert.ToInt32(selectList)); if (mdl.FilePath.Length > 0) { //Response.Write("<script>window.open(\"/File/LookCell.aspx?Action=Show&ProNo=10&ID=" + selectList + "\",\"\",\"width=800,height=600,left=150,top=100,menubar=no,toolbar=no,status=no,resizable=yes,scrollbars=yes,location=yes\");</script>"); MessageBox.OpenWindow(Page, "/File/LookCell.aspx?Action=Show&ProNo=10&ID=" + selectList + "", "600", "800"); } else { MessageBox.Show(Page, "你选的条目没有施工用表!"); } } }
//string EFileStartPath = Common.Common.EFileStartPath; protected void Page_Load(object sender, EventArgs e) { StartPath = Common.Common.EFileStartPath.Remove(0, 2).Replace('\\', '/'); if (!this.IsPostBack) { MyAddInit(); SingleProjectID = Request.QueryString["ProNo"]; BLL.T_EFile_BLL bll = new DigiPower.Onlinecol.Standard.BLL.T_EFile_BLL(); Model.T_EFile_MDL efileMDL = new DigiPower.Onlinecol.Standard.Model.T_EFile_MDL(); efileMDL = bll.GetModel(Common.ConvertEx.ToInt(ID)); if (efileMDL != null) { FileListID = efileMDL.FileListID; ArchiveListCellRptID = efileMDL.ArchiveListCellRptID;//给前面用的 //T_SingleProject_MDL SingProMdl = new T_SingleProject_BLL().GetModel(Common.ConvertEx.ToInt(SingleProjectID)); //T_Construction_Project_MDL ConProMdl = new T_Construction_Project_BLL().GetModel(Common.ConvertEx.ToInt(SingProMdl.ConstructionProjectID)); //if (ConProMdl != null) //{ // CompanyID = Common.ConvertEx.ToString(ConProMdl.CompanyID); // ConstructionProjectID = Common.ConvertEx.ToString(ConProMdl.ConstructionProjectID); //} //判断,如果华表是第一次则根据华表模板的路径读取华表 //否则直接读取电子文件的FilePath if (Common.ConvertEx.ToInt(efileMDL.Status) == 0) { T_CellTmp_MDL ctMdl = new T_CellTmp_BLL().GetModel(Common.ConvertEx.ToInt(efileMDL.FilePath)); cellFilePath = "http://" + Request.ServerVariables["HTTP_HOST"] + "/" + ctMdl.FilePath.Substring(1).Replace(@"\", @"/"); //华表模板路径 string tempFileID = Guid.NewGuid().ToString() + ".cll"; //string cellPath = Server.MapPath(string.Concat(StartPath,"CellEFile/" //CreateDirectory(StartPath + "CellEFile/" + + "/", true); CreateDirectory(string.Concat(StartPath, "/", SingleProjectID, "/CellEFile/"), true); NewCellFilePath = string.Concat("/CellEFile/", tempFileID); //新华表存储路径 NewCellFullFilePath = string.Concat(StartPath, SingleProjectID, "/CellEFile/", tempFileID); //新华表存储路径 } else if (Common.ConvertEx.ToInt(efileMDL.Status) == 1) { if (System.IO.File.Exists(Server.MapPath(string.Concat(StartPath, SingleProjectID, "/", efileMDL.FilePath)))) { //Leo 存了绝对路径。等easyPDF好了,再回来来决定 cellFilePath = "http://" + Request.ServerVariables["HTTP_HOST"] + string.Concat(StartPath, SingleProjectID, "/", efileMDL.FilePath); NewCellFilePath = efileMDL.FilePath; NewCellFullFilePath = string.Concat(StartPath, SingleProjectID, "/", efileMDL.FilePath); } } try { string Action = Request.QueryString["Action"]; if (Action == "Show") { T_CellTmp_MDL ctMdl = new T_CellTmp_BLL().GetModel(Common.ConvertEx.ToInt(ID)); cellFilePath = "http://" + Request.ServerVariables["HTTP_HOST"] + "/" + ctMdl.FilePath.Substring(1).Replace(@"\", @"/"); CompanyID = "10"; ConstructionProjectID = "10"; return; } } catch { } T_SingleProject_MDL SingProMdl = new T_SingleProject_BLL().GetModel(Common.ConvertEx.ToInt(SingleProjectID)); T_Construction_Project_MDL ConProMdl = new T_Construction_Project_BLL().GetModel(Common.ConvertEx.ToInt(SingProMdl.ConstructionProjectID)); if (ConProMdl != null) { CompanyID = Common.ConvertEx.ToString(ConProMdl.CompanyID); ConstructionProjectID = Common.ConvertEx.ToString(ConProMdl.ConstructionProjectID); } } } }