protected void Page_Load(object sender, EventArgs e) { UImageUpload1.ImageUploaded += new UserControls_Common_uImageUpload.ImageUploadedDelegate(UImageUpload1_ImageUploaded); UImageUpload1.RaiseEvents = true; if (!IsPostBack) { ((ImageButton)UImageUpload1.FindControl("btnSubmit")).Visible = false; UImageUpload1.ImageSaveType = PIKCV.COM.Enumerations.ImageSaveType.Company; imgCompanyDetailLogo.Attributes.Add("onerror", "this.src='" + this.Config(PIKCV.COM.EnumUtil.Config.CompanyImagePath) + "0.png';"); DataBindHelper.BindListbox(ref lbSectors, this.cmbSectors, "SectorName", "SectorID", ""); imgAddToListSector.Style.Add("cursor", "pointer"); imgRemoveToListSector.Style.Add("cursor", "pointer"); imgAddToListSector.Attributes.Add("onclick", "SwapItem('" + lbSectors.ClientID + "','" + lbSelectedSectors.ClientID + "', ' ')"); imgRemoveToListSector.Attributes.Add("onclick", "SwapItem('" + lbSelectedSectors.ClientID + "','" + lbSectors.ClientID + "', ' ')"); imgContinue.Attributes.Add("onmousedown", "return SelectAllListBox('" + lbSelectedSectors.ClientID + "')"); if (this.smIsLogin == true) { FillCompanyInfo(); ltlEditUser.Visible = true; ltlDescriptionEdit.Visible = true; ltlDescription.Visible = false; ltlNewUser.Visible = false; pnlCompanyDetails.Visible = true; pnlCompanyInformation.Visible = false; } else { ltlEditUser.Visible = false; ltlNewUser.Visible = true; ltlDescriptionEdit.Visible = false; ltlDescription.Visible = true; pnlCompanyDetails.Visible = false; pnlCompanyInformation.Visible = true; } } }
protected void imgContinue_Click(object sender, ImageClickEventArgs e) { int SaveCompanyID = 0; string ErrMsg = String.Empty; string PhoneNumber = txtPhoneNumber.Text.Trim(); string FaxNumber = txtFaxNumber.Text.Trim(); string Email = txtEMail.Text.Trim(); ArrayList arrSelectedSectors = new ArrayList(); if (Request.Form[lbSelectedSectors.UniqueID] != null) { arrSelectedSectors.AddRange(Request.Form[lbSelectedSectors.UniqueID].Split(',')); } PIKCV.BUS.Company objCompany = new PIKCV.BUS.Company(); if (this.smIsLogin == true) { SaveCompanyID = objCompany.UpdateCompanyInfo(this.smCompanyID, arrSelectedSectors, txtCompanyName.Text, txtCompanyDescription.Text, Convert.ToInt32(txtNumberOfWorkers.Text), txtContactName.Text, txtContactLastName.Text, txtPhoneNumber.Text, txtFaxNumber.Text, txtEMail.Text, this.PhotoFileName, txtSecretQuestion.Text, txtSecretAnswer.Text); //imgCompanyLogo.ImageUrl = "~/" + this.Config(PIKCV.COM.EnumUtil.Config.CompanyImagePath) + this.PhotoFileName; if (SaveCompanyID > 0) { pnlSuccess.Visible = true; ltlSuccess.Text = "Üyelik bilgileriniz baþarýyla deðiþtirilmiþtir"; pnlError.Visible = false; this.smCompanyName = txtCompanyName.Text; this.smFirstName = txtContactName.Text; this.smLastName = txtContactLastName.Text; } else { pnlError.Visible = true; ltlError.Text = "Üyelik bilgileri deðiþtirilirken bir hata oluþtu lütfen tekrar deneyin"; pnlSuccess.Visible = false; } } else { int CompanyUserExistance = objCompany.CompanyExistanceControlForEmail(txtEMail.Text); if (CompanyUserExistance == 0) { SaveCompanyID = objCompany.InsertCompanyInfo(arrSelectedSectors, txtCompanyName.Text, txtCompanyDescription.Text, Convert.ToInt32(txtNumberOfWorkers.Text), txtContactName.Text, txtContactLastName.Text, PhoneNumber, FaxNumber, Email, txtSecretQuestion.Text, txtSecretAnswer.Text); if (SaveCompanyID > 0) { this.smCompanyID = SaveCompanyID; UImageUpload1.SendFile(); this.smCompanyID = 0; string ActivationCode = PIKCV.COM.Util.CreateActivationNumber(SaveCompanyID); if (objCompany.SaveActivation(SaveCompanyID, ActivationCode)) { //Aktivasyon Linkini Mail Yolla if (MailTemplates.Send_Tmp_ActivationCompany(MailTemplates.ActivationCompany, ActivationCode, SaveCompanyID, txtContactName.Text, txtContactLastName.Text, Email)) { //** //**this.LoginControl(txtEMail.Text, txtPassword.Text, String.Empty); this.GoToFeedback(PIKCV.COM.EnumDB.ErrorTypes.SaveCompany); } //** else { //** pnlError.Visible = true; ltlError.Text = "Üyelik iþlemi sýrasýnda bir hata oluþtu. Lütfen tekrar deneyin."; pnlSuccess.Visible = false; } //** } //pnlSuccess.Visible = true; //ltlSuccess.Text = "Üyelik isteðiniz bize ulaþmýþtýr. Üyeliðiniz incelenip en yakýn zamanda kullanýcý adý ve þifreniz e-posta adresinize gönderilecektir."; //pnlError.Visible = false; } else { pnlError.Visible = true; ltlError.Text = "Üyelik iþlemi sýrasýnda bir hata oluþtu. Lütfen tekrar deneyin."; pnlSuccess.Visible = false; } } else if (CompanyUserExistance > 0) { pnlError.Visible = true; ltlError.Text = "Bu email adresiyle daha önceden kayýt yapýlmýþtýr. Bir email adresiyle sadece bir kayýt yapýlabilir."; pnlSuccess.Visible = false; } else if (CompanyUserExistance == -1) { pnlError.Visible = true; ltlError.Text = "Üyelik iþlemi sýrasýnda bir hata oluþtu. Lütfen tekrar deneyin."; pnlSuccess.Visible = false; } } }