//*******COPY IT TO USE BELOW FUNCTION - INSERT************
//try
//{
//    LIBtblmstContact objLIBtblmstContact = new LIBtblmstContact();
//    DALtblmstContact objDALtblmstContact = new DALtblmstContact();
//    MyCLS.TransportationPacket tp = new MyCLS.TransportationPacket();

//    objLIBtblmstContact.id = txt.Text;
//    objLIBtblmstContact.Name = txt.Text;
//    objLIBtblmstContact.Email = txt.Text;
//    objLIBtblmstContact.phone = txt.Text;
//    objLIBtblmstContact.designation = txt.Text;
//    objLIBtblmstContact.OrgName = txt.Text;
//    objLIBtblmstContact.dt = txt.Text;
//    tp.MessagePacket = objLIBtblmstContact;
//    tp = objDALtblmstContact.InserttblmstContact(tp);

//    if(tp.MessageId > -1)
//{
//        string[] strOutParamValues = (string[])tp.MessageResultset;
//        MessageBox.Show(strOutParamValues[0].ToString());
//    }
//    }
//catch(Exception ex)
//{
//    MyCLS.clsHandleException.HandleEx(ex, System.Reflection.MethodBase.GetCurrentMethod().ToString(), true);
//}

/// <summary>
/// Accepts=Packet, Return=Packet, Result=Packet.MessageId, Return Values=Packet.MessageResultset
/// </summary>
/// <param name="Packet"></param>
/// <returns></returns>
/// <remarks></remarks>
        public MyCLS.TransportationPacket InserttblmstContact(MyCLS.TransportationPacket Packet)
        {
            String[]            strOutParamValues = new String[10];
            List <SqlParameter> objParamList      = new List <SqlParameter>();
            List <SqlParameter> objParamListOut   = new List <SqlParameter>();

            MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql();
            int Result = 0;

            try
            {
                LIBtblmstContact objLIBtblmstContact = new LIBtblmstContact();
                objLIBtblmstContact = (LIBtblmstContact)Packet.MessagePacket;

                objParamList.Add(new SqlParameter("@id", objLIBtblmstContact.id));
                objParamList.Add(new SqlParameter("@Name", objLIBtblmstContact.Name));
                objParamList.Add(new SqlParameter("@Email", objLIBtblmstContact.Email));
                objParamList.Add(new SqlParameter("@phone", objLIBtblmstContact.phone));
                objParamList.Add(new SqlParameter("@designation", objLIBtblmstContact.designation));
                objParamList.Add(new SqlParameter("@OrgName", objLIBtblmstContact.OrgName));
                objParamList.Add(new SqlParameter("@INTREST", objLIBtblmstContact.INTREST));
                objParamList.Add(new SqlParameter("@dt", objLIBtblmstContact.dt));
                objParamListOut.Add(new SqlParameter("@@id", SqlDbType.Int));
                strOutParamValues       = clsESPSql.ExecuteSPNonQueryOutPut("SP_InserttblmstContact", objParamList, objParamListOut, ref Result);
                Packet.MessageId        = Result;
                Packet.MessageResultset = strOutParamValues;
            }
            catch (Exception ex)
            {
                Packet.MessageId = -1;
                Packet.ex        = ex;
                MyCLS.clsHandleException.HandleEx(ex, System.Reflection.MethodBase.GetCurrentMethod().ToString(), true);
            }
            return(Packet);
        }
        protected void SendButton_Click(object sender, EventArgs e)
        {
            string intrest = "";

            try
            {
                LIBtblmstContact           objLIBtblmstContact = new LIBtblmstContact();
                DALtblmstContact           objDALtblmstContact = new DALtblmstContact();
                MyCLS.TransportationPacket tp = new MyCLS.TransportationPacket();

                objLIBtblmstContact.id          = -1;
                objLIBtblmstContact.Name        = txtname.Text;
                objLIBtblmstContact.Email       = txtEmail.Text;
                objLIBtblmstContact.phone       = txtPHONE.Text;
                objLIBtblmstContact.designation = txtDESIGNATION.Text;
                objLIBtblmstContact.OrgName     = txtORGANIZATION.Text;
                objLIBtblmstContact.dt          = DateTime.Now.ToShortDateString();
                if (rdoBasic.Checked == true)
                {
                    objLIBtblmstContact.INTREST = rdoBasic.Text;
                }
                if (rdoPro.Checked == true)
                {
                    objLIBtblmstContact.INTREST = rdoPro.Text;
                }
                tp.MessagePacket = objLIBtblmstContact;
                tp      = objDALtblmstContact.InserttblmstContact(tp);
                intrest = objLIBtblmstContact.INTREST;
                if (tp.MessageId > -1)
                {
                    string[] strOutParamValues = (string[])tp.MessageResultset;
                }
            }
            catch (Exception ex)
            {
                MyCLS.clsHandleException.HandleEx(ex, System.Reflection.MethodBase.GetCurrentMethod().ToString(), true);
            }
            try
            {
                DALCommon cmn1     = new DALCommon();
                string    strBody1 = cmn1.prcFindInFile(Server.MapPath("sendmailadmin.html").ToString(), "#name#", txtname.Text);
                strBody1 = cmn1.prcFindInString(strBody1, "#Designation#", txtDESIGNATION.Text);
                strBody1 = cmn1.prcFindInString(strBody1, "#Email#", txtEmail.Text);
                strBody1 = cmn1.prcFindInString(strBody1, "#Phone#", txtPHONE.Text);
                strBody1 = cmn1.prcFindInString(strBody1, "#Organisation#", txtORGANIZATION.Text);
                strBody1 = cmn1.prcFindInString(strBody1, "#Intrested#", intrest);


                // strBody = "Hi " + txtname.Text + ", You or someone with your id signed up at this site, Your new account is almost ready, but before you can login you need to confirm your email id by visitng the link below: http://localhost:56941/EmailConfirmation.aspx?ID=" + userInfo.ProviderUserKey.ToString() + " Once you have visited the verification URL, your account will be activated. If you have any problems or questions, please reply to this email. Thanks!";

                cmn1.SendHtmlFormattedEmail("*****@*****.**", "inQsights Op Contact Form submission", strBody1);
                sendmailuser();
            }
            catch (HttpException ex)
            {
            }
        }
