Example #1
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            UserDA objUserDA = new UserDA();

            List<UserBE> objUserBO = objUserDA.GetAuthenticatedUserDA(txtUserName.Text.Trim(), txtPassword.Text.Trim());
            if (objUserBO.Count > 0)
            {

                if (objUserBO[0].UserStatus == "Active")
                {
                    Session["UserID"] = objUserBO[0].UserID;
                    Session["ClientID"] = objUserBO[0].ClientID;
                    Session["Role"] = objUserBO[0].Role;

                    Session["FullName"] = objUserBO[0].FirstName + " " + objUserBO[0].LastName;
                    if (objUserBO[0].Role == "SSAdmin")
                        Response.Redirect("~/Pages/clientInfo.aspx");
                    else
                        Response.Redirect("~/Pages/mywebinars.aspx");
                }
                else
                {
                    lblMsg.Text = "Please contact your administrator";
                }
            }
            else
                lblMsg.Text = "Invalid username or password...";
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            lblMsg.Text = "";
            UserDA objUserDA = new UserDA();

            UserBE objUBE1 = new UserBE();
            objUBE1.isEmailWeeklyUpdate = chkEmailUpdate.Checked;
            objUBE1.TimeZoneID = Convert.ToInt32(rcmbTimeZone.SelectedValue);
            objUBE1.isAutoDLSave = chkDaylight.Checked;
            objUBE1.UserID = Convert.ToInt32(Session["UserID"]);

            objUserDA.UpdateUserAcccountSetting(objUBE1);

            lblMsg.ForeColor = System.Drawing.Color.Green;
            lblMsg.Text = objErr.getMessage("AM0006");
        }
 protected void btnChangePassword_Click(object sender, EventArgs e)
 {
     if (txtCurrPassword.Text.Trim() == "" || txtNewPassword.Text.Trim() == "" || txtConfirmPassword.Text.Trim() == "")
     {
         lblError1.Text = "No password input can be empty";
     }
     else
     {
         if (txtNewPassword.Text.Trim() != txtConfirmPassword.Text.Trim())
         {
             lblError1.Text = "Mismatch of new password and confirm password";
         }
         else
         {
             Regex objRegEx = new Regex("^.*(?=.{8,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).*$");
             if (!objRegEx.IsMatch(txtNewPassword.Text))
             {
                 lblError1.Text = objErr.getMessage("AM0011");
             }
             else
             {
                 UserDA objUserDA = new UserDA();
                 string rtnVal = objUserDA.ChangeUserPassword(Session["EmailID"].ToString(), EBirdUtility.Encrypt(txtCurrPassword.Text.Trim()), EBirdUtility.Encrypt(txtNewPassword.Text.Trim()));
                 if (rtnVal != "")
                     lblError1.Text = objErr.getMessage(rtnVal);
                 else
                 {
                     int reqID = SaveToEmailJob(Session["EmailID"].ToString());
                     if (reqID > 0)
                     {
                         EmailApp objEmailing = new EmailApp();
                         objEmailing.SendEmail(reqID);
                     }
                     lblError1.Text = "Password changed successfully, login using your changed password";
                 }
             }
         }
     }
 }
 private void getSetting()
 {
     UserDA objUserDA = new UserDA();
     List<UserBE> objUBE = objUserDA.GetUserDetailDA(Convert.ToInt32(Session["UserID"]));
     if (objUBE.Count > 0)
     {
         chkEmailUpdate.Checked = objUBE[0].isEmailWeeklyUpdate;
         rcmbTimeZone.SelectedValue = objUBE[0].TimeZoneID.ToString();
         chkDaylight.Checked = objUBE[0].isAutoDLSave;
     }
 }
