Exemple #1
0
        public GovPublicApplyInfo GetApplyInfo(int publishmentSystemId, int styleId, NameValueCollection form)
        {
            var queryCode      = GovPublicApplyManager.GetQueryCode();
            var departmentId   = TranslateUtils.ToInt(form[GovPublicApplyAttribute.DepartmentId]);
            var departmentName = string.Empty;

            if (departmentId > 0)
            {
                departmentName = DepartmentManager.GetDepartmentName(departmentId);
            }
            var applyInfo = new GovPublicApplyInfo(0, styleId, publishmentSystemId, TranslateUtils.ToBool(form[GovPublicApplyAttribute.IsOrganization], false), form[GovPublicApplyAttribute.Title], departmentName, departmentId, DateTime.Now, queryCode, EGovPublicApplyState.New);

            foreach (var name in form.AllKeys)
            {
                if (GovPublicApplyAttribute.BasicAttributes.Contains(name.ToLower()))
                {
                    var value = form[name];
                    if (!string.IsNullOrEmpty(value))
                    {
                        applyInfo.SetExtendedAttribute(name, value);
                    }
                }
            }

            return(applyInfo);
        }
Exemple #2
0
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                if (string.IsNullOrEmpty(tbCommentRemark.Text))
                {
                    FailMessage("批示失败,必须填写意见");
                    return;
                }

                foreach (int applyID in _idArrayList)
                {
                    var remarkInfo = new GovPublicApplyRemarkInfo(0, PublishmentSystemId, applyID, EGovPublicApplyRemarkType.Comment, tbCommentRemark.Text, Body.AdministratorInfo.DepartmentId, Body.AdministratorName, DateTime.Now);
                    DataProvider.GovPublicApplyRemarkDao.Insert(remarkInfo);

                    GovPublicApplyManager.Log(PublishmentSystemId, applyID, EGovPublicApplyLogType.Comment, Body.AdministratorName, Body.AdministratorInfo.DepartmentId);
                }

                isChanged = true;
            }
            catch (Exception ex)
            {
                FailMessage(ex, ex.Message);
                isChanged = false;
            }

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page, "alert(\'批示成功!\');");
            }
        }
        public void SwitchTo_OnClick(object sender, EventArgs e)
        {
            var switchToDepartmentID = TranslateUtils.ToInt(Request.Form["switchToDepartmentID"]);

            if (switchToDepartmentID == 0)
            {
                FailMessage("转办失败,必须选择转办部门");
                return;
            }
            var switchToDepartmentName = DepartmentManager.GetDepartmentName(switchToDepartmentID);

            try
            {
                DataProvider.GovPublicApplyDao.UpdateDepartmentId(applyInfo.Id, switchToDepartmentID);

                var remarkInfo = new GovPublicApplyRemarkInfo(0, PublishmentSystemId, applyInfo.Id, EGovPublicApplyRemarkType.SwitchTo, tbSwitchToRemark.Text, Body.AdministratorInfo.DepartmentId, Body.AdministratorName, DateTime.Now);
                DataProvider.GovPublicApplyRemarkDao.Insert(remarkInfo);

                GovPublicApplyManager.LogSwitchTo(PublishmentSystemId, applyInfo.Id, switchToDepartmentName, Body.AdministratorName, Body.AdministratorInfo.DepartmentId);

                SuccessMessage("申请转办成功");

                AddWaitAndRedirectScript(ListPageUrl);
            }
            catch (Exception ex)
            {
                FailMessage(ex, ex.Message);
            }
        }
        public void Reply_OnClick(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(tbReply.Text))
            {
                FailMessage("回复失败,必须填写答复内容");
                return;
            }
            try
            {
                DataProvider.GovPublicApplyReplyDao.DeleteByApplyId(applyInfo.Id);
                var fileUrl   = string.Empty;
                var replyInfo = new GovPublicApplyReplyInfo(0, PublishmentSystemId, applyInfo.Id, tbReply.Text, fileUrl, Body.AdministratorInfo.DepartmentId, Body.AdministratorName, DateTime.Now);
                DataProvider.GovPublicApplyReplyDao.Insert(replyInfo);

                GovPublicApplyManager.Log(PublishmentSystemId, applyInfo.Id, EGovPublicApplyLogType.Reply, Body.AdministratorName, Body.AdministratorInfo.DepartmentId);
                DataProvider.GovPublicApplyDao.UpdateState(applyInfo.Id, EGovPublicApplyState.Replied);

                SuccessMessage("申请回复成功");

                AddWaitAndRedirectScript(ListPageUrl);
            }
            catch (Exception ex)
            {
                FailMessage(ex, ex.Message);
            }
        }