//*******COPY IT TO USE BELOW FUNCTION - SELECT BY ID************
//try
//{
//    LIBtblmstContactListing objLIBtblmstContactListing = new LIBtblmstContactListing();
//    DALtblmstContact objDALtblmstContact = new DALtblmstContact();
//    MyCLS.TransportationPacket tp = new MyCLS.TransportationPacket();
//    DataSet ds = new DataSet();

////  txt.Text = objLIBtblmstContactListing[0].id = "";
////  txt.Text = objLIBtblmstContactListing[0].Name = "";
////  txt.Text = objLIBtblmstContactListing[0].Email = "";
////  txt.Text = objLIBtblmstContactListing[0].phone = "";
////  txt.Text = objLIBtblmstContactListing[0].designation = "";
////  txt.Text = objLIBtblmstContactListing[0].OrgName = "";
////  txt.Text = objLIBtblmstContactListing[0].dt = "";
//    tp.MessagePacket = 1;    //ID to be Passed

//    tp = objDALtblmstContact.GettblmstContactDetails(tp);
//    if(tp.MessageId == 1)
//{
//        objLIBtblmstContactListing = (LIBtblmstContactListing)tp.MessageResultset;
//        ds = (DataSet)tp.MessageResultsetDS;
//        MessageBox.Show(objLIBtblmstContactListing[0].ToString());
//    }
//    }
//catch(Exception ex)
//    {
//    MyCLS.clsHandleException.HandleEx(ex, System.Reflection.MethodBase.GetCurrentMethod().ToString(), true);
//    }

