protected void btnSignet_Click(object sender, EventArgs e) { CorporationHelper corHelper = new CorporationHelper(); if (corHelper.IsExistsSameCorp(txtCorpname.Text) && ddlRegion.Visible) { ScriptManager.RegisterStartupScript(btnSave, GetType(), "warning", "javascript:$.ligerDialog.warn('相同的单位名称已经存在,请重新填写!');", true); } else { CorporationInfo corInfo = new CorporationInfo(lblCorpId.Text); if (string.IsNullOrEmpty(CorporationID) && EditType == "E") { if (corHelper.IsExists(lblCorpId.Text)) { corInfo.CorpID = corHelper.GetCorporationID(ddlRegion.SelectedValue); } else { corInfo.CorpID = lblCorpId.Text; } } corInfo.CorpName = txtCorpname.Text; corInfo.AliasName = txtAliasName.Text; corInfo.FullName = txtEnglishName.Text; corInfo.CorpClass = ddlType.SelectedValue; corInfo.CorpType = ddlCategory.SelectedValue; corInfo.TaxNo = txtTaxNo.Text.Trim(); corInfo.BizNo = ddlCerType.SelectedValue; corInfo.OtherNo = lblQueryCode.Text; corInfo.PassWord = lblUserCode.Text; corInfo.BossName = txtBoss.Text; corInfo.BossIDCard = txtIDCard.Text; corInfo.Linker = txtLinker.Text; corInfo.LinkWay = txtLinkWay.Text; corInfo.PostCode = txtPostCode.Text; corInfo.Memo = txtMemo.Text; corInfo.Address = txtAddress.Text; corInfo.AreaID = ddlArea.SelectedValue; corInfo.CreateDate = DateTime.Now; corInfo.Status = "A"; corInfo.AccountNo = txtOrgnization.Text; corInfo.Creator = SysContext.CurrentUserName; corInfo.Region = ddlRegion.SelectedValue; if (ddlRegion.Visible) { corInfo.RegionName = ddlRegion.SelectedItem.Text; } corHelper.UpdateCorporation(corInfo); Session["SignetList"] = null; Session["Corporation"] = null; ScriptManager.RegisterStartupScript(btnSave, GetType(), "warning", "javascript:AddSignetDialog('" + corInfo.CorpID + "');", true); } }
public static AjaxResult ExistsSameContent(string content) { CorporationHelper helper = new CorporationHelper(); if (helper.IsExistsSameCorp(content)) { return(AjaxResult.Error("相同的单位名称已经存在,请重新填写!")); } else { return(AjaxResult.Success()); } }