Exemple #5
0
 public void Check_OnClick(object sender, EventArgs e)
 {
     try
     {
         GovPublicApplyManager.Log(PublishmentSystemId, applyInfo.Id, EGovPublicApplyLogType.Check, Body.AdministratorName, Body.AdministratorInfo.DepartmentId);
         DataProvider.GovPublicApplyDao.UpdateState(applyInfo.Id, EGovPublicApplyState.Checked);
         SuccessMessage("审核申请成功");
         AddWaitAndRedirectScript(ListPageUrl);
     }
     catch (Exception ex)
     {
         FailMessage(ex, ex.Message);
     }
 }
Exemple #6
0
        public void Accept_OnClick(object sender, EventArgs e)
        {
            try
            {
                var remarkInfo = new GovPublicApplyRemarkInfo(0, PublishmentSystemId, applyInfo.Id, EGovPublicApplyRemarkType.Accept, tbAcceptRemark.Text, Body.AdministratorInfo.DepartmentId, Body.AdministratorName, DateTime.Now);
                DataProvider.GovPublicApplyRemarkDao.Insert(remarkInfo);

                GovPublicApplyManager.Log(PublishmentSystemId, applyInfo.Id, EGovPublicApplyLogType.Accept, Body.AdministratorName, Body.AdministratorInfo.DepartmentId);
                DataProvider.GovPublicApplyDao.UpdateState(applyInfo.Id, EGovPublicApplyState.Accepted);
                SuccessMessage("申请受理成功");

                AddWaitAndRedirectScript(ListPageUrl);
            }
            catch (Exception ex)
            {
                FailMessage(ex, ex.Message);
            }
        }
        public override void Submit_OnClick(object sender, EventArgs e)
        {
            var isChanged = false;

            try
            {
                var switchToDepartmentID = TranslateUtils.ToInt(Request.Form["switchToDepartmentID"]);
                if (switchToDepartmentID == 0)
                {
                    FailMessage("转办失败,必须选择转办部门");
                    return;
                }
                var switchToDepartmentName = DepartmentManager.GetDepartmentName(switchToDepartmentID);

                foreach (int applyID in _idArrayList)
                {
                    var state = DataProvider.GovPublicApplyDao.GetState(applyID);
                    if (state != EGovPublicApplyState.Denied && state != EGovPublicApplyState.Checked)
                    {
                        DataProvider.GovPublicApplyDao.UpdateDepartmentId(applyID, switchToDepartmentID);

                        var remarkInfo = new GovPublicApplyRemarkInfo(0, PublishmentSystemId, applyID, EGovPublicApplyRemarkType.SwitchTo, tbSwitchToRemark.Text, Body.AdministratorInfo.DepartmentId, Body.AdministratorName, DateTime.Now);
                        DataProvider.GovPublicApplyRemarkDao.Insert(remarkInfo);

                        GovPublicApplyManager.LogSwitchTo(PublishmentSystemId, applyID, switchToDepartmentName, Body.AdministratorName, Body.AdministratorInfo.DepartmentId);
                    }
                }

                isChanged = true;
            }
            catch (Exception ex)
            {
                FailMessage(ex, ex.Message);
                isChanged = false;
            }

            if (isChanged)
            {
                PageUtils.CloseModalPage(Page, "alert(\'申请转办成功!\');");
            }
        }
