public void save_Click(object sender, EventArgs e)
 {
     TransitAccountEventPicture t = new TransitAccountEventPicture();
     t.Name = inputName.Text;
     t.Description = inputDescription.Text;
     t.AccountEventId = AccountEventId;
     t.Id = RequestId;
     SessionManager.CreateOrUpdate<TransitAccountEventPicture>(
         t, SessionManager.EventService.CreateOrUpdateAccountEventPicture);
     Redirect(string.Format("AccountEventPicturesManage.aspx?id={0}", AccountEventId));
 }
    protected void files_FilesPosted(object sender, FilesPostedEventArgs e)
    {
        try
        {
            if (e.PostedFiles.Count == 0)
                return;

            ExceptionCollection exceptions = new ExceptionCollection();
            foreach (HttpPostedFile file in e.PostedFiles)
            {
                try
                {
                    TransitAccountEventPicture p = new TransitAccountEventPicture();
                    ThumbnailBitmap t = new ThumbnailBitmap(file.InputStream);
                    p.Picture = t.Bitmap;
                    p.Name = Path.GetFileName(file.FileName);
                    p.Description = string.Empty;
                    p.AccountEventId = RequestId;
                    SessionManager.CreateOrUpdate<TransitAccountEventPicture>(
                        p, SessionManager.EventService.CreateOrUpdateAccountEventPicture);
                }
                catch (Exception ex)
                {
                    exceptions.Add(new Exception(string.Format("Error processing {0}: {1}",
                        Renderer.Render(file.FileName), ex.Message), ex));
                }
            }

            gridManage.CurrentPageIndex = 0;
            gridManage_OnGetDataSource(sender, e);
            gridManage.DataBind();
            exceptions.Throw();

            Redirect(string.Format("AccountEventView.aspx?id={0}", RequestId));
        }
        catch (Exception ex)
        {
            ReportException(ex);
        }
    }
Example #3
0
 public int CreateOrUpdateAccountEventPicture(string ticket, TransitAccountEventPicture eventpicture)
 {
     return WebServiceImpl<TransitAccountEventPicture, ManagedAccountEventPicture, AccountEventPicture>.CreateOrUpdate(
         ticket, eventpicture);
 }