protected void lbNewsLetter_Click(object sender, EventArgs e) { pnlSuccess.Visible = false; if (Page.IsValid) { //if (IsValidUser()) //{ if (IsFirstTimeEmail()) { using (VaranegarEntities db = new VaranegarEntities()) { NewsLetters nlEnter = new NewsLetters(); nlEnter.email = txtNewsletter.Text; nlEnter.IsDelete = false; nlEnter.OS = FindUserInfo.UserOS(); nlEnter.SubmitIP = Request.UserHostAddress; System.Web.HttpBrowserCapabilities browser = Request.Browser; nlEnter.Browser = browser.Type; nlEnter.SubmitDate = DateTime.Now; db.NewsLetters.Add(nlEnter); db.SaveChanges(); pnlSuccess.Visible = true; } } //} //else //{ // pnlCaptcha.Visible = true; // imgCaptcha.ImageUrl = "~/Captcha/CaptchaGeneratorForNewsletter.aspx"; // ViewState["cp"] = "1"; //} } }
public void Log_ErrorInsert(string searchQuery) { using (VaranegarEntities db = new VaranegarEntities()) { Log_SearchQueries leIn = new Log_SearchQueries(); leIn.SearchQuery = searchQuery; leIn.SearchDate = DateTime.Now; leIn.SearchIp = Request.UserHostAddress; leIn.OS = FindUserInfo.UserOS(); if (Request.UrlReferrer != null) { leIn.RefrallPage = Request.UrlReferrer.ToString(); } else { leIn.RefrallPage = "ورود مستقیم"; } System.Web.HttpBrowserCapabilities browser = Request.Browser; leIn.browser = browser.Type; db.Log_SearchQueries.Add(leIn); db.SaveChanges(); } }
public void SubmitData() { if (Page.IsValid) { using (VaranegarEntities db = new VaranegarEntities()) { DemoRequests drEnter = new DemoRequests(); drEnter.Name = txtName.Text; drEnter.CompanyName = txtCompanyName.Text; drEnter.Post = txtPost.Text; drEnter.Field = txtField.Text; drEnter.Phone = txtPost.Text; drEnter.Mobile = txtMobile.Text; drEnter.Email = txtEmail.Text; drEnter.fk_FamiliarMethodID = Convert.ToInt32(ddlfamiliar.SelectedValue); drEnter.FinalDesc = txtDesc.Text; drEnter.IsDelete = false; drEnter.Ip = Request.UserHostName; System.Web.HttpBrowserCapabilities browser = Request.Browser; drEnter.Browser = browser.Type; drEnter.Os = FindUserInfo.UserOS(); drEnter.RegisterDate = DateTime.Now; drEnter.IsVisited = false; drEnter.fk_RecieverID = Convert.ToInt32(ddlProduct.SelectedValue); db.DemoRequests.Add(drEnter); db.SaveChanges(); string emailBody = @"<table><tr><td>تاریخ</td><td>" + drEnter.RegisterDate + @"</td></tr> <tr><td>Ip</td><td>" + drEnter.Ip + @"</td></tr> <tr><td>نام</td><td>" + drEnter.Name + @"</td></tr> <tr><td>نام شرکت / سازمان</td><td>" + drEnter.CompanyName + @"</td></tr> <tr><td>پست</td><td>" + drEnter.Post + @"</td></tr> <tr><td>زمینه فعالیت</td><td>" + drEnter.Field + @"</td></tr> <tr><td>تلفن ثابت</td><td>" + drEnter.Phone + @"</td></tr> <tr><td>نحوه آشنایی با ورانگر</td><td>" + ddlfamiliar.SelectedItem.Text + @"</td></tr> <tr><td>نام نرم افزار</td><td>" + ddlProduct.SelectedItem.Text + @"</td></tr> <tr><td>ایمیل</td><td>" + drEnter.Email + @"</td></tr> <tr><td>تلفن همراه</td><td>" + drEnter.Mobile + @"</td></tr> <tr><td>توضیحات</td><td>" + drEnter.FinalDesc + @"</td></tr></table>"; List <string> emailList = SendEmail.ReturnEmailList(Convert.ToInt32(ddlProduct.SelectedValue)); SendEmail.Send(emailList, "درخواست دمو", emailBody); SendEmail.SendToUser_User(txtEmail.Text, "درخواست دمو"); } } }
public void SubmitData() { if (Page.IsValid) { using (VaranegarEntities db = new VaranegarEntities()) { SeminarRequests srEnter = new SeminarRequests(); srEnter.Name = txtName.Text; srEnter.CompanyName = txtCompany.Text; srEnter.Phone = txtPhone.Text; srEnter.Mobile = txtMobile.Text; srEnter.Email = txtEmail.Text; srEnter.IsDelete = false; srEnter.Ip = Request.UserHostName; srEnter.NationalId = txtNationalId.Text; srEnter.CustomerCode = txtCustomerCode.Text; System.Web.HttpBrowserCapabilities browser = Request.Browser; srEnter.Browser = browser.Type; srEnter.Os = FindUserInfo.UserOS(); srEnter.RegisterDate = DateTime.Now; db.SeminarRequests.Add(srEnter); db.SaveChanges(); string emailBody = @"<table><tr><td>تاریخ</td><td>" + srEnter.RegisterDate + @"</td></tr> <tr><td>Ip</td><td>" + srEnter.Ip + @"</td></tr> <tr><td>نام</td><td>" + srEnter.Name + @"</td></tr> <tr><td>نام شرکت / سازمان</td><td>" + srEnter.CompanyName + @"</td></tr> <tr><td>تلفن ثابت</td><td>" + srEnter.Phone + @"</td></tr> <tr><td>ایمیل</td><td>" + srEnter.Email + @"</td></tr> <tr><td>تلفن همراه</td><td>" + srEnter.Mobile + @"</td></tr> <tr><td>کدملی</td><td>" + srEnter.NationalId + @"</td></tr> <tr><td>شماره مشتری</td><td>" + srEnter.CustomerCode + @"</td></tr></table>"; //List<string> emailList = SendEmail.ReturnEmailList(Convert.ToInt32(ddlProduct.SelectedValue)); List <string> emailList = new List <string>(); emailList.Add("*****@*****.**"); SendEmail.Send(emailList, "ثبت نام در سمینار و برنامه های آموزشی ", emailBody); SendEmail.SendToUser_User(txtEmail.Text, "ثبت نام در سمینار و برنامه های آموزشی ورانگر"); } } }
public void InsertIntoTable() { using (VaranegarEntities db = new VaranegarEntities()) { CareerForm cfEnter = new CareerForm(); //FirstStep cfEnter.careerID = Guid.NewGuid(); cfEnter.FirstName = txtFirstName.Text; cfEnter.LastName = txtLastName.Text; cfEnter.FatherName = txtFathedName.Text; cfEnter.NationalSHCode = txtNationalSHID.Text; cfEnter.NationalCode = txtNationalID.Text; cfEnter.birthDate = returnBirthDate(); cfEnter.BirthPlace = txtBirthPlace.Text; cfEnter.Email = txtEmail.Text; cfEnter.Phone = txtPhone.Text; cfEnter.Mobile = txtMobile.Text; cfEnter.marriage = Convert.ToInt32(ddlMarriage.SelectedValue); cfEnter.childrenNumb = txtChildren.Text; cfEnter.HomeStatus = Convert.ToInt32(ddlHome.SelectedValue); cfEnter.IsInsurance = ReturnBooleanStatus(ddlInsurance); cfEnter.MilitaryStatus = Convert.ToInt32(ddlMilitary.SelectedValue); cfEnter.Address = txtAddress.Text; //SecondStep cfEnter.ExpertOn = Convert.ToInt32(ddlExpert.SelectedValue); cfEnter.languagesRate = Convert.ToInt32(ddlLang.SelectedValue); cfEnter.degree = Convert.ToInt32(ddlDegree.SelectedValue); cfEnter.familiarIndustry = Convert.ToInt32(ddlIntroduce.SelectedValue); cfEnter.howtoFind = Convert.ToInt32(ddlIntroducrVaranegar.SelectedValue); cfEnter.major = txtMajor.Text; cfEnter.History = txtHistory.Text; cfEnter.Software = txtSw.Text; cfEnter.OtherExpertTitle = txtOtherExpert.Text; cfEnter.OtherFamiliar = txtOhetFamiliar.Text; //ThirdStep cfEnter.OvertimeWork = ReturnBooleanStatus(ddlOvertimeWork); cfEnter.NightWork = ReturnBooleanStatus(ddlNightWork); cfEnter.missionWork = ReturnBooleanStatus(ddlmissionWork); cfEnter.WeekendWork = ReturnBooleanStatus(ddlWeekendWork); cfEnter.Surgery = ReturnBooleanStatus(ddlSurgery); cfEnter.Conviction = ReturnBooleanStatus(ddlConviction); cfEnter.Smoking = ReturnBooleanStatus(ddlSmoking); cfEnter.Warranty = ReturnBooleanStatus(ddlWarranty); //ForthStep string new_filename = string.Empty; if (fuResume.HasFile) { string original_filename = Path.GetFileName(fuResume.PostedFile.FileName); new_filename = Guid.NewGuid().ToString() + Path.GetExtension(original_filename); string new_filepath = Server.MapPath("~/Uploads/Resume/" + new_filename); fuResume.PostedFile.SaveAs(new_filepath); } cfEnter.WorkingType = Convert.ToInt32(ddlWorkingType.SelectedValue); cfEnter.sallary = txtSallary.Text; cfEnter.StartDate = txtStartDate.Text; cfEnter.resumeFile = new_filename; cfEnter.FinalDesc = txtDesc.Text; cfEnter.IsVisited = false; cfEnter.RegisterDate = DateTime.Now; cfEnter.Os = FindUserInfo.UserOS(); cfEnter.Ip = Request.UserHostAddress; System.Web.HttpBrowserCapabilities browser = Request.Browser; cfEnter.Browser = browser.Type; cfEnter.IsDelete = false; db.CareerForm.Add(cfEnter); db.SaveChanges(); ScriptManager.RegisterStartupScript(this, GetType(), "PageScriptsuccess", "SuccessMessages();", true); ScriptManager.RegisterStartupScript(this, GetType(), "PageScriptGoTop", "$('html,body').animate({ 'scrollTop': 0 }, 1000);", true); pnlForm4.Visible = false; pnlSuccess.Visible = true; string resumeLink = null; if (!string.IsNullOrEmpty(new_filename)) { resumeLink = "<a href=/Uploads/Resume/" + new_filename + @">دانلود</a>"; } string emailBody = @"<table><tr><td>تاریخ</td><td>" + cfEnter.RegisterDate + @"</td></tr> <tr><td>Ip</td><td>" + cfEnter.Ip + @"</td></tr> <tr><td>نام</td><td>" + cfEnter.FirstName + @"</td></tr> <tr><td>نام خانوادگی</td><td>" + cfEnter.LastName + @"</td></tr> <tr><td>نام پدر</td><td>" + cfEnter.FatherName + @"</td></tr> <tr><td>شماره شناسنامه</td><td>" + cfEnter.NationalSHCode + @"</td></tr> <tr><td>کد ملی</td><td>" + cfEnter.NationalCode + @"</td></tr> <tr><td>تاریخ تولد</td><td>" + cfEnter.birthDate + @"</td></tr> <tr><td>محل تولد</td><td>" + cfEnter.BirthPlace + @"</td></tr> <tr><td>ایمیل</td><td>" + cfEnter.Email + @"</td></tr> <tr><td>تلفن</td><td>" + cfEnter.Phone + @"</td></tr> <tr><td>موبایل</td><td>" + cfEnter.Mobile + @"</td></tr> <tr><td>وضعیت تاهل</td><td>" + ddlMarriage.SelectedItem.Text + @"</td></tr> <tr><td>تعداد فرزندان</td><td>" + cfEnter.childrenNumb + @"</td></tr> <tr><td>وضعیت مسکن</td><td>" + ddlHome.SelectedItem.Text + @"</td></tr> <tr><td>بیمه تامین اجتماعی هستید؟</td><td>" + ddlInsurance.SelectedItem.Text + @"</td></tr> <tr><td>وضعیت نظام وظیفه؟</td><td>" + ddlMilitary.SelectedItem.Text + @"</td></tr> <tr><td>آدرس</td><td>" + cfEnter.Address + @"</td></tr> </table> <hr /> <table><tr><td>تخصص</td><td>" + ddlExpert.SelectedItem.Text + @"</td></tr> <tr><td>تسلط به زبان انگلیسی</td><td>" + ddlLang.SelectedItem.Text + @"</td></tr> <tr><td>مقطع تحصیلی</td><td>" + ddlDegree.SelectedItem.Text + @"</td></tr> <tr><td>میزان آشنایی با صنعت پخش</td><td>" + ddlIntroduce.SelectedItem.Text + @"</td></tr> <tr><td>چگونه با ورانگر آشنا شدید</td><td>" + ddlIntroducrVaranegar.SelectedItem.Text + @"</td></tr> <tr><td>رشته تحصیلی</td><td>" + cfEnter.major + @"</td></tr> <tr><td>سوابق کاری</td><td>" + cfEnter.History + @"</td></tr> <tr><td>با چه نرم افزارهایی آشنایی دارید</td><td>" + cfEnter.Software + @"</td></tr> </table> <hr /> <table><tr><td>مايليد در زمان اضافه كار، كار كنيد؟</td><td>" + ddlOvertimeWork.SelectedItem.Text + @"</td></tr> <tr><td>مايليد در شيفت شب كار كنيد؟</td><td>" + ddlNightWork.SelectedItem.Text + @"</td></tr> <tr><td>مايليد به ماموريتهاي داخل كشور برويد؟</td><td>" + ddlmissionWork.SelectedItem.Text + @"</td></tr> <tr><td>مايليد در تعطيلات آخر هفته فعاليت داشته باشيد؟</td><td>" + ddlWeekendWork.SelectedItem.Text + @"</td></tr> <tr><td>آيا نقص عضو يا عمل جراحي يا بيماري دارید؟</td><td>" + ddlSurgery.SelectedItem.Text + @"</td></tr> <tr><td>آيا سابقه محكوميت كيفري داشتهايد؟</td><td>" + ddlConviction.SelectedItem.Text + @"</td></tr> <tr><td>آيا دخانيات مصرفي ميكنيد؟</td><td>" + ddlSmoking.SelectedItem.Text + @"</td></tr> <tr><td>آيا ضامن براي ضمانت كار خود داريد؟</td><td>" + ddlWarranty.SelectedItem.Text + @"</td></tr> </table> <hr /> <table><tr><td>نوع همکاری</td><td>" + ddlWorkingType.SelectedItem.Text + @"</td></tr> <tr><td>ميزان حقوق درخواستي (ريال)</td><td>" + cfEnter.sallary + @"</td></tr> <tr><td>تاریخ شروع همکاری</td><td>" + cfEnter.StartDate + @"</td></tr> <tr><td>توضیحات</td><td>" + cfEnter.FinalDesc + @"</td></tr> <tr><td>رزومه</td><td>" + resumeLink + @"</td></tr> </table>"; List <string> emailList = SendEmail.ReturnEmailList(2); SendEmail.Send(emailList, "پیوستن به ما", emailBody); SendEmail.SendToUser_User(txtEmail.Text, "پیوستن به ما"); } }
public void CreateAgentReq() { try { using (VaranegarEntities db = new VaranegarEntities()) { AgentQuestionaries agent = new AgentQuestionaries(); agent.Id = Guid.NewGuid(); agent.FullName = txtName.Text; agent.NationalCode = txtNationalCode.Text; agent.BirthCerId = txtBirthCerId.Text; agent.BirthPlace = txtBirthPlace.Text; agent.fk_CityId = Convert.ToInt32(ddlCity.SelectedValue); agent.Phone = txtHomePhone.Text; agent.Mobile = txtMobile.Text; agent.Email = txtEmail.Text; agent.PostalCode = txtPostal.Text; agent.HomeAddress = txtHomeAddress.Text; if (!string.IsNullOrEmpty(txtCompanyName.Text)) { agent.IsCompany = true; } agent.CompanyName = txtCompanyName.Text; agent.CompanyPhone = txtCompanyPhone.Text; agent.CompanyOwnership = ddlOwnership.SelectedItem.Text; agent.CompanyAddress = txtCompanyAddress.Text; agent.CompanyPostalCode = txtPostalCode.Text; agent.CompanyArea = txtarea.Text; agent.CompanyEmployeeNumber = txtEmployeNumb.Text; agent.IsSellSoftwar = returnBoolean(ddlIsAgent.SelectedValue); agent.SellSoftwareDesc = txtSoftwareBefore.Text; agent.IsInsurance = returnBoolean(ddlInsurance.SelectedValue); agent.IsAgent = returnBoolean(ddlIsAgent.SelectedValue); agent.IsAgentDesc = txtIsAgent.Text; agent.IsHighSpeedInternet = returnBoolean(ddlInternet.SelectedValue); agent.IsCommercialPlace = returnBoolean(ddlCommercialPlace.SelectedValue); agent.IsCommercialPlaceDesc = txtCommercialPlace.Text; agent.VaranegarSoftwareIntroduce = ddlVaranegarSoftwareIntroduce.SelectedItem.Text; agent.HowKnowUs = ddlHowKnowUs.SelectedItem.Text; agent.ReasonForDo = txtReasonForDo.Text; agent.IsDelete = false; agent.Ip = Request.UserHostName; System.Web.HttpBrowserCapabilities browser = Request.Browser; agent.Browser = browser.Type; agent.Os = FindUserInfo.UserOS(); agent.RegisterDate = DateTime.Now; db.AgentQuestionaries.Add(agent); db.SaveChanges(); if (!string.IsNullOrEmpty(txtPlaceName1.Text)) { CreateAgentPreviousJob(agent.Id, txtPlaceName1.Text, txtIndustryType1.Text, Convert.ToInt32(txtStartDate1.Text), Convert.ToInt32(txtEndDate1.Text), txtPost1.Text, txtdesc1.Text); } if (!string.IsNullOrEmpty(txtPlaceName2.Text)) { CreateAgentPreviousJob(agent.Id, txtPlaceName2.Text, txtIndustryType2.Text, Convert.ToInt32(txtStartDate2.Text), Convert.ToInt32(txtEndDate2.Text), txtPost2.Text, txtdesc2.Text); } if (!string.IsNullOrEmpty(txtPlaceName3.Text)) { CreateAgentPreviousJob(agent.Id, txtPlaceName3.Text, txtIndustryType3.Text, Convert.ToInt32(txtStartDate3.Text), Convert.ToInt32(txtEndDate3.Text), txtPost3.Text, txtdesc3.Text); } pnlSuccess.Visible = true; pnlError.Visible = false; string link = "https://www.varanegar.com/showagentinfo.aspx?type=5e71e865-c73a-4094-b4cd-328973b479c4&&id=" + agent.Id; string emailBody = @"<table><tr><td>تاریخ</td><td>" + agent.RegisterDate + @"</td></tr> <tr><td>Ip</td><td>" + agent.Ip + @"</td></tr> <tr><td>نام</td><td>" + agent.FullName + @"</td></tr></table> <br/> کاربر گرامی یک درخواست نمایندگی در وب سایت ثبت گردیده است. جهت مشاهده اطلاعات این درخواست بر روی لینک زیر کلیک نمایید. <br/> <a href='" + link + "'>مشاهده درخواست</a>"; List <string> emailList = SendEmail.ReturnEmailList(15); SendEmail.Send(emailList, "درخواست نمیاندگی", emailBody); } } catch (Exception e) { pnlSuccess.Visible = false; pnlError.Visible = true; } }