Exemplo n.º 1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        member.TeamMemberName = txbName.Text;
        if (fupPortrait.PostedFile.ContentLength > 0)
        {
            Uploader uploader = new Uploader();
            member.TeamImageURL = uploader.UploadImage(fupPortrait.PostedFile,
                                                       MapPath("~") + @"Images\Team\",
                                                       250,
                                                       false);
        }
        member.TeamMemberDescription = txbDescription.Text;
        member.TeamMemberEmail       = txbContactEmail.Text;

        if (Convert.ToInt32(Request.QueryString["ID"]) > 0)
        {
            teamFac.Update(member);
        }
        else if (Request.QueryString["NewItem"] == "true")
        {
            teamFac.Add(member);
        }


        string currentURL = Request.RawUrl;

        Response.Redirect(currentURL);
    }
Exemplo n.º 2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        sponsor.Name = txbName.Text;
        if (fupLogo.PostedFile.ContentLength > 0)
        {
            Uploader uploader = new Uploader();
            sponsor.ImageURL = uploader.UploadImage(fupLogo.PostedFile,
                                                    MapPath("~") + @"Images\Sponsor\",
                                                    0,
                                                    false);
        }
        sponsor.Text   = txbText.Text;
        sponsor.LinkTo = txbLinkTo.Text;

        if (Convert.ToInt32(Request.QueryString["ID"]) > 0)
        {
            sponsorFac.Update(sponsor);
        }
        else if (Request.QueryString["NewItem"] == "true")
        {
            sponsorFac.Add(sponsor);
        }

        string currentURL = Request.RawUrl;

        Response.Redirect(currentURL);
    }
Exemplo n.º 3
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        news.NewsTitle = txbTitle.Text;
        if (fupImage.PostedFile.ContentLength > 0)
        {
            news.ImageURL = new Uploader().UploadImage(fupImage.PostedFile,
                                                       MapPath("~") + @"Images\News\",
                                                       0,
                                                       false);
        }
        news.LinkTo = txbLinkTo.Text;

        if (Convert.ToInt32(Request.QueryString["ID"]) > 0)
        {
            newsFac.Update(news);
        }
        else if (Request.QueryString["NewItem"] == "true")
        {
            newsFac.Add(news);
        }

        string currentURL = Request.RawUrl;

        Response.Redirect(currentURL);
    }
Exemplo n.º 4
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        product.ProductName        = txbName.Text;
        product.ProductDescription = txbText.Text;
        if (fupLogo.PostedFile.ContentLength > 0)
        {
            product.ProductImageURL = new Uploader().UploadImage(fupLogo.PostedFile,
                                                                 MapPath("~") + @"Images\Product\" + product.ProductName + @"\",
                                                                 250,
                                                                 false);
        }

        switch (rblSelect.SelectedValue)
        {
        case "Image":
            if (fupImage.PostedFile.ContentLength > 0)
            {
                string path  = MapPath("~") + @"Images\Product\" + product.ProductName + @"\";
                string image = "<img width='800' height='450' src='" + path +
                               new Uploader().UploadImage(fupImage.PostedFile,
                                                          path,
                                                          800,
                                                          false) +
                               "' />";
                product.ProductVisualRep = image;
            }
            break;

        case "Youtube":
            string youtubeLink = "<iframe class='YTPlayer' type='text / html' width='800' height='450'" +
                                 "src='https://www.youtube.com/embed/" + txbYoutubeID.Text + "'" +
                                 "frameborder='0' seamless='seamless' autohide='1' ></ iframe >";
            product.ProductVisualRep = youtubeLink;
            break;

        default:
            break;
        }

        product.CompanyID = (Session["user"] as User).CompanyID;

        if (Convert.ToInt32(Request.QueryString["ID"]) > 0)
        {
            productFac.Update(product);
        }
        else if (Request.QueryString["NewItem"] == "true")
        {
            productFac.Add(product);
        }


        string currentURL = Request.RawUrl;

        Response.Redirect(currentURL);
    }
Exemplo n.º 5
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        Uploader uploader = new Uploader();

        comp.CompanyName = txbName.Text;
        if (fupLogo.PostedFile.ContentLength > 0)
        {
            comp.CompanyImageURL = uploader.UploadImage(fupLogo.PostedFile,
                                                        MapPath("~") + @"Images\Company\" +
                                                        comp.CompanyName + @"\",
                                                        250,
                                                        false);
        }
        if (fupBanner.PostedFile.ContentLength > 0)
        {
            comp.CompanyImageBannerURL = uploader.UploadImage(fupBanner.PostedFile,
                                                              MapPath("~") + @"Images\Company\" +
                                                              comp.CompanyName + @"\",
                                                              2000,
                                                              false);
        }
        comp.CompanyDescription  = txbCompanyText.Text;
        comp.CompanyAcceptWork   = chbAcceptWork.Checked;
        comp.CompanySalesPitch   = txbSalesPitch.Text;
        comp.CompanyWebsite      = txbWebsite.Text;
        comp.CompanyContactEmail = txbContactEmail.Text;

        if (Convert.ToInt32(Request.QueryString["ID"]) > 0)
        {
            companyFac.Update(comp);
        }
        else if (Request.QueryString["NewItem"] == "true")
        {
            companyFac.Add(comp);
        }



        string currentURL = Request.RawUrl;

        Response.Redirect(currentURL);
    }
Exemplo n.º 6
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        user.UserEmail    = txbEmail.Text;
        user.UserPassword = txbTempPassword.Text;
        user.UserRole     = Convert.ToInt32(ddlUserRole.SelectedValue);
        user.CompanyID    = Convert.ToInt32(ddlAssignedCompany.SelectedValue);


        if (Convert.ToInt32(Request.QueryString["ID"]) > 0)
        {
            userFac.Update(user);
        }
        else if (Request.QueryString["NewItem"] == "true")
        {
            userFac.Add(user);
        }


        string currentURL = Request.RawUrl;

        Response.Redirect(currentURL);
    }
    protected void FillContent()
    {
        if (!IsPostBack)
        {
            if (facility.FacilityID == 0)
            {
                facility            = new Facility();
                facility.Text       = "";
                facility.Address    = "";
                facility.ImageOne   = "N/A";
                facility.ImageTwo   = "N/A";
                facility.ImageThree = "N/A";
                facility.ImageFour  = "N/A";
                facilityFac.Add(facility);
            }
            imgOne.ImageUrl   = facPath + facility.ImageOne;
            imgTwo.ImageUrl   = facPath + facility.ImageTwo;
            imgThree.ImageUrl = facPath + facility.ImageThree;
            imgFour.ImageUrl  = facPath + facility.ImageFour;

            txbFacText.Text = facility.Text;
            txbAddress.Text = facility.Address;
        }
    }