private void BtnInsertUpdate_Click(object sender, EventArgs e) { try { if (DropDownItemName.SelectedIndex <= 0) { messageShow.singlemsgtext("Please select the Item Name."); DropDownItemName.Focus(); return; } if (DropDownProductName.SelectedIndex <= 0) { messageShow.singlemsgtext("Please select the Product Name."); DropDownProductName.Focus(); return; } if (string.IsNullOrEmpty(TxtBrandName.Text.ToString())) { messageShow.singlemsgtext("Brand name should not be empty"); TxtBrandName.Focus(); return; } SelectedProductCode = Convert.ToInt32(((KeyValuePair <string, string>)DropDownProductName.SelectedItem).Key.ToString()); var brand_master = new BrandMaster { BrandName = TxtBrandName.Text.ToString(), ProductCode = SelectedProductCode, BrandCode = BrandCode, OperationType = BtnInsertUpdate.Text.ToString() == "Save" ? 1 : 2 }; int id = _instanceRepository.InsertUpdateDeleteBrandMaster(brand_master); if (id >= 1) { messageShow.singlemsgtext(brand_master.OperationType == 1 ? "New Brand added successfully" : "Brand updated successfully"); brand_master.BrandName = ""; ResetAllControls(); } else if (id == -1) { messageShow.singlemsgtext("The brand name already exists, please try another name!"); } else { messageShow.singlemsgtext("Error in Brand insert/update"); } } catch (Exception _exception) { CmC.InsertException(_exception); messageShow.singlemsgtext(CmC.ExceptionErrorMessage); } }
protected void BtnBrandAdd_Click(object sender, EventArgs e) { using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["MyWebsiteDB"].ConnectionString)) { con.Open(); SqlCommand cmd = new SqlCommand("Insert into Tbl_Brands(Name)Values('" + TxtBrandName.Text + "')", con); cmd.ExecuteNonQuery(); Response.Write("<script> alert ('Marka Eklendi'); </script>"); TxtBrandName.Text = string.Empty; con.Close(); //LblMsg.Text = "Kayıt İşlemi Başarılı"; //LblMsg.ForeColor = System.Drawing.Color.Green; TxtBrandName.Focus(); BindBrandRepeater(); } }
void ReleaseDesignerOutlets() { if (AuthenticationPolicyOidTableView != null) { AuthenticationPolicyOidTableView.Dispose(); AuthenticationPolicyOidTableView = null; } if (BtnAuthenticationAddCertificate != null) { BtnAuthenticationAddCertificate.Dispose(); BtnAuthenticationAddCertificate = null; } if (BtnAuthenticationPolicyAddPolicyOid != null) { BtnAuthenticationPolicyAddPolicyOid.Dispose(); BtnAuthenticationPolicyAddPolicyOid = null; } if (BtnAuthenticationRemoveCertificate != null) { BtnAuthenticationRemoveCertificate.Dispose(); BtnAuthenticationRemoveCertificate = null; } if (BtnAuthenticationRemovePolicyOid != null) { BtnAuthenticationRemovePolicyOid.Dispose(); BtnAuthenticationRemovePolicyOid = null; } if (BtnClose != null) { BtnClose.Dispose(); BtnClose = null; } if (BtnSave != null) { BtnSave.Dispose(); BtnSave = null; } if (BtnUploadContent != null) { BtnUploadContent.Dispose(); BtnUploadContent = null; } if (CertificateTableView != null) { CertificateTableView.Dispose(); CertificateTableView = null; } if (ChkAuthentiationPolicyWindows != null) { ChkAuthentiationPolicyWindows.Dispose(); ChkAuthentiationPolicyWindows = null; } if (ChkAuthenticationCrlDistribution != null) { ChkAuthenticationCrlDistribution.Dispose(); ChkAuthenticationCrlDistribution = null; } if (ChkAuthenticationFailoverToCrl != null) { ChkAuthenticationFailoverToCrl.Dispose(); ChkAuthenticationFailoverToCrl = null; } if (ChkAuthenticationOcsp != null) { ChkAuthenticationOcsp.Dispose(); ChkAuthenticationOcsp = null; } if (ChkAuthenticationPolicyCertificate != null) { ChkAuthenticationPolicyCertificate.Dispose(); ChkAuthenticationPolicyCertificate = null; } if (ChkAuthenticationPolicyPassword != null) { ChkAuthenticationPolicyPassword.Dispose(); ChkAuthenticationPolicyPassword = null; } if (ChkAuthetnicationRevocationCheck != null) { ChkAuthetnicationRevocationCheck.Dispose(); ChkAuthetnicationRevocationCheck = null; } if (ChkDisableLogonBanner != null) { ChkDisableLogonBanner.Dispose(); ChkDisableLogonBanner = null; } if (ChkLogonBannerCheckbox != null) { ChkLogonBannerCheckbox.Dispose(); ChkLogonBannerCheckbox = null; } if (TxtAuthenticationOcspUrlOverride != null) { TxtAuthenticationOcspUrlOverride.Dispose(); TxtAuthenticationOcspUrlOverride = null; } if (TxtAuthenticationPolicyOid != null) { TxtAuthenticationPolicyOid.Dispose(); TxtAuthenticationPolicyOid = null; } if (TxtBrandLogonBanner != null) { TxtBrandLogonBanner.Dispose(); TxtBrandLogonBanner = null; } if (TxtBrandName != null) { TxtBrandName.Dispose(); TxtBrandName = null; } if (TxtCrlDistributionPointOverride != null) { TxtCrlDistributionPointOverride.Dispose(); TxtCrlDistributionPointOverride = null; } if (TxtHokMaxRefreshTime != null) { TxtHokMaxRefreshTime.Dispose(); TxtHokMaxRefreshTime = null; } if (TxtLockoutAutoUnlockINterval != null) { TxtLockoutAutoUnlockINterval.Dispose(); TxtLockoutAutoUnlockINterval = null; } if (TxtLockoutDescription != null) { TxtLockoutDescription.Dispose(); TxtLockoutDescription = null; } if (TxtLockoutFailedAttemptInterval != null) { TxtLockoutFailedAttemptInterval.Dispose(); TxtLockoutFailedAttemptInterval = null; } if (TxtLockoutMaxFailedAttempts != null) { TxtLockoutMaxFailedAttempts.Dispose(); TxtLockoutMaxFailedAttempts = null; } if (TxtLogonBannerTitle != null) { TxtLogonBannerTitle.Dispose(); TxtLogonBannerTitle = null; } if (TxtPasswordDescription != null) { TxtPasswordDescription.Dispose(); TxtPasswordDescription = null; } if (TxtPasswordLifetime != null) { TxtPasswordLifetime.Dispose(); TxtPasswordLifetime = null; } if (TxtPasswordMaxIdenticalAdjChars != null) { TxtPasswordMaxIdenticalAdjChars.Dispose(); TxtPasswordMaxIdenticalAdjChars = null; } if (TxtPasswordMaxLength != null) { TxtPasswordMaxLength.Dispose(); TxtPasswordMaxLength = null; } if (TxtPasswordMinAlphaCount != null) { TxtPasswordMinAlphaCount.Dispose(); TxtPasswordMinAlphaCount = null; } if (TxtPasswordMinLength != null) { TxtPasswordMinLength.Dispose(); TxtPasswordMinLength = null; } if (TxtPasswordMinLowercaseCount != null) { TxtPasswordMinLowercaseCount.Dispose(); TxtPasswordMinLowercaseCount = null; } if (TxtPasswordMinNumericCount != null) { TxtPasswordMinNumericCount.Dispose(); TxtPasswordMinNumericCount = null; } if (TxtPasswordMinSpecialCharCount != null) { TxtPasswordMinSpecialCharCount.Dispose(); TxtPasswordMinSpecialCharCount = null; } if (TxtPasswordMinUpperCaseCount != null) { TxtPasswordMinUpperCaseCount.Dispose(); TxtPasswordMinUpperCaseCount = null; } if (TxtPasswordProhibitedPreviousPasswordCount != null) { TxtPasswordProhibitedPreviousPasswordCount.Dispose(); TxtPasswordProhibitedPreviousPasswordCount = null; } if (TxtProviderDefault != null) { TxtProviderDefault.Dispose(); TxtProviderDefault = null; } if (TxtTokenBearerMaxLifetime != null) { TxtTokenBearerMaxLifetime.Dispose(); TxtTokenBearerMaxLifetime = null; } if (TxtTokenBearerMaxRefreshTime != null) { TxtTokenBearerMaxRefreshTime.Dispose(); TxtTokenBearerMaxRefreshTime = null; } if (TxtTokenClockTolerence != null) { TxtTokenClockTolerence.Dispose(); TxtTokenClockTolerence = null; } if (TxtTokenDelegateCount != null) { TxtTokenDelegateCount.Dispose(); TxtTokenDelegateCount = null; } if (TxtTokenHokMaxLifetime != null) { TxtTokenHokMaxLifetime.Dispose(); TxtTokenHokMaxLifetime = null; } if (TxtTokenRenewCount != null) { TxtTokenRenewCount.Dispose(); TxtTokenRenewCount = null; } if (DefaultProviderAlias != null) { DefaultProviderAlias.Dispose(); DefaultProviderAlias = null; } if (CbEnablePoviderSelection != null) { CbEnablePoviderSelection.Dispose(); CbEnablePoviderSelection = null; } }