/// <summary>
/// Accepts=TransportationPacket, Return=Packet, Result=Packet.MessageId, Return Values=Packet.MessageResultset
/// </summary>
/// <returns></returns>
/// <remarks></remarks>
        public MyCLS.TransportationPacket GettblmstContactDetails(MyCLS.TransportationPacket Packet)
        {
            DataSet                 ds           = new DataSet();
            List <SqlParameter>     objParamList = new List <SqlParameter>();
            LIBtblmstContactListing objLIBtblmstContactListing = new LIBtblmstContactListing();

            MyCLS.clsExecuteStoredProcSql clsESPSql = new MyCLS.clsExecuteStoredProcSql();

            try
            {
                objParamList.Add(new SqlParameter("@Id", Packet.MessagePacket));
                ds = clsESPSql.ExecuteSPDataSet("SP_GetDetailsFromtblmstContactById", objParamList);
                if (ds != null)
                {
                    if (ds.Tables != null)
                    {
                        if (ds.Tables[0].Rows != null)
                        {
                            if (ds.Tables[0].Rows.Count > 0)
                            {
                                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                                {
                                    LIBtblmstContact oLIBtblmstContact = new LIBtblmstContact();

                                    objLIBtblmstContactListing.Add(oLIBtblmstContact);
                                    objLIBtblmstContactListing[i].id          = (int)ds.Tables[0].Rows[i]["id"];
                                    objLIBtblmstContactListing[i].Name        = ds.Tables[0].Rows[i]["Name"].ToString();
                                    objLIBtblmstContactListing[i].Email       = ds.Tables[0].Rows[i]["Email"].ToString();
                                    objLIBtblmstContactListing[i].phone       = ds.Tables[0].Rows[i]["phone"].ToString();
                                    objLIBtblmstContactListing[i].designation = ds.Tables[0].Rows[i]["designation"].ToString();
                                    objLIBtblmstContactListing[i].OrgName     = ds.Tables[0].Rows[i]["OrgName"].ToString();
                                    objLIBtblmstContactListing[i].dt          = ds.Tables[0].Rows[i]["dt"].ToString();
                                }
                                Packet.MessageId = 1;
                            }
                            else
                            {
                                Packet.MessageId = -1;
                            }
                        }
                    }
                }

                Packet.MessageResultsetDS = ds;
                Packet.MessageResultset   = objLIBtblmstContactListing;
            }
            catch (Exception ex)
            {
                Packet.MessageId = -1;
                Packet.ex        = ex;
                MyCLS.clsHandleException.HandleEx(ex, System.Reflection.MethodBase.GetCurrentMethod().ToString(), true);
            }
            return(Packet);
        }
Exemple #4
0
        protected void SendButton_Click(object sender, EventArgs e)
        {
            try
            {
                LIBtblmstContact           objLIBtblmstContact = new LIBtblmstContact();
                DALtblmstContact           objDALtblmstContact = new DALtblmstContact();
                MyCLS.TransportationPacket tp = new MyCLS.TransportationPacket();

                objLIBtblmstContact.id          = -1;
                objLIBtblmstContact.Name        = txtname.Text;
                objLIBtblmstContact.Email       = txtEmail.Text;
                objLIBtblmstContact.phone       = txtPHONE.Text;
                objLIBtblmstContact.designation = txtDESIGNATION.Text;
                objLIBtblmstContact.OrgName     = txtORGANIZATION.Text;
                objLIBtblmstContact.dt          = DateTime.Now.ToShortDateString();
                if (rdoBasic.Checked == true)
                {
                    objLIBtblmstContact.INTREST = rdoBasic.Text;
                }
                if (rdoPro.Checked == true)
                {
                    objLIBtblmstContact.INTREST = rdoPro.Text;
                }
                tp.MessagePacket = objLIBtblmstContact;
                tp = objDALtblmstContact.InserttblmstContact(tp);

                if (tp.MessageId > -1)
                {
                    string[] strOutParamValues = (string[])tp.MessageResultset;
                }
            }
            catch (Exception ex)
            {
                MyCLS.clsHandleException.HandleEx(ex, System.Reflection.MethodBase.GetCurrentMethod().ToString(), true);
            }
            try
            {
                DALCommon cmn     = new DALCommon();
                string    strBody = cmn.prcFindInFile(Server.MapPath("sendmail.html").ToString(), "#name#", txtname.Text);
                //strBody = cmn.prcFindInString(strBody, "#VerificationUrl#", "http://localhost:56941/EmailConfirmation.aspx?ID=" + userInfo.ProviderUserKey.ToString());


                // strBody = "Hi " + txtname.Text + ", You or someone with your id signed up at this site, Your new account is almost ready, but before you can login you need to confirm your email id by visitng the link below: http://localhost:56941/EmailConfirmation.aspx?ID=" + userInfo.ProviderUserKey.ToString() + " Once you have visited the verification URL, your account will be activated. If you have any problems or questions, please reply to this email. Thanks!";
                cmn.SendHtmlFormattedEmail(txtEmail.Text, "Contact  inQsights", strBody);
                ClientScript.RegisterStartupScript(GetType(), "Save", "<SCRIPT LANGUAGE='javascript'>javascript:alert('Thank you for showing your intrest!');</script>");
            }
            catch (HttpException ex)
            {
            }
        }