Example #5
0
        protected void btnNext_Click(object sender, EventArgs e)
        {
            tabCnt = Convert.ToInt32(hActiveTab.Value);
            int webID = Convert.ToInt32(hWebinarID.Value);
            string rtnVal = string.Empty;
            lblError.Text = "";
            dvValidationMsg.Visible = false;
            switch (tabCnt)
            {
                case 1:
                    #region tab 1
                    if (hIsPast.Value == "0")
                    {
                        if (txtWebinarTitle.Text.Trim() != "" && rdtStartDate.SelectedDate.ToString() != "" && rdtStartTime.SelectedDate.ToString() != "" && rdEndTime.SelectedDate.ToString() != "")
                        {
                            int webinarID = 0;
                            string recurrCond = string.Empty;

                            #region Set webinar info for save
                            objWebinarBE.Createdby = Convert.ToInt32(Session["UserID"]);
                            //objWebinarBE.Description = txtDescription.Text;
                            objWebinarBE.Description = redtSummary.Content;
                            objWebinarBE.isRecurrence = chkRecurrence.Checked;

                            //objWebinarBE.StartDate = objUtil.getGMTDateTime(Convert.ToDateTime(rdtStartDate.SelectedDate + " " + rdtStartTime.SelectedDate));

                            //objWebinarBE.StartTime = Convert.ToDateTime(objUtil.getGMTDateTime(Convert.ToDateTime(rdtStartDate.SelectedDate + " " + rdtStartTime.SelectedDate)).ToString("HH:mm:ss")); //ToLongTimeString();
                            //objWebinarBE.EndTime = Convert.ToDateTime(rdEndTime.SelectedDate).ToString("HH:mm:ss"); //.ToLongTimeString();

                            objWebinarBE.StartDate = Convert.ToDateTime(rdtStartDate.SelectedDate);
                            objWebinarBE.StartTime = Convert.ToDateTime(rdtStartTime.SelectedDate).ToString("HH:mm:ss"); //ToLongTimeString();
                            objWebinarBE.EndTime = Convert.ToDateTime(rdEndTime.SelectedDate).ToString("HH:mm:ss"); //.ToLongTimeString();

                            objWebinarBE.TimeZoneID = Convert.ToInt32(ddlTimeZone.SelectedValue);
                            objWebinarBE.Title = txtWebinarTitle.Text;
                            objWebinarBE.WebinarID = Convert.ToInt32(hWebinarID.Value);
                            if (hWebinarID.Value == "0")
                                objWebinarBE.WebinarStatus = "Active";
                            //Presenters Options
                            if (radioBtnId11.Checked)
                                objWebinarBE.DeliveryChannel = "1";
                            else if (radioBtnId22.Checked)
                                objWebinarBE.DeliveryChannel = "2";
                            else if (radioBtnId33.Checked)
                                objWebinarBE.DeliveryChannel = "3";
                            else
                                objWebinarBE.DeliveryChannel = "0";
                            objWebinarBE.isPublic = chkEmailRegAPI.Checked;

                            #endregion

                            #region recurrence
                            WebinarRecurrencyBE objWebinarRecurrBE = new WebinarRecurrencyBE();

                            if (chkRecurrence.Checked)
                            {
                                //if (rbtnNoEnddate.Checked)
                                //{
                                //    objWebinarRecurrBE.endType = "Noend";
                                //    objWebinarRecurrBE.endValue = "";
                                //}
                                //else
                                if (rbtnEndAfter.Checked)
                                {
                                    objWebinarRecurrBE.endType = "After";
                                    objWebinarRecurrBE.endValue = txtEndAfter.Text;
                                    if (!objUtil.IsInteger(txtEndAfter.Text.Trim()))
                                        rtnVal = "Number of recurrence should be numeric";
                                }
                                else
                                {
                                    objWebinarRecurrBE.endType = "Endby";
                                    objWebinarRecurrBE.endValue = Convert.ToDateTime(rdtEndBy.SelectedDate).ToShortDateString();
                                    if (!objUtil.isDateGreaterToday(Convert.ToDateTime(rdtEndBy.SelectedDate)))
                                        rtnVal = "End by date cannot be in past";
                                }
                                if (rtnVal == string.Empty)
                                {
                                    switch (rbtnDurationType.SelectedValue)
                                    {
                                        //case "H":
                                        //    recurrCond = "H:" + rcmbHourly.SelectedValue;
                                        //    break;
                                        case "D":
                                            recurrCond = "D:" + (rbtnEday.Checked ? "ED" + rcmbEDay.SelectedValue : "EW");
                                            break;
                                        case "W":
                                            string selWDay = "";
                                            foreach (ListItem li in chkWkDay.Items)
                                            {
                                                if (li.Selected)
                                                    selWDay = selWDay + li.Value + ",";
                                            }
                                            if (selWDay.Length > 0)
                                                recurrCond = "W:" + rcmbRecurE.SelectedValue + ":" + selWDay.Substring(0, selWDay.Length - 1);
                                            else
                                                recurrCond = "W:" + rcmbRecurE.SelectedValue + ":";
                                            break;
                                        case "M":
                                            if (optMDay.Checked)
                                                recurrCond = "M:D:" + rcmbMDay.SelectedValue + ":" + rcmbMDay1.SelectedValue;
                                            else
                                                recurrCond = "M:T:" + rcmbMTheDay.SelectedValue + ":" + rcmbMTheTyp.SelectedValue + ":" + rcmbM1.SelectedValue;
                                            break;
                                        case "Y":
                                            if (optY.Checked)
                                                recurrCond = "Y:E:" + rcmbY.SelectedValue + ":" + rcmbYMonthday.SelectedValue;
                                            else
                                                recurrCond = "Y:T:" + rcmbYTheDay.SelectedValue + ":" + rcmbYTheTyp.SelectedValue + ":" + rcmbMTheMonth.SelectedValue;
                                            break;
                                    }
                                    objWebinarRecurrBE.WebinarID = webinarID;
                                    objWebinarRecurrBE.recurrType = rbtnDurationType.SelectedValue;
                                    objWebinarRecurrBE.recurrCriteria = recurrCond;
                                }
                                //objWebinarDA.UpdateWebinarRecurrence(objWebinarRecurrBE);
                            }
                            #endregion

                            if ((Convert.ToDateTime(rdtStartDate.SelectedDate) - DateTime.Now).Days < 0)
                            {
                                rtnVal = "Cannot schedule webinar in the past";
                            }
                            else if ((Convert.ToDateTime(rdtStartDate.SelectedDate) - DateTime.Now).Days == 0)
                            {
                                UserDA objUserDA = new UserDA();
                                float tm = objUserDA.getTimezoneToServerTimeDiff(Convert.ToInt32(ddlTimeZone.SelectedValue));
                                DateTime currentClientPreferDateTime = DateTime.Now.AddHours(-tm);

                                if ((Convert.ToDateTime(rdtStartTime.SelectedDate) - Convert.ToDateTime(currentClientPreferDateTime)).Minutes < 0)
                                    rtnVal = "Cannot schedule webinar past the current time";
                            }

                            if (rtnVal == "")
                            {
                                if (objWebinarDA.IsWebinarOverlapping(objUtil.FormDBDate(Convert.ToDateTime(rdtStartDate.SelectedDate)), rdtStartTime.SelectedDate.ToString(), rdEndTime.SelectedDate.ToString(), Convert.ToInt32(Session["UserID"]), Convert.ToInt32(hWebinarID.Value)))
                                {
                                    rtnVal = objError.getMessage("WB0008");
                                }
                                else
                                {
                                    webinarID = objWebinarDA.SaveWebinarSchedule(objWebinarBE, objWebinarRecurrBE, Session["EmailID"].ToString());
                                    saveRecurrenceInstances(webinarID);
                                    if (hWebinarID.Value == "0") // this section occurs when new webinars get created
                                    {
                                        hWebinarID.Value = webinarID.ToString();
                                        //setWebinarIDToTabs(hWebinarID.Value, true);
                                        lblWebinarTitle.Text = "<b>Webinar Title</b> - " + txtWebinarTitle.Text;
                                        fvWebTitle.Visible = true;
                                    }
                                }
                            }
                        }
                    }
                    #endregion
                    break;
                case 2:
                    if (hIsPast.Value == "0")
                    {
                        rtnVal = webRegistration1.saveRegistrationInfo();
                    }
                    break;
                case 3:
                    if (hIsPast.Value == "0")
                    {
                        webAudience1.saveAudienceComponent();
                    }
                    break;
                case 4:
                    if (hIsPast.Value == "0")
                    {
                        webEmail1.SaveWebEmail();
                    }
                    break;
            }
            if (rtnVal == string.Empty)
            {
                if (hWebinarID.Value != "0")
                {
                    if (tabCnt < 4)
                        tabCnt = tabCnt + 1;
                    hActiveTab.Value = tabCnt.ToString();
                    setTab();
                }
            }
            else
                lblError.Text = "<br>" + rtnVal;
        }
