コード例 #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>");
        }
コード例 #2
0
ファイル: GovPublicApplyDao.cs プロジェクト: yankaics/cms-1
        public void UpdateState(int applyId, EGovPublicApplyState state)
        {
            string sqlString =
                $"UPDATE {TableName} SET State = '{EGovPublicApplyStateUtils.GetValue(state)}' WHERE ID = {applyId}";

            ExecuteNonQuery(sqlString);
        }
コード例 #3
0
ファイル: GovPublicApplyDao.cs プロジェクト: yankaics/cms-1
        public string GetSelectStringByState(int publishmentSystemId, params EGovPublicApplyState[] states)
        {
            var whereBuilder = new StringBuilder();

            whereBuilder.Append($"WHERE PublishmentSystemID = {publishmentSystemId} AND (");
            foreach (var state in states)
            {
                whereBuilder.Append($" State = '{EGovPublicApplyStateUtils.GetValue(state)}' OR");
            }
            whereBuilder.Length -= 2;
            whereBuilder.Append(") ORDER BY ID DESC");
            return(BaiRongDataProvider.TableStructureDao.GetSelectSqlString(TableName, SqlUtils.Asterisk, whereBuilder.ToString()));
        }
コード例 #4
0
ファイル: GovPublicApplyDao.cs プロジェクト: yankaics/cms-1
        public EGovPublicApplyState GetState(int applyId)
        {
            var    state     = EGovPublicApplyState.New;
            string sqlString = $"SELECT State FROM {TableName} WHERE ID = {applyId}";

            using (var rdr = ExecuteReader(sqlString))
            {
                if (rdr.Read())
                {
                    state = EGovPublicApplyStateUtils.GetEnumType(GetString(rdr, 0));
                }
                rdr.Close();
            }
            return(state);
        }
コード例 #5
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BreadCrumb(AppManager.Wcm.LeftMenu.IdGovPublic, AppManager.Wcm.LeftMenu.GovPublic.IdGovPublicApply, "所有申请", AppManager.Wcm.Permission.WebSite.GovPublicApply);

                EBooleanUtils.AddListItems(ddlTaxis, "倒序", "正序");
                if (Body.IsQueryExists("isTaxisDESC"))
                {
                    var isTaxisDesc = TranslateUtils.ToBool(Request.QueryString["isTaxisDESC"]);
                    ControlUtils.SelectListItemsIgnoreCase(ddlTaxis, isTaxisDesc.ToString());
                }
                var listItem = new ListItem("全部", string.Empty);
                ddlState.Items.Add(listItem);
                EGovPublicApplyStateUtils.AddListItems(ddlState);
                if (Body.IsQueryExists("state"))
                {
                    ControlUtils.SelectListItemsIgnoreCase(ddlState, Request.QueryString["state"]);
                }
                tbKeyword.Text = Request.QueryString["keyword"];
            }
        }
コード例 #6
0
ファイル: GovPublicApplyDao.cs プロジェクト: yankaics/cms-1
        public int GetCountByDepartmentIdAndState(int publishmentSystemId, int departmentId, EGovPublicApplyState state, DateTime begin, DateTime end)
        {
            string sqlString =
                $"SELECT COUNT(*) AS TotalNum FROM {TableName} WHERE PublishmentSystemID = {publishmentSystemId} AND DepartmentID = {departmentId} AND State = '{EGovPublicApplyStateUtils.GetValue(state)}' AND (AddDate BETWEEN '{begin.ToShortDateString()}' AND '{end.AddDays(1).ToShortDateString()}')";

            return(BaiRongDataProvider.DatabaseDao.GetIntResult(sqlString));
        }
コード例 #7
0
ファイル: GovPublicApplyDao.cs プロジェクト: yankaics/cms-1
        public int GetCountByDepartmentIdAndState(int publishmentSystemId, int departmentId, EGovPublicApplyState state)
        {
            string sqlString =
                $"SELECT COUNT(*) AS TotalNum FROM {TableName} WHERE PublishmentSystemID = {publishmentSystemId} AND DepartmentID = {departmentId} AND State = '{EGovPublicApplyStateUtils.GetValue(state)}'";

            return(BaiRongDataProvider.DatabaseDao.GetIntResult(sqlString));
        }
