Ejemplo n.º 1
0
        public int SaveWebinarRegistrant(Registrants objRegData)
        {
            int webEventRegID = 0;
            try
            {
                using (MySqlConnection sqlCon = new MySqlConnection(Constant.EBirdConnectionString))
                {
                    MySqlCommand sqlCmd = new MySqlCommand(DBQuery.sqlWebinarRegistrantInsert, sqlCon);
                    sqlCon.Open();
                    sqlCmd.CommandType = CommandType.Text;
                    sqlCmd.Parameters.Add(new MySqlParameter("@webinarID", objRegData.webinarID));
                    sqlCmd.Parameters.Add(new MySqlParameter("@fld1", objRegData.Fld1));
                    sqlCmd.Parameters.Add(new MySqlParameter("@fld2", objRegData.Fld2));
                    sqlCmd.Parameters.Add(new MySqlParameter("@fld3", objRegData.Fld3));
                    sqlCmd.Parameters.Add(new MySqlParameter("@fld4", objRegData.Fld4));
                    sqlCmd.Parameters.Add(new MySqlParameter("@fld5", objRegData.Fld5));
                    sqlCmd.Parameters.Add(new MySqlParameter("@fld6", objRegData.Fld6));
                    sqlCmd.Parameters.Add(new MySqlParameter("@fld7", objRegData.Fld7));
                    sqlCmd.Parameters.Add(new MySqlParameter("@fld8", objRegData.Fld8));
                    sqlCmd.Parameters.Add(new MySqlParameter("@fld9", objRegData.Fld9));
                    sqlCmd.Parameters.Add(new MySqlParameter("@fld10", objRegData.Fld10));
                    sqlCmd.Parameters.Add(new MySqlParameter("@fld11", objRegData.Fld11));
                    sqlCmd.Parameters.Add(new MySqlParameter("@fld12", objRegData.Fld12));
                    sqlCmd.Parameters.Add(new MySqlParameter("@fld13", objRegData.Fld13));
                    sqlCmd.Parameters.Add(new MySqlParameter("@fld14", objRegData.Fld14));
                    sqlCmd.Parameters.Add(new MySqlParameter("@fld15", objRegData.Fld15));
                    sqlCmd.Parameters.Add(new MySqlParameter("@fld16", objRegData.Fld16));
                    sqlCmd.Parameters.Add(new MySqlParameter("@fld17", objRegData.Fld17));
                    sqlCmd.Parameters.Add(new MySqlParameter("@fld18", objRegData.Fld18));
                    sqlCmd.Parameters.Add(new MySqlParameter("@fld19", objRegData.Fld19));
                    sqlCmd.Parameters.Add(new MySqlParameter("@fld20", objRegData.Fld20));
                    sqlCmd.Parameters.Add(new MySqlParameter("regFromIP", objRegData.RegFromIP));
                    sqlCmd.ExecuteNonQuery();

                    sqlCmd = new MySqlCommand("SELECT LAST_INSERT_ID()", sqlCon);
                    sqlCmd.CommandType = CommandType.Text;

                    MySqlDataReader reader = sqlCmd.ExecuteReader();
                    if (reader.HasRows)
                    {
                        reader.Read();
                        webEventRegID = Convert.ToInt32(reader.GetValue(0));
                    }
                    reader.Close();
                    reader = null;
                    sqlCon.Close();
                    UpdateRegistrantCount(objRegData.webinarID);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
            return webEventRegID;
        }
Ejemplo n.º 2
0
        protected void lbtnRegister_Click(object sender, EventArgs e)
        {
            if (hPreview.Value == "0")
            {
                lblEror.Text = "";
                List<Registrants> objReg = objWebinarDA.GetWebinarRegistrantDetail(Convert.ToInt32(hWebinarID.Value), InV3.Text.Trim());
                if (objReg.Count > 0)
                {
                    dvRegForm.Visible = false;
                    dvRegExist.Visible = true;
                    TemplateMgmt objTemplateMgmt = new TemplateMgmt();
                    RegistrationExistTemplateBO objExistBO = new RegistrationExistTemplateBO();
                    objExistBO.RegistrantID = objReg[0].RegistrationID;
                    objExistBO.RegistrantEmail = objReg[0].EmailAddress;
                    objExistBO.RegisteredOn = objReg[0].RegisteredOn;
                    objExistBO.RegisteredFromIP = objReg[0].RegFromIP;
                    ltrExist.Text = objTemplateMgmt.GetRegistrationExist(objExistBO, Constant.DocTemplate + "regExist.tpl");
                }
                else
                {
                    if (objWebinarDA.IsWebinarHostExistDA(Convert.ToInt32(hWebinarID.Value), InV3.Text.Substring(InV3.Text.IndexOf("@") + 1)))
                    {
                        lblEror.Text = objError.getMessage("WB0009");
                    }
                    else
                    {
                        Registrants objRegData = new Registrants();
                        TextBox InputValue;
                        RadComboBox rcmb;
                        string fieldValue;
                        for (int idx = 1; idx < 21; idx++)
                        {
                            fieldValue = "";

                            //if (idx == 8 || idx == 10 || idx == 16)
                            //{
                            //    if ((RadComboBox)this.FindControl("InV" + idx.ToString()) != null)
                            //    {
                            //        rcmb = (RadComboBox)this.FindControl("InV" + idx.ToString());
                            //        fieldValue = rcmb.SelectedValue;
                            //    }
                            //}
                            //else
                            //{
                            if ((TextBox)this.FindControl("InV" + idx.ToString()) != null)
                            {
                                InputValue = (TextBox)this.FindControl("InV" + idx.ToString());
                                fieldValue = InputValue.Text;
                            }
                            //}

                            switch (idx)
                            {
                                case 1:
                                    objRegData.Fld1 = fieldValue;
                                    break;
                                case 2:
                                    objRegData.Fld2 = fieldValue;
                                    break;
                                case 3:
                                    objRegData.Fld3 = fieldValue;
                                    break;
                                case 4:
                                    objRegData.Fld4 = fieldValue;
                                    break;
                                case 5:
                                    objRegData.Fld5 = fieldValue;
                                    break;
                                case 6:
                                    objRegData.Fld6 = fieldValue;
                                    break;
                                case 7:
                                    objRegData.Fld7 = fieldValue;
                                    break;
                                case 8:
                                    objRegData.Fld8 = fieldValue;
                                    break;
                                case 9:
                                    objRegData.Fld9 = fieldValue;
                                    break;
                                case 10:
                                    objRegData.Fld10 = fieldValue;
                                    break;
                                case 11:
                                    objRegData.Fld11 = fieldValue;
                                    break;
                                case 12:
                                    objRegData.Fld12 = fieldValue;
                                    break;
                                case 13:
                                    objRegData.Fld13 = fieldValue;
                                    break;
                                case 14:
                                    objRegData.Fld14 = fieldValue;
                                    break;
                                case 15:
                                    objRegData.Fld15 = fieldValue;
                                    break;
                                case 16:
                                    objRegData.Fld16 = fieldValue;
                                    break;
                                case 17:
                                    objRegData.Fld17 = fieldValue;
                                    break;
                                case 18:
                                    objRegData.Fld18 = fieldValue;
                                    break;
                                case 19:
                                    objRegData.Fld19 = fieldValue;
                                    break;
                                case 20:
                                    objRegData.Fld20 = fieldValue;
                                    break;
                            }
                        }

                        objRegData.webinarID = Convert.ToInt32(hWebinarID.Value);
                        objRegData.RegFromIP = Request.UserHostAddress;
                        int eventRegID = objWebinarDA.SaveWebinarRegistrant(objRegData);
                        updateQAValues(eventRegID);

                        dvRegForm.Visible = false;
                        dvRegConf.Visible = true;

                        TemplateMgmt objTemplateMgmt = new TemplateMgmt();
                        RegistrationConfirmTemplateBO objConfirmBO = new RegistrationConfirmTemplateBO();
                        objConfirmBO.RegistrantID = eventRegID;

                        ltrConf.Text = objTemplateMgmt.GetRegistrationConfirm(objConfirmBO, Constant.DocTemplate + "regConfirm.tpl");
                        //Email confirmation - need to be added here

                        //int eventRegID = objWebinarDA.SaveWebinarEvent(objRegData);
                        //if (dvAdditonalWeb.Visible)
                        //{
                        //    int addEventID = 0;
                        //    foreach (RepeaterItem item in rpRelatedWebinar.Items)
                        //    {
                        //        CheckBox chk = (CheckBox)item.FindControl("chkID");
                        //        if (chk.Checked)
                        //        {
                        //            HiddenField hfld = (HiddenField)item.FindControl("hID");
                        //            objRegData.webinarID = Convert.ToInt32(hfld.Value);
                        //            addEventID = objWebinarDA.SaveWebinarEvent(objRegData);
                        //            // is every webinar confirmation number to be captured and
                        //            // displayed in confirmation page and as well in email
                        //        }
                        //    }
                        //}
                    }
                }
            }
        }