Exemple #8
0
        public void Main(int publishmentSystemId, int styleId)
        {
            var publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(publishmentSystemId);

            var tagStyleInfo = TagStyleManager.GetTagStyleInfo(styleId) ?? new TagStyleInfo();
            var tagStyleGovPublicApplyInfo = new TagStyleGovPublicApplyInfo(tagStyleInfo.SettingsXML);

            try
            {
                var applyInfo = DataProvider.GovPublicApplyDao.GetApplyInfo(publishmentSystemId, styleId, HttpContext.Current.Request.Form);

                var applyId = DataProvider.GovPublicApplyDao.Insert(applyInfo);

                var fromName = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.CivicName);
                if (applyInfo.IsOrganization)
                {
                    fromName = applyInfo.GetExtendedAttribute(GovPublicApplyAttribute.OrgName);
                }
                var toDepartmentName = string.Empty;
                if (applyInfo.DepartmentId > 0)
                {
                    toDepartmentName = "至" + applyInfo.DepartmentName;
                }
                GovPublicApplyManager.LogNew(publishmentSystemId, applyId, fromName, toDepartmentName);

                MessageManager.SendSMSByGovPublicApply(publishmentSystemInfo, tagStyleGovPublicApplyInfo, applyInfo);

                HttpContext.Current.Response.Write(GovPublicApplyTemplate.GetCallbackScript(publishmentSystemInfo, true, applyInfo.QueryCode, string.Empty));
                HttpContext.Current.Response.End();
            }
            catch (Exception ex)
            {
                //HttpContext.Current.Response.Write(GovPublicApplyTemplate.GetCallbackScript(publishmentSystemInfo, false, string.Empty, ex.Message));
                HttpContext.Current.Response.Write(GovPublicApplyTemplate.GetCallbackScript(publishmentSystemInfo, false, string.Empty, "程序错误"));
                HttpContext.Current.Response.End();
            }
        }
Exemple #9
0
        public void Redo_OnClick(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(tbRedoRemark.Text))
            {
                FailMessage("要求返工失败,必须填写意见");
                return;
            }
            try
            {
                var remarkInfo = new GovPublicApplyRemarkInfo(0, PublishmentSystemId, applyInfo.Id, EGovPublicApplyRemarkType.Redo, tbRedoRemark.Text, Body.AdministratorInfo.DepartmentId, Body.AdministratorName, DateTime.Now);
                DataProvider.GovPublicApplyRemarkDao.Insert(remarkInfo);

                GovPublicApplyManager.Log(PublishmentSystemId, applyInfo.Id, EGovPublicApplyLogType.Redo, Body.AdministratorName, Body.AdministratorInfo.DepartmentId);
                DataProvider.GovPublicApplyDao.UpdateState(applyInfo.Id, EGovPublicApplyState.Redo);

                SuccessMessage("要求返工成功");

                AddWaitAndRedirectScript(ListPageUrl);
            }
            catch (Exception ex)
            {
                FailMessage(ex, ex.Message);
            }
        }