コード例 #8
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var applyInfo = new GovPublicApplyInfo(e.Item.DataItem);

                var ltlTr         = e.Item.FindControl("ltlTr") as Literal;
                var ltlTitle      = e.Item.FindControl("ltlTitle") as Literal;
                var ltlAddDate    = e.Item.FindControl("ltlAddDate") as Literal;
                var ltlRemark     = e.Item.FindControl("ltlRemark") as Literal;
                var ltlDepartment = e.Item.FindControl("ltlDepartment") as Literal;
                var ltlLimit      = e.Item.FindControl("ltlLimit") as Literal;
                var ltlState      = e.Item.FindControl("ltlState") as Literal;
                var ltlFlowUrl    = e.Item.FindControl("ltlFlowUrl") as Literal;
                var ltlViewUrl    = e.Item.FindControl("ltlViewUrl") as Literal;

                ltlTr.Text = @"<tr class=""tdbg"" style=""height:25px"">";
                var limitType = GovPublicApplyManager.GetLimitType(PublishmentSystemInfo, applyInfo);
                if (limitType == EGovPublicApplyLimitType.Alert)
                {
                    ltlTr.Text = @"<tr class=""tdbg"" style=""height:25px;background-color:#AAAAD5"">";
                }
                else if (limitType == EGovPublicApplyLimitType.Yellow)
                {
                    ltlTr.Text = @"<tr class=""tdbg"" style=""height:25px;background-color:#FF9"">";
                }
                else if (limitType == EGovPublicApplyLimitType.Red)
                {
                    ltlTr.Text = @"<tr class=""tdbg"" style=""height:25px;background-color:#FE5461"">";
                }

                if (applyInfo.State == EGovPublicApplyState.Accepted || applyInfo.State == EGovPublicApplyState.Redo)
                {
                    ltlTitle.Text =
                        $@"<a href=""{PageGovPublicApplyToReplyDetail.GetRedirectUrl(PublishmentSystemId,
                            applyInfo.Id, PageUrl)}"">{applyInfo.Title}</a>";
                }
                else if (applyInfo.State == EGovPublicApplyState.Checked || applyInfo.State == EGovPublicApplyState.Replied)
                {
                    ltlTitle.Text =
                        $@"<a href=""{PageGovPublicApplyToCheckDetail.GetRedirectUrl(PublishmentSystemId,
                            applyInfo.Id, PageUrl)}"">{applyInfo.Title}</a>";
                }
                else if (applyInfo.State == EGovPublicApplyState.Denied || applyInfo.State == EGovPublicApplyState.New)
                {
                    ltlTitle.Text =
                        $@"<a href=""{PageGovPublicApplyToAcceptDetail.GetRedirectUrl(PublishmentSystemId,
                            applyInfo.Id, PageUrl)}"">{applyInfo.Title}</a>";
                }
                var departmentName = DepartmentManager.GetDepartmentName(applyInfo.DepartmentId);
                if (applyInfo.DepartmentId > 0 && departmentName != applyInfo.DepartmentName)
                {
                    ltlTitle.Text += "<span style='color:red'>【转】</span>";
                }
                ltlAddDate.Text    = DateUtils.GetDateAndTimeString(applyInfo.AddDate);
                ltlRemark.Text     = GovPublicApplyManager.GetApplyRemark(applyInfo.Id);
                ltlDepartment.Text = departmentName;
                ltlLimit.Text      = EGovPublicApplyLimitTypeUtils.GetText(limitType);
                ltlState.Text      = EGovPublicApplyStateUtils.GetText(applyInfo.State);
                if (applyInfo.State == EGovPublicApplyState.New)
                {
                    ltlState.Text = $"<span style='color:red'>{ltlState.Text}</span>";
                }
                else if (applyInfo.State == EGovPublicApplyState.Redo)
                {
                    ltlState.Text = $"<span style='color:red'>{ltlState.Text}</span>";
                }
                ltlFlowUrl.Text =
                    $@"<a href=""javascript:;"" onclick=""{ModalGovPublicApplyFlow.GetOpenWindowString(
                        PublishmentSystemId, applyInfo.Id)}"">轨迹</a>";
                ltlViewUrl.Text =
                    $@"<a href=""javascript:;"" onclick=""{ModalGovPublicApplyView.GetOpenWindowString(
                        PublishmentSystemId, applyInfo.Id)}"">查看</a>";
            }
        }
コード例 #9
0
        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();
                }
            }
        }