Exemplo n.º 1
0
        public void ProcessRequest(HttpContext context)
        {
            int docID = 0;
            DocumentDA objDocDA = new DocumentDA();
            if (context.Request["ID"] != null)
            {
                docID = Convert.ToInt32(context.Request["ID"]);

                DocAccess objDocAccess = new DocAccess();

                byte[] fileContents = objDocAccess.FileToByteArray(docID);
                if (fileContents != null)
                {
                    context.Response.AppendHeader("Content-Type", "video/mp4");
                    context.Response.AppendHeader("Accept-Ranges", "bytes");
                    context.Response.OutputStream.Write(fileContents, 0, fileContents.Length);
                    context.Response.Flush();
                }
                else
                {
                    context.Response.ContentType = "image/jpeg";
                    if (File.Exists(Constant.DocRepRoot + "blankVideoTN.png"))
                        context.Response.WriteFile(Constant.DocRepRoot + "blankVideoTN.png");
                    else
                        context.Response.WriteFile(Constant.DocRepRoot + "NoDocs.png");
                }
            }
        }
Exemplo n.º 2
0
 protected void ibtnDel_Click(object sender, ImageClickEventArgs e)
 {
     DocAccess objDocAccess = new DocAccess();
     DocumentDA objDocDA = new DocumentDA();
     objDocDA.ResetPresenterImgDocID(Convert.ToInt32(hProfileImgID.Value), Convert.ToInt32(Session["UserID"]));
     objDocAccess.removePresenterprofileImage(Convert.ToInt32(hProfileImgID.Value));
     hProfileImgID.Value = "0";
     dvToggle();
 }
Exemplo n.º 3
0
        protected override IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName)
        {
            telerikAsyncUploadResult result = CreateDefaultUploadResult<telerikAsyncUploadResult>(file);
            string folderType = "temp";
            DocAccess objDoc = new DocAccess();

            result.DocumentID = 0;
            result.DocumentID = objDoc.saveFiles(file, folderType, Convert.ToInt32(context.Session["ClientID"]), Convert.ToInt32(context.Session["UserID"]), 0, Convert.ToInt32(context.Session["WebinarID"]));
            return result;
        }
Exemplo n.º 4
0
 protected void btnUpload_Click(object sender, EventArgs e)
 {
     int docID = 0;
     DocAccess objDocAccess = new DocAccess();
     WebinarDA objWebinarDA = new WebinarDA();
     docID = objDocAccess.saveFiles(Request, "PRESENTATION", Convert.ToInt32(Session["ClientID"]), Convert.ToInt32(Session["UserID"]));
     if (docID > 0)
     {
         objWebinarDA.UpdateRegPageVideo(docID, Convert.ToInt32(hWebinarID.Value));
         hDocID.Value = docID.ToString();
     }
 }
Exemplo n.º 5
0
        protected override IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName)
        {
            // Call the base Process method to save the file to the temporary folder
            //base.Process(file, context, configuration, tempFileName);

            // Populate the default (base) result into an object of type telerikAsyncUploadResult
            telerikAsyncUploadResult result = CreateDefaultUploadResult<telerikAsyncUploadResult>(file);

            int userID = -1;
            int clientID = -1;
            string folderType = string.Empty;
            DocAccess objDoc = new DocAccess();
            //Follwoing is commented as the custom config values are not getting passed.
            //telerikUploadConfig getConfig = configuration as telerikUploadConfig;
            //if (getConfig != null)
            //{
            //    userID = getConfig.ActionID;
            //    clientID = getConfig.ClientID;
            //    folderType = getConfig.FolderType;
            //    result.DocumentID = objDoc.saveFiles(file, folderType, clientID, userID);
            //}
            result.DocumentID = 0;
            if (context.Request["uid"] != null)
                userID = 1;
            string refURL = context.Request.UrlReferrer.ToString().ToUpper();
            if (refURL.IndexOf("BIO") > 0)
                folderType = "PROFILE";
            if (refURL.IndexOf("AUDIFEATURE_CONTENT") > 0)
                folderType = "PRESENTATION";
            if (refURL.IndexOf("SNAPSITE") > 0)
                folderType = "SS";

            if (folderType == string.Empty)
            {
                if (context.Request["ftyp"] != null)
                {
                    if (Convert.ToString(context.Request["ftyp"]) == "u")
                        folderType = "PROFILE";
                    else
                        folderType = "PRESENTATION";
                }
                else if (context.Session["FolderType"] != null)
                    folderType = Convert.ToString(context.Session["FolderType"]);
            }

            if (folderType != string.Empty)
            {
                if (userID == -1)
                    result.DocumentID = objDoc.saveFiles(file, folderType, Convert.ToInt32(context.Session["ClientID"]), Convert.ToInt32(context.Session["UserID"]), 0, Convert.ToInt32(context.Session["WebinarID"]));
                else
                    result.DocumentID = objDoc.saveFiles(file, folderType, Convert.ToInt32(context.Session["ClientID"]), Convert.ToInt32(context.Session["UserID"]), Convert.ToInt32(context.Session["UserID"]), 0);
                //if (folderType != "PRESENTATION")
                //{
                //    DocAccess objDocAccess = new DocAccess();
                //    objDocAccess.resizeImage(result.DocumentID, Convert.ToInt32(context.Session["ClientID"]));
                //}
            }
            return result;
        }