Example #6
0
        public string getHTMLFormattedPasswdChangeNotify(string emailID, int languageID=1)
        {
            TemplateMgmt objTpl = new TemplateMgmt();
            string strTpl = objTpl.GetGeneralEmailTpl(Constant.DocTemplate + "PasswdChange.tpl");
            if (strTpl != "")
            {
                ReportUtils objRptUtil = new ReportUtils();
                UserDA objUDA = new UserDA();
                List<UserBE> objUBE = objUDA.GetUserDetailDA(emailID);
                List<WebinarEmailBE> objWBE = objEmailDA.GetGeneralEmailDefault("Password Changed",languageID);

                strTpl = strTpl.Replace("##HEADER##", objRptUtil.getEmailRptHeader());
                strTpl = strTpl.Replace("##CONTENT##", objWBE[0].EmailContent);
                strTpl = strTpl.Replace("##FOOTER##", objRptUtil.getEmailRptFooter());
                strTpl = strTpl.Replace("##PSWDCHANGEDATETIME##", objUBE[0].PasswordChangedOn);
            }
            return strTpl;
        }
Example #7
0
        public string getHTMLFormattedNewAccountNotify(string emailID, string passwd, string gendate, int languageID=1)
        {
            TemplateMgmt objTpl = new TemplateMgmt();
            string strTpl = objTpl.GetGeneralEmailTpl(Constant.DocTemplate + "NewUserAccount.tpl");
            if (strTpl != "")
            {
                ReportUtils objRptUtil = new ReportUtils();
                UserDA objUDA = new UserDA();
                List<UserBE> objUBE = objUDA.GetUserDetailDA(emailID);
                List<WebinarEmailBE> objWBE = objEmailDA.GetGeneralEmailDefault("New User Account", languageID);

                strTpl = strTpl.Replace("##HEADER##", objRptUtil.getEmailRptHeader());
                strTpl = strTpl.Replace("##CONTENT##", objWBE[0].EmailContent);
                strTpl = strTpl.Replace("##FOOTER##", objRptUtil.getEmailRptFooter());
                strTpl = strTpl.Replace("##ACCTDATETIME##", gendate);
                strTpl = strTpl.Replace("##USEREMAILADDRESS##", emailID);
                strTpl = strTpl.Replace("##PASSWORD##", passwd);
            }
            return strTpl;
        }
