Beispiel #1
0
        public static string GetCallbackScript(PublishmentSystemInfo publishmentSystemInfo, bool isSuccess, GovPublicApplyInfo applyInfo, string failureMessage)
        {
            var jsonAttributes = new NameValueCollection();

            jsonAttributes.Add("isSuccess", isSuccess.ToString().ToLower());
            if (isSuccess && applyInfo != null)
            {
                jsonAttributes.Add("isOrg", applyInfo.IsOrganization.ToString().ToLower());
                foreach (string attributeName in applyInfo.Attributes.Keys)
                {
                    jsonAttributes.Add(attributeName, applyInfo.GetExtendedAttribute(attributeName));
                }
                jsonAttributes.Add("replystate", EGovPublicApplyStateUtils.GetFrontText(applyInfo.State));
                if (applyInfo.State == EGovPublicApplyState.Checked || applyInfo.State == EGovPublicApplyState.Denied)
                {
                    var replyInfo = DataProvider.GovPublicApplyReplyDao.GetReplyInfoByApplyId(applyInfo.Id);
                    if (replyInfo != null)
                    {
                        jsonAttributes.Add("replycontent", replyInfo.Reply);
                        jsonAttributes.Add("replyfileurl", replyInfo.FileUrl);
                        jsonAttributes.Add("replydepartmentname", DepartmentManager.GetDepartmentName(replyInfo.DepartmentID));
                        jsonAttributes.Add("replyusername", replyInfo.UserName);
                        jsonAttributes.Add("replyadddate", DateUtils.GetDateAndTimeString(replyInfo.AddDate));
                    }
                }
            }
            jsonAttributes.Add("failureMessage", failureMessage);

            var jsonString = TranslateUtils.NameValueCollectionToJsonString(jsonAttributes);

            jsonString = StringUtils.ToJsString(jsonString);

            return($"<script>window.parent.stlQueryCallback('{jsonString}');</script>");
        }