Exemplo n.º 6
0
 protected void rpLogo_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.CommandArgument != "")
     {
         objWebinarDA.DeleteRegFormResources(Convert.ToInt32(hWebinarID.Value), Convert.ToInt32(e.CommandArgument));
         DocAccess objDoc = new DocAccess();
         objDoc.removeDocumentFromRepositary(Convert.ToInt32(e.CommandArgument), Convert.ToInt32(Session["ClientID"]), "Logo");
         popLogo();
     }
 }
Exemplo n.º 7
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            int ID = Convert.ToInt32(hClientID.Value);
            if (ID != 0 && (hCurrStatus.Value != rcmbStatus.SelectedValue))
            {
                objClientDA.UpdateClientStatusDA(ID, rcmbStatus.SelectedValue, Convert.ToInt32(Session["UserID"]));
                popClients();
                lbtnBack_Click(null, null);
            }
            else
            {
                // Business rule check
                if ((ID != 0) && (Convert.ToInt32(txtNoUsers.Text) < Convert.ToInt32(hActiveUserCnt.Value)))
                {
                    dvValidationMsg.Visible = true;
                    lblValidationMsg.Text = objError.getMessage("SS0003");
                }
                else if (ID != 0)
                {
                    if (objUserDA.isUserExistDA(txtAdminEmail.Text.Trim(), Convert.ToInt32(hAdminID.Value)))
                    {
                        dvValidationMsg.Visible = true;
                        lblValidationMsg.Text = objError.getMessage("AM0012");
                    }
                }
                else if (ID == 0)
                {
                    if (objUserDA.isUserExistDA(txtAdminEmail.Text.Trim()))
                    {
                        dvValidationMsg.Visible = true;
                        lblValidationMsg.Text = objError.getMessage("AM0002");
                    }
                }

                if (dvValidationMsg.Visible == false)
                {
                    #region add/update client profile

                    objClientBE.ClientID = ID;
                    objClientBE.ClientName = txtClientName.Text;
                    objClientBE.Address1 = txtAddress.Text;
                    objClientBE.City = txtCity.Text;
                    objClientBE.State = txtState.Text;
                    objClientBE.CountryID = Convert.ToInt32(rcmbCountry.SelectedValue);
                    objClientBE.PostCode = txtPostcode.Text;
                    objClientBE.Phone = txtPhone.Text;
                    objClientBE.Website = txtWebsite.Text;
                    objClientBE.IndustryID = Convert.ToInt32(rcmbIndustry.SelectedValue);
                    objClientBE.AnnualRevID = Convert.ToInt32(rcmbRevenue.SelectedValue);
                    objClientBE.NoOfUsers = Convert.ToInt32(txtNoUsers.Text);
                    objClientBE.CurrentPkgSubscribed = chkPackage.SelectedValue;
                    objClientBE.ClientStatus = rcmbStatus.SelectedValue; // "Active";
                    objClientBE.CreatedBy = Convert.ToInt32(Session["UserID"]);
                    ID = objClientDA.SaveClientProfileDA(objClientBE);
                    #endregion

                    #region Creating required folder structure for client
                    if (hClientID.Value == "0" && ID != 0)
                    {
                        DocAccess objDocAccess = new DocAccess();
                        if (!objDocAccess.InitClientFolders(ID))
                            lblFilterError.Text = objError.getMessage("AM0010");
                    }
                    #endregion

                    #region Updating primary contact and administrator
                    if (ID != 0)
                    {
                        lblClientError.Text = "";
                        //Saving Contact
                        ContactBE objContact = new ContactBE();
                        objContact.ClientID = ID;
                        objContact.ContactID = Convert.ToInt32(hContactID.Value);
                        objContact.Contactname = txtContactName.Text;
                        objContact.Phone = txtContactPhone.Text;
                        objContact.Email = txtContactEmail.Text;
                        objContact.Department = txtContactDepart.Text;
                        objContact.JobTitle = txtJobTitle.Text;
                        objClientDA.SaveClientContactDA(objContact);

                        //Saving Primary administrator

                        UserBE objUserBE = new UserBE();

                        objUserBE.UserID = Convert.ToInt32(hAdminID.Value);
                        objUserBE.EmailID = txtAdminEmail.Text;
                        objUserBE.FirstName = txtAdminFName.Text;
                        objUserBE.LastName = txtAdminLName.Text;
                        objUserBE.Address = "";
                        objUserBE.Telephone = txtAdminPhone.Text;
                        objUserBE.Role = "Admin";
                        objUserBE.ClientID = ID;
                        objUserBE.Department = txtAdminDept.Text;
                        objUserBE.UserStatus = "Active";
                        objUserBE.isPrimary = true;
                        objUserBE.CreatedBy = Convert.ToInt32(Session["UserID"]);

                        if (Convert.ToInt32(hAdminID.Value) != 0)
                        {
                            if (!objUserDA.UpdateUserRecord(objUserBE, objUserBE.UserID))
                                lblClientError.Text = objError.getMessage("AM0012");
                        }
                        else
                        {
                            string rndPasswd = RandomPassword.Generate();
                            objUserBE.Password = rndPasswd;

                            if (objUserDA.AddUserAccountDA(objUserBE) > 0)
                            {
                                // Emailing the account details to user
                                int reqID = SaveToEmailJob(txtAdminEmail.Text, rndPasswd);
                                if (reqID > 0)
                                {
                                    EmailApp objEmailing = new EmailApp();
                                    objEmailing.SendEmail(reqID);
                                }
                            }
                        }
                        // Following commented on 2/20/13 - J, as these logics ar moved inside the sp for add/edit client profile
                        //if (hClientID.Value == "0")
                        //    objClientDA.InitClientConfigDA(ID, chkPackage.SelectedValue, false);
                        //else if (hCurrPkg.Value != chkPackage.SelectedValue)
                        //    objClientDA.InitClientConfigDA(ID, chkPackage.SelectedValue, true);

                        //Session["clientID"] = ID.ToString();
                        //Response.Redirect("ClientConfig/");
                        popClients();
                        if (lblClientError.Text == "")
                            lbtnBack_Click(null, null);
                    }
                    #endregion
                    if (lblClientError.Text == "")
                        clearAll();
                }
            }
        }
        protected void tgrdResourceList_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName == "delResource")
            {
                // based on resourceID, get resourceType
                List<WebinarResource> objRes = objWebinarDA.getWebinarResouresByID(Convert.ToInt32(e.CommandArgument));
                if (objRes.Count > 0)
                {
                    if (objRes[0].ResourceType == "Content Doc")
                    {
                        DocAccess objDA = new DocAccess();
                        objDA.removeDocumentFromRepositary(objRes[0].DocID, Convert.ToInt32(Session["ClientID"]), "WebinarDocs");
                        objWebinarDA.DeleteRegFormResources(Convert.ToInt32(hWebinarID.Value), objRes[0].DocID);
                    }
                    else
                        objWebinarDA.DeleteRegFormResources(Convert.ToInt32(e.CommandArgument));

                    popResource();
                }
            }
        }
 protected void btnSave_Click(object sender, EventArgs e)
 {
     //if (Request["flg"].ToString() == "1")
     //    objWebinarDA.SaveWebinarAudience(Convert.ToInt32(hWebinarID.Value), "Content", (Convert.ToInt32(ClientConfigMaster.Audi_Component_Content)).ToString());
     //else
     if (Request["flg"].ToString() != "1")
     {
         // make the content feature ID to 0, in webinaraudience table
         objWebinarDA.SaveWebinarAudience(Convert.ToInt32(hWebinarID.Value), "Content", "0");
         // Delete all records with type 'URL' and make isbriefcase = 0 for presentation, return no. of 'Content Doc' record count
         if (objWebinarDA.DeleteContentFromBriefcase(Convert.ToInt32(hWebinarID.Value)) > 0)
         {
             DocAccess objDoc = new DocAccess();
             objDoc.DeleteBriefcaseContentDocs(Convert.ToInt32(hWebinarID.Value), Convert.ToInt32(Session["ClientID"]));
         }
     }
     Session["Web_Tab"] = "3";
     hModalStatusFlg.Value = "1";
     //if (!ClientScript.IsStartupScriptRegistered("alert")) { Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "CloseAndReload();", true); }
 }
