private void BindData() { int emailid = 0; Nop_EmailDirectory email = null; if (Request.QueryString["emailid"] != null && int.TryParse(Request.QueryString["emailid"], out emailid)) { email = emailbiz.GetEmailByID(emailid); } if (email != null) { txtDescription.Content = email.Description; txtEmailAddress.Text = email.EmailAddress; txtFirstName.Text = email.FirstName; txtJobTitle.Text = email.JobTitle; txtLastName.Text = email.LastName; txtPhoneNumber.Text = email.PhoneNumber; Picture Picture = PictureManager.GetPictureById(email.PictureID.Value); this.btnRemoveImage.Visible = Picture != null; string pictureUrl = PictureManager.GetPictureUrl(Picture, 100); this.iPicture.Visible = true; this.iPicture.ImageUrl = pictureUrl; } }
private void BindData() { int emailid = 0; Nop_EmailDirectory email = null; if (Request.QueryString["emailid"] != null && int.TryParse(Request.QueryString["emailid"], out emailid)) { email = emailbiz.GetEmailByID(emailid); } if (email != null) { lblDescrption.Text = email.Description; lblEmailAddress.Text = email.EmailAddress; lblname1.Text = email.FirstName; lblName.Text = email.FirstName + " " + email.LastName; lblName2.Text = email.FirstName + " " + email.LastName; //txtJobTitle.Text = email.JobTitle; //txtPhoneNumber.Text = email.PhoneNumber; this.lblJobTitle.Text = email.JobTitle; this.lblPhone.Text = email.PhoneNumber; Picture Picture = PictureManager.GetPictureById(email.PictureID.Value); this.iEmail.Visible = Picture != null; string pictureUrl = PictureManager.GetPictureUrl(Picture, 100); this.iEmail.ImageUrl = pictureUrl; } }
public ActionResult ManageFlags(string Type, string Action, int id) { if (Type == "Picture") { Picture pic = PictureManager.GetPictureById(id); if (Action == "unflag") { pic.IsFlagged = false; PictureManager.EditPictureFlagged(pic); } else { PictureManager.DeletePicture(pic); } } else { Comment comment = CommentsManage.GetCommentById(id); if (Action == "unflag") { comment.IsFlagged = false; CommentsManage.EditCommentFlagged(comment); } else { CommentsManage.DeleteComment(comment); } } return(RedirectToAction("ManageFlags")); }
private void BindData() { PersonBiz pBiz = new PersonBiz(); lwg_Person person = pBiz.GetByID(this.ComposerId); if (person != null) { txtDOB.Text = person.DOB; txtDOD.Text = person.DOD; txtFirstName.Text = (String)person.FirstName; txtLastName.Text = (String)person.LastName; txtNameDisplay.Text = (String)person.NameDisplay; txtNameList.Text = (String)person.NameList; txtNameSort.Text = (String)person.NameSort; txtBiography.Content = Server.HtmlDecode(person.Biography); if (person.PictureID.HasValue) { if (person.PictureID.Value > 0) { Picture Picture = PictureManager.GetPictureById(person.PictureID.Value); this.btnRemoveImage.Visible = Picture != null; string pictureUrl = PictureManager.GetPictureUrl(Picture, 100); this.iPicture.Visible = true; this.iPicture.ImageUrl = pictureUrl; } } } }
public JsonResult GivePictureFlagged(string JsonFlag) { string result = JsonFlag; JObject jobj = JObject.Parse(result); Picture picture = PictureManager.GetPictureById(Convert.ToInt32(jobj["id"])); picture.IsFlagged = true; PictureManager.EditPictureFlagged(picture); String res = "Flag Picture Success"; return(Json(res, JsonRequestBehavior.AllowGet)); }
private void BindData() { Product product = ProductManager.GetProductById(ProductId); if (product != null) { pnlData.Visible = true; pnlMessage.Visible = false; CatalogBiz catalogBiz = new CatalogBiz(); lwg_Catalog catalog = catalogBiz.GetByID(this.ProductId); if (catalog != null) { if (catalog.lwg_Audio.Count > 0) { gvAudios.Visible = true; gvAudios.DataSource = catalog.lwg_Audio; gvAudios.DataBind(); } else { gvAudios.Visible = false; } if (!string.IsNullOrEmpty(catalog.SoundIcon)) { int temp = 0; if (int.TryParse(catalog.SoundIcon, out temp) && temp > 0) { Picture Picture = PictureManager.GetPictureById(temp); string pictureUrl = PictureManager.GetPictureUrl(Picture, 100); imgSoundIcon.Visible = true; imgSoundIcon.ImageUrl = pictureUrl; } } } } else { pnlData.Visible = false; pnlMessage.Visible = true; } }
private string SavePictureIcon(FileUpload fileupload) { Picture pic = null; lwg_Catalog lwg = new CatalogBiz().GetByID(ProductId); if (lwg != null) { if (!string.IsNullOrEmpty(lwg.SoundIcon)) { pic = PictureManager.GetPictureById(int.Parse(lwg.SoundIcon)); } } HttpPostedFile PictureFile = fileupload.PostedFile; if ((PictureFile != null) && (!String.IsNullOrEmpty(PictureFile.FileName))) { byte[] pictureBinary = PictureManager.GetPictureBits(PictureFile.InputStream, PictureFile.ContentLength); if (pic != null) { pic = PictureManager.UpdatePicture(pic.PictureId, pictureBinary, PictureFile.ContentType, true); } else { pic = PictureManager.InsertPicture(pictureBinary, PictureFile.ContentType, true); } } int PictureId = 0; if (pic != null) { PictureId = pic.PictureId; //\ string pictureUrl = PictureManager.GetPictureUrl(pic, 100); imgSoundIcon.Visible = true; imgSoundIcon.ImageUrl = pictureUrl; } return(PictureId.ToString()); }
// GET: Picture public ActionResult PictureDetail(int id) { ViewBag.picture = PictureManager.GetPictureById(id); if (Session["participantID"] != null) { ViewBag.Participant = ParticipantManager.GetById(Convert.ToInt32(Session["participantID"])); } string listSort = Request.QueryString["ListSort"];//check if user prompted a type of sorting if (listSort == null || listSort == "Recent") { ViewBag.comments = CommentsManage.SortByRecent(CommentsManage.GetCommentByPictureId(id)); } else { ViewBag.comments = CommentsManage.SortByPopular(CommentsManage.GetCommentByPictureId(id));//popular sorting, most votes } return(View()); }
private bool save() { int emailid = 0; Nop_EmailDirectory email = null; if (Request.QueryString["emailid"] != null && int.TryParse(Request.QueryString["emailid"], out emailid)) { email = emailbiz.GetEmailByID(emailid); } if (email != null) { Picture pic = PictureManager.GetPictureById(email.PictureID.Value); HttpPostedFile PictureFile = fuPicture.PostedFile; if ((PictureFile != null) && (!String.IsNullOrEmpty(PictureFile.FileName))) { byte[] categoryPictureBinary = PictureManager.GetPictureBits(PictureFile.InputStream, PictureFile.ContentLength); if (pic != null) { pic = PictureManager.UpdatePicture(pic.PictureId, categoryPictureBinary, PictureFile.ContentType, true); } else { pic = PictureManager.InsertPicture(categoryPictureBinary, PictureFile.ContentType, true); } } int PictureId = 0; if (pic != null) { PictureId = pic.PictureId; } email.Description = this.txtDescription.Content; email.EmailAddress = txtEmailAddress.Text; email.FirstName = txtFirstName.Text; email.LastName = txtLastName.Text; email.PhoneNumber = txtPhoneNumber.Text; email.PictureID = PictureId; email.JobTitle = txtJobTitle.Text; bool b = emailbiz.SaveEmail(email); BindData(); return(b); } else { Picture pic = null; HttpPostedFile PictureFile = fuPicture.PostedFile; if ((PictureFile != null) && (!String.IsNullOrEmpty(PictureFile.FileName))) { byte[] PictureBinary = PictureManager.GetPictureBits(PictureFile.InputStream, PictureFile.ContentLength); pic = PictureManager.InsertPicture(PictureBinary, PictureFile.ContentType, true); } int PictureId = 0; if (pic != null) { PictureId = pic.PictureId; } Nop_EmailDirectory newemail = new Nop_EmailDirectory(); newemail.Description = this.txtDescription.Content; newemail.EmailAddress = txtEmailAddress.Text; newemail.FirstName = txtFirstName.Text; newemail.LastName = txtLastName.Text; newemail.PhoneNumber = txtPhoneNumber.Text; newemail.PictureID = PictureId; newemail.JobTitle = txtJobTitle.Text; bool b = emailbiz.SaveEmail(newemail); Response.Redirect("EmailDirectory.aspx"); return(b); } }
protected void Page_Load(object sender, EventArgs e) { string title = GetLocaleResourceString("PageTitle.ComposerDetailsPage"); SEOHelper.RenderTitle(this, title, true); if (!IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["ComposerID"])) { string PId = Request.QueryString["ComposerID"].ToString(); long PersonId = 0; if (long.TryParse(PId, out PersonId)) { try { PersonBiz pb = new PersonBiz(); lwg_Person person = pb.GetByID(PersonId); if (person != null) { this.litName.Text = person.NameDisplay; this.lblName.Text = person.NameDisplay; this.Literal1.Text = "About " + person.NameDisplay; if (!String.IsNullOrEmpty(person.Biography)) { this.Literal2.Text = Custring(person.Biography); } if (person.PictureID.HasValue) { if (person.PictureID.Value > 0) { Picture Picture = PictureManager.GetPictureById(person.PictureID.Value); string pictureUrl = PictureManager.GetPictureUrl(Picture, 150); this.iPicture.Visible = true; this.iPicture.ImageUrl = pictureUrl; } } else { iPicture.ImageUrl = PictureManager.GetDefaultPictureUrl(SettingManager.GetSettingValueInteger("Media.Product.DetailImageSize", 150)); } } else { Response.Write("This composer doesn't exist."); } } catch (Exception ex) { Response.Write(ex.Message); } return; } } // Invalid Person ID. Go to Composers page or 404 page. Response.Redirect("~/MeetComposers.aspx"); } }
public string SaveInfo() { PersonBiz pBiz = new PersonBiz(); lwg_Person person = pBiz.GetByID(this.ComposerId); Picture pic = null; if (person == null) { person = new lwg_Person(); } else { if (person.PictureID.HasValue) { if (person.PictureID.Value > 0) { pic = PictureManager.GetPictureById(person.PictureID.Value); } } } HttpPostedFile PictureFile = fuPicture.PostedFile; if ((PictureFile != null) && (!String.IsNullOrEmpty(PictureFile.FileName))) { byte[] pictureBinary = PictureManager.GetPictureBits(PictureFile.InputStream, PictureFile.ContentLength); if (pic != null) { pic = PictureManager.UpdatePicture(pic.PictureId, pictureBinary, PictureFile.ContentType, true); } else { pic = PictureManager.InsertPicture(pictureBinary, PictureFile.ContentType, true); } } int PictureId = 0; if (pic != null) { PictureId = pic.PictureId; } person.Biography = Server.HtmlEncode(txtBiography.Content); if (txtDOB.Text.Trim() != person.DOB) { person.DOB = txtDOB.Text.Trim(); } if (txtDOD.Text.Trim() != person.DOD) { person.DOD = txtDOD.Text.Trim(); } string lastName = txtLastName.Text.Trim(); person.FirstLetter = lastName.Length > 0 ? lastName.Substring(0, 1).ToUpper() : string.Empty; person.FirstName = txtFirstName.Text.Trim(); person.LastName = lastName; person.NameDisplay = txtNameDisplay.Text.Trim(); person.NameList = txtNameList.Text.Trim(); person.NameSort = txtNameSort.Text.Trim(); person.PictureID = PictureId; pBiz.SavePerson(person); return(person.PersonId.ToString()); }