Beispiel #2
0
        public static void SendSMSByGovPublicApply(PublishmentSystemInfo publishmentSystemInfo, TagStyleGovPublicApplyInfo tagStyleInfo, GovPublicApplyInfo applyInfo)
        {
            try
            {
                if (tagStyleInfo.IsSMS && !string.IsNullOrEmpty(tagStyleInfo.SMSTo))
                {
                    var mobiles         = tagStyleInfo.SMSTo.Split(';', ',');
                    var mobileArrayList = new ArrayList();

                    foreach (var mobile in mobiles)
                    {
                        if (!string.IsNullOrEmpty(mobile) && StringUtils.IsMobile(mobile) && !mobileArrayList.Contains(mobile))
                        {
                            mobileArrayList.Add(mobile);
                        }
                    }

                    var builder    = new StringBuilder(tagStyleInfo.SMSTitle);
                    var attributes = new NameValueCollection();
                    attributes["申请人类型"] = "公民";
                    if (TranslateUtils.ToBool(applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.IsOrganization)))
                    {
                        attributes["申请人类型"] = "法人/其他组织";
                    }
                    attributes["申请时间"] = DateUtils.GetDateAndTimeString(applyInfo.AddDate);
                    foreach (string key in attributes.Keys)
                    {
                        var theValue = attributes[key];

                        builder.Append($@"{key}:{theValue},");
                    }

                    if (builder.Length > 0)
                    {
                        builder.Length = builder.Length - 1;
                    }

                    if (builder.Length > 60)
                    {
                        builder.Length = 60;
                    }

                    //var errorMessage = string.Empty;
                    //var providerInfo = BaiRongDataProvider.SmsProviderDAO.GetFirstSmsProviderInfo();
                    //if (providerInfo != null)
                    //{
                    //    SmsProviderManager.Send(providerInfo, mobileArrayList, builder.ToString(), out errorMessage);
                    //}
                }
            }
            catch
            {
                // ignored
            }
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            PageUtils.CheckRequestParameter("PublishmentSystemID", "ApplyID", "ReturnUrl");

            applyInfo = DataProvider.GovPublicApplyDao.GetApplyInfo(TranslateUtils.ToInt(Request.QueryString["ApplyID"]));
            returnUrl = StringUtils.ValueFromUrl(Request.QueryString["ReturnUrl"]);

            if (!IsPostBack)
            {
                if (!applyInfo.IsOrganization)
                {
                    ltlType.Text              = "公民";
                    phCivic.Visible           = true;
                    phOrg.Visible             = false;
                    ltlCivicName.Text         = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.CivicName);
                    ltlCivicOrganization.Text = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.CivicOrganization);
                    ltlCivicCardType.Text     = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.CivicCardType);
                    ltlCivicCardNo.Text       = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.CivicCardNo);
                    ltlCivicPhone.Text        = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.CivicPhone);
                    ltlCivicPostCode.Text     = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.CivicPostCode);
                    ltlCivicAddress.Text      = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.CivicAddress);
                    ltlCivicEmail.Text        = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.CivicEmail);
                    ltlCivicFax.Text          = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.CivicFax);

                    ltlName.Text = ltlCivicName.Text;
                }
                else
                {
                    ltlType.Text           = "法人/其他组织";
                    phCivic.Visible        = false;
                    phOrg.Visible          = true;
                    ltlOrgName.Text        = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.OrgName);
                    ltlOrgUnitCode.Text    = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.OrgUnitCode);
                    ltlOrgLegalPerson.Text = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.OrgLegalPerson);
                    ltlOrgLinkName.Text    = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.OrgLinkName);
                    ltlOrgPhone.Text       = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.OrgPhone);
                    ltlOrgPostCode.Text    = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.OrgPostCode);
                    ltlOrgAddress.Text     = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.OrgAddress);
                    ltlOrgEmail.Text       = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.OrgEmail);
                    ltlOrgFax.Text         = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.OrgFax);

                    ltlName.Text = ltlOrgName.Text;
                }

                ltlState.Text       = EGovPublicApplyStateUtils.GetText(applyInfo.State);
                ltlQueryCode.Text   = applyInfo.QueryCode;
                ltlTitle.Text       = applyInfo.Title;
                ltlContent.Text     = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.Content);
                ltlPurpose.Text     = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.Purpose);
                ltlIsApplyFree.Text = TranslateUtils.ToBool(applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.Content)) ? "申请" : "不申请";
                ltlProvideType.Text = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.ProvideType);
                ltlObtainType.Text  = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.ObtainType);

                if (phReply != null)
                {
                    if (applyInfo.State == EGovPublicApplyState.Denied || applyInfo.State == EGovPublicApplyState.Replied || applyInfo.State == EGovPublicApplyState.Redo || applyInfo.State == EGovPublicApplyState.Checked)
                    {
                        var replyInfo = DataProvider.GovPublicApplyReplyDao.GetReplyInfoByApplyId(applyInfo.Id);
                        if (replyInfo != null)
                        {
                            phReply.Visible = true;
                            ltlDepartmentAndUserName.Text =
                                $"{DepartmentManager.GetDepartmentName(replyInfo.DepartmentID)}({replyInfo.UserName})";
                            ltlAddDate.Text = DateUtils.GetDateAndTimeString(replyInfo.AddDate);
                            ltlReply.Text   = replyInfo.Reply;
                            ltlFileUrl.Text = replyInfo.FileUrl;
                        }
                    }
                }

                if (divAddDepartment != null)
                {
                    divAddDepartment.Attributes.Add("onclick", ModalGovPublicCategoryDepartmentSelect.GetOpenWindowString(PublishmentSystemId));
                    var scriptBuilder = new StringBuilder();
                    if (applyInfo.DepartmentId > 0)
                    {
                        var departmentName = DepartmentManager.GetDepartmentName(applyInfo.DepartmentId);
                        scriptBuilder.Append(
                            $@"<script>showCategoryDepartment('{departmentName}', '{applyInfo.DepartmentId}');</script>");
                    }
                    ltlScript.Text = scriptBuilder.ToString();
                }

                rptRemarks.DataSource     = DataProvider.GovPublicApplyRemarkDao.GetDataSourceByApplyId(applyInfo.Id);
                rptRemarks.ItemDataBound += rptRemarks_ItemDataBound;
                rptRemarks.DataBind();

                if (rptLogs != null)
                {
                    rptLogs.DataSource     = DataProvider.GovPublicApplyLogDao.GetDataSourceByApplyId(applyInfo.Id);
                    rptLogs.ItemDataBound += rptLogs_ItemDataBound;
                    rptLogs.DataBind();
                }
            }
        }