protected void rpt_xingcheng_ItemDataBound(object sender, RepeaterItemEventArgs e) { EyouSoft.Model.TourStructure.TourPlanInfo model = e.Item.DataItem as EyouSoft.Model.TourStructure.TourPlanInfo; Panel pfile = e.Item.FindControl("pnlFile") as Panel; HyperLink hlink = e.Item.FindControl("hlink_FileName") as HyperLink; if (Utils.GetString(model.FilePath, "") != "") { pfile.Visible = true; hlink.NavigateUrl = model.FilePath; } }
/// <summary> /// 获取行程 /// </summary> /// <returns></returns> public List <EyouSoft.Model.TourStructure.TourPlanInfo> GetValues() { List <EyouSoft.Model.TourStructure.TourPlanInfo> list = new List <EyouSoft.Model.TourStructure.TourPlanInfo>(); for (int i = 0; i < Utils.GetFormValues("txt_qujian").Length; i++) { EyouSoft.Model.TourStructure.TourPlanInfo xc = new EyouSoft.Model.TourStructure.TourPlanInfo(); xc.Interval = Utils.GetFormValues("txt_qujian")[i]; xc.Vehicle = Utils.GetFormValues("txt_jiaotong")[i]; xc.Hotel = Utils.GetFormValues("txt_zhushu")[i]; string hd_eat = Utils.GetFormValues("eat")[i]; //if (hd_eat.Contains("1,")) //{ // xc.eatOne = 1; //} //else //{ // xc.eatOne = 0; //} //if (hd_eat.Contains("2,")) //{ // xc.eatTwo = 1; //} //else //{ // xc.eatTwo = 0; //} //if (hd_eat.Contains("3,")) //{ // xc.eatThree = 1; //} //else //{ // xc.eatThree = 0; //} //if (hd_eat.Contains("4,")) //{ // xc.eatFour = 1; //} //else //{ // xc.eatFour = 0; //} xc.Dinner = hd_eat; xc.Plan = Utils.GetFormValues("txt_xiancheng")[i]; //xc.img = Utils.GetFormValues("hd_fileUrl")[i]; //xc.Img = Request.Files[i]; string [] t = { ".jpg", ".jpeg", ".gif", ".bmp", ".png" }; string fileUrl = ""; string oldfile = ""; string msg = ""; if (!EyouSoft.Common.Function.UploadFile.CheckFileType(Request.Files, "file_xc_img", t, null, out msg)) { EyouSoft.Common.Function.MessageBox.Show(Page, msg); return(null); } //for (int j = 0; j < Request.Files.Count; j++) { if (Request.Files.GetKey(i).ToString().ToUpper() == "file_xc_img".ToUpper()) { EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files[i], "File", out fileUrl, out oldfile); } } if (Request.Files[i].FileName == "" && Utils.GetFormValues("hd_fileUrl")[i] != "") { xc.FilePath = Utils.GetFormValues("hd_fileUrl")[i]; } else { xc.FilePath = fileUrl; } list.Add(xc); } return(list); }