Ejemplo n.º 1
0
        /// <summary>
        /// 得到Session
        /// </summary>
        /// <returns></returns>
        private JArray GetSourceData()
        {
            if (Session[sessionName] == null && !string.IsNullOrEmpty(ToKeyId))
            {
                Session[sessionName] = new JArray();
                Model.AttachFile sour = new Model.AttachFile();
                if (this.MenuId == Const.ProjectPunishNoticeMenuId || this.MenuId == Const.ProjectPunishNoticeStatisticsMenuId)
                {
                    sour = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == ToKeyId && x.MenuId == this.MenuId);
                }
                else
                {
                    sour = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == ToKeyId);
                }

                if (sour != null)
                {
                    string        url  = sour.AttachUrl.Replace('\\', '/');
                    List <string> list = Funs.GetStrListByStr(url, ',');
                    if (list.Count() > 0)
                    {
                        int i = 0;
                        foreach (var item in list)
                        {
                            string atturl = Funs.RootPath + item.Replace(';', ' ').Trim();
                            if (File.Exists(atturl))
                            {
                                i += 1;
                                break;
                            }
                        }
                        if (i > 0)
                        {
                            Session[sessionName] = JArray.Parse(sour.AttachSource);
                        }
                    }
                }
            }

            return((JArray)Session[sessionName]);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 加载页面
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
                this.ProjectId = this.CurrUser.LoginProjectId;
                this.InitDropDownList();
                this.RectifyNoticeId = Request.Params["RectifyNoticeId"];
                string states = Request.Params["states"];
                if (!string.IsNullOrEmpty(this.RectifyNoticeId) && this.RectifyNoticeId.Contains("$"))
                {
                    List <string> stre = Funs.GetStrListByStr(this.RectifyNoticeId, '$');
                    if (stre.Count > 0)
                    {
                        this.RectifyNoticeId = stre[0];
                        states = stre[1];
                    }
                }
                if (!string.IsNullOrEmpty(states))
                {
                    this.drpIsRectify.Hidden   = false;
                    this.drpCheckPerson.Hidden = false;
                    this.txtReCheckDate.Hidden = false;
                }

                var rectifyNotice = BLL.RectifyNoticesService.GetRectifyNoticesById(this.RectifyNoticeId);
                if (rectifyNotice != null)
                {
                    this.ProjectId = rectifyNotice.ProjectId;
                    if (this.ProjectId != this.CurrUser.LoginProjectId)
                    {
                        this.InitDropDownList();
                    }
                    //隐患
                    this.txtRectifyNoticesCode.Text = BLL.CodeRecordsService.ReturnCodeByDataId(this.RectifyNoticeId);
                    if (!string.IsNullOrEmpty(rectifyNotice.UnitId))
                    {
                        this.drpUnitId.SelectedValue = rectifyNotice.UnitId;
                        BLL.UserService.InitUserProjectIdUnitIdDropDownList(this.drpDutyPerson, this.ProjectId, this.drpUnitId.SelectedValue, true);
                        if (!string.IsNullOrEmpty(rectifyNotice.DutyPersonId))
                        {
                            this.drpDutyPerson.SelectedValue = rectifyNotice.DutyPersonId;
                        }
                    }
                    if (!string.IsNullOrEmpty(rectifyNotice.WorkAreaId))
                    {
                        this.drpWorkAreaId.SelectedValue = rectifyNotice.WorkAreaId;
                    }
                    if (rectifyNotice.CheckedDate != null)
                    {
                        this.txtCheckedDate.Text = string.Format("{0:yyyy-MM-dd}", rectifyNotice.CheckedDate);
                    }
                    if (!string.IsNullOrEmpty(rectifyNotice.WrongContent))
                    {
                        this.txtWrongContent.Text = rectifyNotice.WrongContent;
                    }
                    else
                    {
                        this.txtWrongContent.Text = "隐患问题及整改要求:";
                    }
                    if (!string.IsNullOrEmpty(rectifyNotice.SignPerson))
                    {
                        this.drpSignPerson.SelectedValue = rectifyNotice.SignPerson;
                    }
                    if (rectifyNotice.SignDate != null)
                    {
                        this.txtSignDate.Text = string.Format("{0:yyyy-MM-dd}", rectifyNotice.SignDate);
                    }
                    if (!string.IsNullOrEmpty(rectifyNotice.CompleteStatus))
                    {
                        this.txtCompleteStatus.Text = rectifyNotice.CompleteStatus;
                    }
                    else
                    {
                        this.txtCompleteStatus.Text = "整改结果:";
                    }
                    this.txtDutyPerson.Text   = rectifyNotice.DutyPerson;
                    this.txtCompleteDate.Text = string.Format("{0:yyyy-MM-dd}", rectifyNotice.CompleteDate);

                    this.drpIsRectify.SelectedValue = Convert.ToString(rectifyNotice.IsRectify);
                    if (!string.IsNullOrEmpty(rectifyNotice.CheckPerson))
                    {
                        this.drpCheckPerson.SelectedValue = rectifyNotice.CheckPerson;
                    }
                    else
                    {
                        this.drpCheckPerson.SelectedValue = Const._Null;
                    }
                    this.txtReCheckDate.Text = string.Format("{0:yyyy-MM-dd}", rectifyNotice.ReCheckDate);
                }
                else
                {
                    ////自动生成编码
                    this.txtRectifyNoticesCode.Text = BLL.CodeRecordsService.ReturnCodeByMenuIdProjectId(BLL.Const.ProjectRectifyNoticeMenuId, this.ProjectId, this.CurrUser.UnitId);
                    if (this.CurrUser.UserId != BLL.Const.sysglyId)
                    {
                        this.drpSignPerson.SelectedValue = this.CurrUser.UserId;
                    }

                    //this.txtCheckedDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
                    this.txtSignDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
                    // this.txtCompleteDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
                    this.txtWrongContent.Text   = "隐患描述:";
                    this.txtCompleteStatus.Text = "整改结果:";
                }
            }
        }