private void BindData() { SolutionDemandModel model = bll.GetModel(DemandID); Literal_Demand.Text = model.DemandDetail; Literal_Field.Text = model.FieldSituation; Literal_Effect.Text = model.EffectSituation; Literal_Budget.Text = model.Budget.ToString("0.00"); Literal_Contact.Text = model.Contactor; Literal_Phone.Text = model.ContactPhone; Literal_Postcode.Text = model.Postcode; Literal_Region.Text = model.Region; Literal_Address.Text = model.Address; Literal_CreateTime.Text = model.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"); Literal1_Status.Text = Enum.GetName(typeof(SolutionDemandStatus), model.Status); if (model.FieldPhotoes.Contains(",")) { foreach (string s in model.FieldPhotoes.Split(',')) { fieldImages.InnerHtml += String.Format("<img src=\"{0}\"/>", CommonImageUpload.GetCommonImageFullUrl(s)); } } else { fieldImages.InnerHtml += String.Format("<img src=\"{0}\"/>", CommonImageUpload.GetCommonImageFullUrl(model.FieldPhotoes)); } }
private void BindData(int PageIndex) { int RecordCount = 0; DataTable dt = new DataTable(); if (CategoryID == 0) { dt = bll.GetList(PageIndex, AspNetPager.PageSize, String.Empty, out RecordCount).Tables[0]; } else { dt = new BrandCategoryRelationBll().GetCategoryBrandList(CategoryID); } foreach (DataRow row in dt.Rows) { row["brandlogo"] = CommonImageUpload.GetCommonImageFullUrl(Convert.ToString(row["brandlogo"])); } Repeater_Brand.DataSource = dt; Repeater_Brand.DataBind(); AspNetPager.RecordCount = RecordCount; }
protected void btnUpdate_Click(object sender, EventArgs e) { SolutionCategoryBll scbll = new SolutionCategoryBll(); int scenceId = int.Parse(lblSenceId.Text); int cateId = int.Parse(lblCateId.Text); SolutionCategoryModel scmodel = scbll.GetModel(scenceId, cateId); if (scmodel == null) { scmodel = new SolutionCategoryModel(); scmodel.CateId = cateId; scmodel.SenceId = scenceId; } scmodel.IsShow = chkIsShow.Checked; scmodel.Remark = txtRemark.Text.Trim(); scmodel.Position = txtPosition.Text.Trim(); string fullurl, shorturl, message; if (CommonImageUpload.Upload(this.fulImage, out fullurl, out shorturl, out message)) { scmodel.CateImage = shorturl; } scbll.Save(scmodel); SaveCateConditions(); Response.Redirect("ShowClassicalScence.aspx?id=" + scenceId, true); }
private string UploadBrandLogo(int BrandID, FileUpload fu) { string ImageUrl, ImageShortUrl, Message; CommonImageUpload.Upload(fu, out ImageUrl, out ImageShortUrl, out Message); return(ImageShortUrl); }
private void BindData() { BrandModel brand = bll.GetModel(BrandID); if (brand != null) { txtBrandName.Text = brand.BrandName; imgBrandLogo.ImageUrl = CommonImageUpload.GetCommonImageFullUrl(brand.BrandLogo); txtBrief.Text = brand.Brief; } }
private void BindData(int PageIndex) { int RecordCount = 0; DataTable dt = bll.GetList(PageIndex, AspNetPager.PageSize, SearchCondition, out RecordCount).Tables[0]; foreach (DataRow row in dt.Rows) { row["brandlogo"] = CommonImageUpload.GetCommonImageFullUrl(row["brandlogo"].ToString()); } GridView1.DataSource = dt; GridView1.DataBind(); AspNetPager.RecordCount = RecordCount; AspNetPager.CurrentPageIndex = PageIndex; }
protected void btnAdd_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtScenceName.Text == "") { strErr += "ScenceName²»ÄÜΪ¿Õ£¡\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int scenceId; if (!int.TryParse(lblScenceId.Text, out scenceId)) { scenceId = 0; } int SenceType = int.Parse(this.rblScenceType.SelectedValue); bool IsActive = this.chkIsActive.Checked; NoName.NetShop.Solution.Model.ScenceModel model = sbll.GetModel(scenceId); if (model == null) { model = new NoName.NetShop.Solution.Model.ScenceModel(); } model.ScenceName = txtScenceName.Text.Trim(); model.Remark = txtRemark.Text.Trim(); model.SenceType = SenceType; model.IsActive = IsActive; string fullurl, shorturl, message; if (CommonImageUpload.Upload(this.fulImage, out fullurl, out shorturl, out message)) { model.SenceImg = shorturl; } sbll.Save(model); Response.Redirect("ScenceList.aspx"); }
public XmlNode GetBrandInfo() { XmlNode BrandInfoNode = xdoc.CreateElement("brandinfo"); DataTable dt = dal.GetBrandInfo(Parameter.BrandID); if (dt.Rows.Count > 0) { XmlUtility.AddNewNode(BrandInfoNode, "brandid", Convert.ToString(dt.Rows[0]["brandid"])); XmlUtility.AddNewNode(BrandInfoNode, "categoryid", Convert.ToString(Parameter.CategoryID)); XmlUtility.AddNewNode(BrandInfoNode, "ordertype", Convert.ToString(Parameter.OrderType)); XmlUtility.AddNewNode(BrandInfoNode, "brandname", Convert.ToString(dt.Rows[0]["brandname"])); XmlUtility.AddNewNode(BrandInfoNode, "brandlogo", CommonImageUpload.GetCommonImageFullUrl(Convert.ToString(dt.Rows[0]["brandlogo"]))); XmlUtility.AddNewNode(BrandInfoNode, "brief", Convert.ToString(dt.Rows[0]["brief"])); } return(BrandInfoNode); }
private void SaveData() { string strErr = ""; if (this.txtBrandName.Text == "") { strErr += "品牌名称不能为空!\\n"; } if (this.txtBrief.Text == "") { strErr += "简要描述不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } BrandModel brand = bll.GetModel(BrandID); try // delete old brand logo file { File.Delete(CommonImageUpload.GetCommonImagePhysicalPath(brand.BrandLogo)); } catch { } brand.BrandName = txtBrandName.Text; brand.Brief = txtBrief.Text; if (fulBrandLogo.FileName != String.Empty) { brand.BrandLogo = UploadBrandLogo(brand.BrandId, fulBrandLogo); } bll.Update(brand); }
private void BindData(int PageIndex) { DataTable SuiteList = new DataTable(); int RecordCount = 0; if (ScenceID != 0) { SuiteList = bll.GetList(PageIndex, AspNetPager.PageSize, " and scenceid = " + ScenceID, "", out RecordCount); } else { SuiteList = bll.GetList(PageIndex, AspNetPager.PageSize, "", "", out RecordCount); } foreach (DataRow row in SuiteList.Rows) { row["smallimage"] = CommonImageUpload.GetCommonImageFullUrl(row["smallimage"].ToString()); row["mediumimage"] = CommonImageUpload.GetCommonImageFullUrl(row["mediumimage"].ToString()); row["largeimage"] = CommonImageUpload.GetCommonImageFullUrl(row["largeimage"].ToString()); } Repeater_Suites.DataSource = SuiteList; Repeater_Suites.DataBind(); }
protected void Button_Add_Click(object sender, EventArgs e) { string ErrorMessage = String.Empty; if (String.IsNullOrEmpty(TextBox_DemandDetail.Text)) { ErrorMessage += "请填写需求信息\\n"; } if (Request.Files.Count <= 0 || Request.Files[0].ContentLength <= 0) { ErrorMessage += "场地图片不能为空\\n"; } if (String.IsNullOrEmpty(TextBox_Field.Text)) { ErrorMessage += "请填写场地信息\\n"; } if (String.IsNullOrEmpty(TextBox_Effect.Text)) { ErrorMessage += "请填写效果要求\n"; } if (String.IsNullOrEmpty(TextBox_Budget.Text)) { ErrorMessage += "请填写正确的预算金额\\n"; } if (String.IsNullOrEmpty(TextBox_Contactor.Text)) { ErrorMessage += "请填写联系人姓名\\n"; } if (String.IsNullOrEmpty(TextBox_Phone.Text)) { ErrorMessage += "请填写联系人电话\\n"; } if (String.IsNullOrEmpty(TextBox_PostCode.Text)) { ErrorMessage += "请填写邮政编码\\n"; } if (String.IsNullOrEmpty(TextBox_Address.Text)) { ErrorMessage += "请填写通信地址\\n"; } RegionInfo regionInfo = ucRegion.GetSelectedRegionInfo(); if (String.IsNullOrEmpty(regionInfo.Province) || String.IsNullOrEmpty(regionInfo.City)) { ErrorMessage += "所在地选择不完整\\n"; } if (!String.IsNullOrEmpty(ErrorMessage)) { MessageBox.Show(this, ErrorMessage); return; } SolutionDemandModel model = new SolutionDemandModel(); int DemandID = CommDataHelper.GetNewSerialNum(AppType.Solution); ArrayList FieldPhotoes = new ArrayList(); foreach (string s in Request.Files.AllKeys) { if (s.StartsWith("photo-field") && Request.Files[s].ContentLength > 0) { string ImageUrl, ImageShorUrl, UploadMessage; if (!CommonImageUpload.Upload(Request.Files[s], out ImageUrl, out ImageShorUrl, out UploadMessage)) { MessageBox.Show(this, UploadMessage); return; } else { FieldPhotoes.Add(ImageShorUrl); } } } var ImageUrls = String.Empty; foreach (string s in FieldPhotoes) { ImageUrls += s+","; } model.DemandID = DemandID; model.DemandDetail = TextBox_DemandDetail.Text; model.FieldPhotoes = ImageUrls.Substring(0, ImageUrls.Length - 1); model.FieldSituation = TextBox_Field.Text; model.EffectSituation = TextBox_Effect.Text; model.Budget = Convert.ToDecimal(TextBox_Budget.Text); model.Contactor = TextBox_Contactor.Text; model.ContactPhone = TextBox_Phone.Text; model.Postcode = TextBox_PostCode.Text; model.Region = String.Format("{0} {1} {2}", regionInfo.Province, regionInfo.City, regionInfo.County); model.Address = TextBox_Address.Text; model.UserID = GetUserID(); model.CreateTime = DateTime.Now; model.UpdateTime = DateTime.Now; model.Status = (int)SolutionDemandStatus.尚未处理; bll.Add(model); Response.Redirect("SubmitSucc.aspx?o=" + DemandID); }