Exemplo n.º 10
0
 private void updateHeader(string headerType)
 {
     int docID = 0;
     DocAccess objDocAccess = new DocAccess();
     WebinarDA objWebinarDA = new WebinarDA();
     switch (headerType)
     {
         case "Logo1":
             docID = objDocAccess.saveFiles(Request, "Logo", Convert.ToInt32(Session["ClientID"]), Convert.ToInt32(Session["UserID"]));
             objWebinarDA.SaveWebinarTheme("Logo1", docID, Convert.ToInt32(hWebinarID.Value));
             break;
         case "Logo2":
             docID = objDocAccess.saveFiles(Request, "Logo", Convert.ToInt32(Session["ClientID"]), Convert.ToInt32(Session["UserID"]));
             objWebinarDA.SaveWebinarTheme("Logo2", docID, Convert.ToInt32(hWebinarID.Value));
             break;
         case "Banner":
             docID = objDocAccess.saveFiles(Request, "Logo", Convert.ToInt32(Session["ClientID"]), Convert.ToInt32(Session["UserID"]));
             objWebinarDA.SaveWebinarTheme("BANNER", docID, Convert.ToInt32(hWebinarID.Value));
             break;
     }
     getThemeDetails();
 }
Exemplo n.º 11
0
 private void showPicture(int docID, int imgCount, string imgType)
 {
     //RadBinaryImage rimg = (RadBinaryImage)this.FindControl("Thumbnail" + imgCount.ToString());
     RadBinaryImage rimg = (RadBinaryImage)this.FindControl("Thumbnail1");
     if (rimg != null)
     {
         if (imgType.ToUpper() == "LOGO")
         {
             rimg.Width = Unit.Pixel(200);
             rimg.Height = Unit.Pixel(150);
         }
         else
         {
             rimg.Width = Unit.Pixel(750);
             rimg.Height = Unit.Pixel(180);
         }
         DocAccess objDocAccess = new DocAccess();
         rimg.DataValue = objDocAccess.FileToByteArray(docID);
     }
 }