Exemple #10
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            PageUtils.CheckRequestParameter("PublishmentSystemID");

            if (Body.IsQueryExists("Delete"))
            {
                var arraylist = TranslateUtils.StringCollectionToIntList(Request.QueryString["IDCollection"]);
                if (arraylist.Count > 0)
                {
                    try
                    {
                        DataProvider.GovPublicApplyDao.Delete(arraylist);
                        Body.AddSiteLog(PublishmentSystemId, "删除申请");
                        SuccessMessage("删除成功!");
                    }
                    catch (Exception ex)
                    {
                        FailMessage(ex, "删除失败!");
                    }
                }
            }
            else if (Body.IsQueryExists("Accept"))
            {
                var arraylist = TranslateUtils.StringCollectionToIntList(Request.QueryString["IDCollection"]);
                foreach (var applyId in arraylist)
                {
                    var state = DataProvider.GovPublicApplyDao.GetState(applyId);
                    if (state == EGovPublicApplyState.New || state == EGovPublicApplyState.Denied)
                    {
                        GovPublicApplyManager.Log(PublishmentSystemId, applyId, EGovPublicApplyLogType.Accept, Body.AdministratorName, Body.AdministratorInfo.DepartmentId);
                        DataProvider.GovPublicApplyDao.UpdateState(applyId, EGovPublicApplyState.Accepted);
                    }
                }
                SuccessMessage("受理申请成功!");
            }
            else if (Body.IsQueryExists("Deny"))
            {
                var arraylist = TranslateUtils.StringCollectionToIntList(Request.QueryString["IDCollection"]);
                foreach (var applyId in arraylist)
                {
                    var state = DataProvider.GovPublicApplyDao.GetState(applyId);
                    if (state == EGovPublicApplyState.New || state == EGovPublicApplyState.Accepted)
                    {
                        GovPublicApplyManager.Log(PublishmentSystemId, applyId, EGovPublicApplyLogType.Deny, Body.AdministratorName, Body.AdministratorInfo.DepartmentId);
                        DataProvider.GovPublicApplyDao.UpdateState(applyId, EGovPublicApplyState.Denied);
                    }
                }
                SuccessMessage("拒绝受理申请成功!");
            }
            else if (Body.IsQueryExists("Check"))
            {
                var arraylist = TranslateUtils.StringCollectionToIntList(Request.QueryString["IDCollection"]);
                foreach (var applyId in arraylist)
                {
                    var state = DataProvider.GovPublicApplyDao.GetState(applyId);
                    if (state == EGovPublicApplyState.Replied)
                    {
                        GovPublicApplyManager.Log(PublishmentSystemId, applyId, EGovPublicApplyLogType.Check, Body.AdministratorName, Body.AdministratorInfo.DepartmentId);
                        DataProvider.GovPublicApplyDao.UpdateState(applyId, EGovPublicApplyState.Checked);
                    }
                }
                SuccessMessage("审核申请成功!");
            }

            spContents.ControlToPaginate = rptContents;
            spContents.ItemsPerPage      = PublishmentSystemInfo.Additional.PageSize;
            spContents.SelectCommand     = GetSelectString();
            spContents.SortField         = DataProvider.GovPublicApplyDao.GetSortFieldName();
            spContents.SortMode          = GetSortMode();
            rptContents.ItemDataBound   += rptContents_ItemDataBound;

            if (!IsPostBack)
            {
                spContents.DataBind();
                ltlTotalCount.Text = spContents.TotalCount.ToString();

                if (hlAccept != null)
                {
                    hlAccept.Attributes.Add("onclick", PageUtils.GetRedirectStringWithCheckBoxValueAndAlert(PageUrl + "&Accept=True", "IDCollection", "IDCollection", "请选择需要受理的申请!", "此操作将受理所选申请,确定吗?"));
                }
                if (hlDeny != null)
                {
                    hlDeny.Attributes.Add("onclick", PageUtils.GetRedirectStringWithCheckBoxValueAndAlert(PageUrl + "&Deny=True", "IDCollection", "IDCollection", "请选择需要拒绝的申请!", "此操作将拒绝受理所选申请,确定吗?"));
                }
                if (hlCheck != null)
                {
                    hlCheck.Attributes.Add("onclick", PageUtils.GetRedirectStringWithCheckBoxValueAndAlert(PageUrl + "&Check=True", "IDCollection", "IDCollection", "请选择需要审核的申请!", "此操作将审核所选申请,确定吗?"));
                }
                if (hlRedo != null)
                {
                    hlRedo.Attributes.Add("onclick", ModalGovPublicApplyRedo.GetOpenWindowString(PublishmentSystemId));
                }
                if (hlSwitchTo != null)
                {
                    hlSwitchTo.Attributes.Add("onclick", ModalGovPublicApplySwitchTo.GetOpenWindowString(PublishmentSystemId));
                }
                if (hlComment != null)
                {
                    hlComment.Attributes.Add("onclick", ModalGovPublicApplyComment.GetOpenWindowString(PublishmentSystemId));
                }
                if (phDelete != null)
                {
                    phDelete.Visible = PublishmentSystemInfo.Additional.GovPublicApplyIsDeleteAllowed;
                    hlDelete.Attributes.Add("onclick", PageUtils.GetRedirectStringWithCheckBoxValueAndAlert(PageUrl + "&Delete=True", "IDCollection", "IDCollection", "请选择需要删除的申请!", "此操作将删除所选申请,确定吗?"));
                }
            }
        }
Exemple #11
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>";
            }
        }