Example #8
0
        protected void btnSaveWebinar_Click(object sender, EventArgs e)
        {
            lblWebSaveAsError.Text = "";
            if ((Convert.ToDateTime(rdtStartDate1.SelectedDate) - DateTime.Now).Days < 0)
            {
                lblWebSaveAsError.Text = "Cannot schedule webinar in the past";
            }
            else if ((Convert.ToDateTime(rdtStartDate1.SelectedDate) - DateTime.Now).Days == 0)
            {
                UserDA objUserDA = new UserDA();
                float tm = objUserDA.getTimezoneToServerTimeDiff(Convert.ToInt32(ddlTimeZone.SelectedValue));
                DateTime currentClientPreferDateTime = DateTime.Now.AddHours(-tm);

                if ((Convert.ToDateTime(rdtStartTime.SelectedDate) - Convert.ToDateTime(currentClientPreferDateTime)).Minutes < 0)
                    lblWebSaveAsError.Text = "Cannot schedule webinar past the current time";
            }
            if (lblWebSaveAsError.Text == "")
            {
                if (objWebinarDA.IsWebinarOverlapping(objUtil.FormDBDate(Convert.ToDateTime(rdtStartDate1.SelectedDate)), rdtStartTime.SelectedDate.ToString(), rdEndTime.SelectedDate.ToString(), Convert.ToInt32(Session["UserID"]), Convert.ToInt32(hWebinarID.Value)))
                {
                    lblWebSaveAsError.Text = objError.getMessage("WB0008");
                }
                else
                {
                    WebinarBE objWebinarBE = new WebinarBE();
                    objWebinarBE.WebinarID = Convert.ToInt32(hWebinarID.Value);
                    objWebinarBE.Createdby = Convert.ToInt32(Session["UserID"]);
                    objWebinarBE.Title = txtWebinarTitle.Text;
                    //objWebinarBE.Description = txtDescription.Text;
                    objWebinarBE.Description = redtSummary1.Content;
                    objWebinarBE.StartDate = Convert.ToDateTime(rdtStartDate1.SelectedDate);
                    objWebinarBE.StartTime = Convert.ToDateTime(rdtStartTime.SelectedDate).ToString("HH:mm:ss");
                    objWebinarBE.EndTime = Convert.ToDateTime(rdEndTime.SelectedDate).ToString("HH:mm:ss");
                    objWebinarBE.TimeZoneID = Convert.ToInt32(ddlTimeZone.SelectedValue);

                    objWebinarDA.SaveWeibarScheduleAs(objWebinarBE);

                    Response.Redirect("~/Pages/Webinar");
                }
            }
        }