Exemplo n.º 12
0
 protected void imgbtnDel2_Click(object sender, EventArgs e)
 {
     if (hBannerDocID.Value != "")
     {
         objWebinarDA.DeleteRegFormResources(Convert.ToInt32(hWebinarID.Value), Convert.ToInt32(hBannerDocID.Value));
         DocAccess objDoc = new DocAccess();
         objDoc.removeDocumentFromRepositary(Convert.ToInt32(hBannerDocID.Value), Convert.ToInt32(Session["ClientID"]), "Logo");
         popLogo();
     }
 }
Exemplo n.º 13
0
        public void aupPresentation_FileUploaded(object sender, FileUploadedEventArgs e)
        {
            Session["FolderType"] = "PRESENTATION";
            telerikAsyncUploadResult result = e.UploadResult as telerikAsyncUploadResult;
            if (result != null)
            {
                if (result.DocumentID > 0)
                {
                    WebinarResource objWebinarResource = new WebinarResource();
                    objWebinarResource.WebinarID = Convert.ToInt32(hWebinarID.Value);
                    objWebinarResource.DocID = result.DocumentID;
                    objWebinarResource.ResourceType = "Presentation";
                    objWebinarResource.ResourceTitle = e.File.FileName;
                    objWebinarResource.ResourceValue = "";
                    objWebinarResource.IsBriefcase = false; //chkAddtoBC.Checked;
                    if (objWebinarDA.InsertWebinarResources(objWebinarResource) == 0)
                    {
                        DocAccess objDocAccess = new DocAccess();
                        objDocAccess.removeDocumentFromRepositary(result.DocumentID,Convert.ToInt32(Session["ClientID"]),"WebinarDocs");
                    }

                    //if (chkAddtoBC.Checked && !chkConfig8.Checked)
                    //{
                    //    objWebinarDA.SaveWebinarAudience(Convert.ToInt32(hWebinarID.Value), "Content", (Convert.ToInt32(ClientConfigMaster.Audi_Component_Content)).ToString());
                    //    chkConfig8.Checked = true;
                    //}
                    // popResource(); // popPresentation();
                }
            }
        }
Exemplo n.º 14
0
 protected void tgrdPPTList_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
 {
     switch (e.CommandName)
     {
         case "DEL":
             DocAccess objDoc = new DocAccess();
             objWebinarDA.DeleteRegFormResources(Convert.ToInt32(hWebinarID.Value), Convert.ToInt32(e.CommandArgument));
             objDoc.removeDocumentFromRepositary(Convert.ToInt32(e.CommandArgument), Convert.ToInt32(Session["ClientID"]), "WebinarDocs");
             break;
         case "UNCHK":
             objWebinarDA.UpdateBriefcaseDocStatus(Convert.ToInt32(e.CommandArgument), Convert.ToInt32(hWebinarID.Value), true);
             break;
         case "CHK":
             objWebinarDA.UpdateBriefcaseDocStatus(Convert.ToInt32(e.CommandArgument), Convert.ToInt32(hWebinarID.Value), false);
             break;
     }
     popResource();
 }