public void CompanyInsert(Company objCompany)
        {
            try
            {
                objEmailCampDataContext = new EmailCampDataContext();

                var Insert = (from cde in objEmailCampDataContext.spCompany_AllActions(objCompany.PK_CompanyID ,objCompany.Company_Name ,objCompany.Email_id ,objCompany.ContactNo ,objCompany.Addressline1 ,objCompany.City1 ,objCompany.State1 ,objCompany.Country1 ,objCompany.CreatedBy ,objCompany.CreatedOn ,objCompany.UpdatedBy ,objCompany.UpdatedOn, "i")
                              select cde).ToList();

                Insert = null;
                objCompany = null;
                objEmailCampDataContext = null;
            }
            catch (Exception ex)
            {
                ex.ToString();
            }
        }
        public void CompanyDelete(int Companyid)
        {
            try
            {
                objEmailCampDataContext = new EmailCampDataContext();

                var Delete = (from cde in objEmailCampDataContext.spCompany_AllActions(Companyid, null, null, null, null, null, null, null, null, null, null, null, "d")
                              select cde).ToList();

                Delete = null;
                objCompany = null;
                objEmailCampDataContext = null;
            }
            catch (Exception ex)
            {
                ex.ToString();
            }
        }
 public void AccessUpdateCompany(Company objCompany1)
 {
     objDL_CompanyDetails.CompanyUpdate(objCompany1);
 }
 public void AccessInsertCompany(Company objCompany1)
 {
     objDL_CompanyDetails.CompanyInsert(objCompany1);
 }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                int status = objBL_UserLoginDetails.AccessVerifyUserEmailidExist(txtEmail.Value.ToString().Trim());

                if (status == 0)
                {
                    objCompany = new Company();
                    objCompany.Email_id = txtEmail.Value.ToString().Trim();
                    objCompany.Company_Name = txtCompanyName.Value.ToString().Trim();
                    objCompany.ContactNo = txtContactNumber.Value.ToString().Trim();
                    objCompany.CreatedOn = DateTime.Now;
                    objBL_CompanyDetails.AccessInsertCompany(objCompany);

                    objUserDetails = new UserDetails();
                    int CompanyID = Convert.ToInt32(objBL_CompanyDetails.ReturnCompanyMaxID());

                    if (objUserDetails.FK_CompanyID != 0)
                        objUserDetails.FK_CompanyID = CompanyID;

                    objUserDetails.UserName = txtUserName.Value.ToString().Trim();
                    objUserDetails.UserPassword = txtPassword.Value.ToString().Trim();
                    objUserDetails.Email_id = txtEmail.Value.ToString().Trim();
                    objUserDetails.ContactNo = txtContactNumber.Value.ToString().Trim();
                    objUserDetails.IsActive = true;
                    objUserDetails.CreatedOn = DateTime.Now;
                    objUserDetails.MemberSince = DateTime.Now;
                    objUserDetails.AccountActivated = false;

                    if (chkNewsLetter.Checked)
                        objUserDetails.SendNewsLetter = true;
                    else
                        objUserDetails.SendNewsLetter = false;

                    objUserDetails.UserType = 1;
                    objBL_UserLoginDetails.AccessInsertUserLogin(objUserDetails);
                    int loginid = objBL_UserLoginDetails.ReturnUserLoginMaxID();

                    //------Sending confirmtion Email of account created to client.-----
                    string sEmailId = "*****@*****.**";
                    //subject
                    string sSubject = "Aryvart Email Campaign: Please verify your email address.";

                    ////sending emails to client
                    string strReceiverName = "ADMIN";
                    string EncryptQry = "id=" + objCryptographicHashCode.EncryptPlainTextToCipherText(loginid.ToString()) + "'";
                    //string EncryptQry = "id=" + objBL_UserLoginDetails.ReturnUserLoginMaxID().ToString() + "'";

                    //string strDetails = "<table border='1' cellspacing='0' cellpadding='0'><tr><td width='152' valign='middle'><span style='font-size:14px;color:#aa483c'>&nbsp;File Name:</span></td><td width='200' valign='middle'><span style='font-size:14px;color:#aa483c'>&nbsp;" + sFileName + ".</span></td></tr><tr><td width='152' valign='middle'><span style='font-size:14px;color:#aa483c'>&nbsp;Uploaded on:</span></td><td width='200' valign='middle'><span style='font-size:14px;color:#aa483c'>&nbsp;" + DateTime.Now.ToString() + "." + "</span></td></tr></table>";
                    //string body = MailTemplate.MailCoUpldHTML(MailTemplate.GetEmailTemplate("CoUpldEmail.html").Replace("<CompanyName>", sCompanyName).Replace("<Details>", strDetails).Replace("<ReceiverName>", strReceiverName).Replace("<ClientName>", sClientName));
                    //objMailTemplate.fnSendMailToClientForCoUpld(body, "*****@*****.**", sSubject, sEmailId);
                    string body = MailTemplate.MailAccountActivate(EncryptQry);
                    objMailTemplate.fnSendMailToClientForCoUpld(body, txtEmail.Value.ToString().Trim(), sSubject, sEmailId);

                    //---------End---------------------
                    ClientScript.RegisterStartupScript(Page.GetType(), "mykey1", "Clearuserinput1();", true);
                }
                else if (status == 1)
                {
                    lblerrormsg.Text = "<span style='color:#c85305;font-size:12px;'>Emailid already exist use some other emailid or </span> <a href='UserLogin.aspx' style='font-size:12px; color: #00acec;'>Log in using your credential</a>.";
                }

            }
            catch (Exception ex)
            {
                New_EmailCampaign.App_Code.GlobalFunction.StoreLog("FreeAccountSignUp.aspx:btnSubmit_Click() - " + ex.Message);
            }
        }
        public List<Company> CompanySelectbasedonid(int id)
        {
            objEmailCampDataContext = new EmailCampDataContext();
            lstCompany = new List<Company>();

            var Select = (from cde in objEmailCampDataContext.spCompany_AllActions(id, null, null, null, null, null, null, null, null, null, null, null, "s")
                          select cde).ToList();

            if (Select.Count > 0)
            {
                lstCompany = new List<Company>();
                foreach (var item in Select)
                {
                    objCompany = new Company();
                    objCompany.Addressline1 = Convert.ToString(item.addressline1);
                    objCompany.City1 = Convert.ToString(item.city1);
                    objCompany.CreatedBy = Convert.ToInt16(item.CreatedBy);
                    objCompany.CreatedOn = Convert.ToDateTime(item.CreatedOn);
                    objCompany.UpdatedBy = Convert.ToInt16(item.UpdatedBy);
                    objCompany.UpdatedOn = Convert.ToDateTime(item.UpdatedOn);
                    objCompany.Company_Name = item.Company_Name;
                    objCompany.ContactNo = item.ContactNo;
                    objCompany.Country1 = item.country1;
                    objCompany.PK_CompanyID = item.PK_CompanyID;
                    objCompany.Email_id = item.email_id;
                    objCompany.State1 = item.state1;
                    lstCompany.Add(objCompany);
                }
            }
            objEmailCampDataContext = null;
            objCompany = null;
            return lstCompany;
        }