Exemplo n.º 1
0
        public EntityData GetData()
        {
            DAL.QueryStrategy.PurchaseFlowOpinionStrategyBuilder sb = new RmsPM.DAL.QueryStrategy.PurchaseFlowOpinionStrategyBuilder();
            //sb.AddStrategy( new Strategy( DAL.QueryStrategy.PurchaseFlowOpinionStrategyName.ObjectCode,this.ApplicationCode));
            sb.AddStrategy(new Strategy(DAL.QueryStrategy.PurchaseFlowOpinionStrategyName.OpinionType, this.OpinionType));
            sb.AddStrategy(new Strategy(DAL.QueryStrategy.PurchaseFlowOpinionStrategyName.CaseCode, this.CaseCode));
            if (this.OpinionUserCode != "")
            {
                sb.AddStrategy(new Strategy(DAL.QueryStrategy.PurchaseFlowOpinionStrategyName.OpinionUserCode, this.OpinionUserCode));
            }
            sb.AddStrategy(new Strategy(DAL.QueryStrategy.PurchaseFlowOpinionStrategyName.StateIn, ((User)Session["User"]).UserCode));
            sb.AddOrder("OpinionDate", false);

            string     sql    = sb.BuildMainQueryString();
            QueryAgent QA     = new QueryAgent();
            EntityData entity = QA.FillEntityData("PurchaseFlowOpinion", sql);

            QA.Dispose();
            return(entity);
        }
Exemplo n.º 2
0
        /// ****************************************************************************
        /// <summary>
        /// 组织业务实体数据
        /// </summary>
        /// <returns>业务数据实体对象</returns>
        /// ****************************************************************************
        private EntityData BuildData(bool flag, bool CheckFlag, bool Stateflag)
        {
            string PurchaseFlowOpinionCode = "";

            DAL.QueryStrategy.PurchaseFlowOpinionStrategyBuilder sb = new RmsPM.DAL.QueryStrategy.PurchaseFlowOpinionStrategyBuilder();
            //sb.AddStrategy( new Strategy( DAL.QueryStrategy.PurchaseFlowOpinionStrategyName.ObjectCode,this.ApplicationCode));
            sb.AddStrategy(new Strategy(DAL.QueryStrategy.PurchaseFlowOpinionStrategyName.OpinionType, this.OpinionType));
            sb.AddStrategy(new Strategy(DAL.QueryStrategy.PurchaseFlowOpinionStrategyName.CaseCode, this.CaseCode));

            if (this.OpinionUserCode != "")
            {
                sb.AddStrategy(new Strategy(DAL.QueryStrategy.PurchaseFlowOpinionStrategyName.OpinionUserCode, this.OpinionUserCode));
            }

            sb.AddOrder("OpinionDate", false);

            string sql = sb.BuildMainQueryString();

            EntityData entityopinion = new EntityData("PurchaseFlowOpinion");

            dao.FillEntity(sql, entityopinion);

            if (entityopinion.Tables[0].Rows.Count > 0)
            {
                PurchaseFlowOpinionCode = entityopinion.CurrentRow["PurchaseFlowOpinionCode"].ToString();
            }

            entityopinion.Dispose();

            bool       NewRecordFlag = false;
            EntityData entity        = DAL.EntityDAO.PurchaseFlowDAO.GetPurchaseFlowOpinionByCode(dao, PurchaseFlowOpinionCode);
            DataRow    dr;

            if (PurchaseFlowOpinionCode == "")
            {
                NewRecordFlag           = true;
                PurchaseFlowOpinionCode = DAL.EntityDAO.SystemManageDAO.GetNewSysCode("PurchaseFlowOpinion");
                dr = entity.GetNewRecord();
            }
            else
            {
                dr = entity.CurrentRow;
            }

            if (flag)
            {
                dr["PurchaseFlowOpinionCode"] = PurchaseFlowOpinionCode;
                dr["ObjectCode"]      = this.ApplicationCode;
                dr["CaseCode"]        = this.CaseCode;
                dr["OpinionType"]     = this.OpinionType;
                dr["OpinionUserCode"] = this.OpinionUserCode;
                if (Stateflag)
                {
                    dr["State"] = ((User)Session["User"]).UserCode;
                }
                else
                {
                    dr["State"] = "";
                }

                if (this.ControlType == "Text")
                {
                    dr["OpinionText"] = this.OpinionText.Value.Trim();
                    string UserName = RmsPM.BLL.SystemRule.GetUserNameByProjectCode(this.ProjectCode, ((User)Session["User"]).UserName, ((User)Session["User"]).UserShortName, null);
                    dr["OpinionUser"] = UserName;
                    dr["OpinionDate"] = DateTime.Now.ToString();
                }
                else if (this.ControlType == "TextArea")
                {
                    dr["OpinionText"] = this.OpinionTextArea.Value;
                    string UserName = RmsPM.BLL.SystemRule.GetUserNameByProjectCode(this.ProjectCode, ((User)Session["User"]).UserName, ((User)Session["User"]).UserShortName, null);
                    dr["OpinionUser"] = UserName;
                    dr["OpinionDate"] = DateTime.Now.ToString();
                }
                else if (this.ControlType == "TextAreaEsay")
                {
                    dr["OpinionText"] = this.OpinionTextArea.Value;
                    string UserName = RmsPM.BLL.SystemRule.GetUserNameByProjectCode(this.ProjectCode, ((User)Session["User"]).UserName, ((User)Session["User"]).UserShortName, null);
                    dr["OpinionUser"] = UserName;
                    dr["OpinionDate"] = DateTime.Now.ToString();
                }
                else if (this.ControlType == "TextNum")
                {
                    dr["OpinionText"] = this.OpinionNum.Value;
                    string UserName = RmsPM.BLL.SystemRule.GetUserNameByProjectCode(this.ProjectCode, ((User)Session["User"]).UserName, ((User)Session["User"]).UserShortName, null);
                    dr["OpinionUser"] = UserName;
                    dr["OpinionDate"] = DateTime.Now.ToString();
                }

                if (CheckFlag)
                {
                    //dr["OpinionConfirm"] = this.rdoCheck.SelectedItem.Value == null ? "" : this.rdoCheck.SelectedItem.Value;
                    dr["OpinionConfirm"] = this.AuditValue;
                }

                if (NewRecordFlag)
                {
                    entity.AddNewRecord(dr);
                }
            }
            return(entity);
        }
Exemplo n.º 3
0
        /// ****************************************************************************
        /// <summary>
        /// 组织业务实体数据
        /// </summary>
        /// <returns>业务数据实体对象</returns>
        /// ****************************************************************************
        private EntityData BuildData(bool flag)
        {
            string PurchaseFlowOpinionCode = "";

            DAL.QueryStrategy.PurchaseFlowOpinionStrategyBuilder sb = new RmsPM.DAL.QueryStrategy.PurchaseFlowOpinionStrategyBuilder();
            sb.AddStrategy(new Strategy(DAL.QueryStrategy.PurchaseFlowOpinionStrategyName.ObjectCode, this.ApplicationCode));
            sb.AddStrategy(new Strategy(DAL.QueryStrategy.PurchaseFlowOpinionStrategyName.OpinionType, this.OpinionType));

            string sql = sb.BuildMainQueryString();

            EntityData entityopinion = new EntityData("PurchaseFlowOpinion");

            dao.FillEntity(sql, entityopinion);

            if (entityopinion.Tables[0].Rows.Count > 0)
            {
                PurchaseFlowOpinionCode = entityopinion.CurrentRow["PurchaseFlowOpinionCode"].ToString();
            }

            entityopinion.Dispose();

            bool       NewRecordFlag = false;
            EntityData entity        = DAL.EntityDAO.PurchaseFlowDAO.GetPurchaseFlowOpinionByCode(dao, PurchaseFlowOpinionCode);
            DataRow    dr;

            if (PurchaseFlowOpinionCode == "")
            {
                NewRecordFlag           = true;
                PurchaseFlowOpinionCode = DAL.EntityDAO.SystemManageDAO.GetNewSysCode("PurchaseFlowOpinion");
                dr = entity.GetNewRecord();
            }
            else
            {
                dr = entity.CurrentRow;
            }

            if (flag)
            {
                dr["PurchaseFlowOpinionCode"] = PurchaseFlowOpinionCode;
                dr["ObjectCode"]  = this.ApplicationCode;
                dr["OpinionType"] = this.OpinionType;
                if (this.IsTextBox)
                {
                    dr["OpinionText"] = this.txtOpinion.Value.Trim();
                    dr["OpinionUser"] = this.txtOpinion.Value.Trim();
                    dr["OpinionDate"] = DateTime.Now.ToShortDateString();
                }
                else
                {
                    dr["OpinionText"] = this.textareaOpinion.Value.Trim();
                    dr["OpinionUser"] = this.OpinionUser.InnerHtml;
                    dr["OpinionDate"] = this.OpinionDate.InnerHtml;
                }

                if (NewRecordFlag)
                {
                    entity.AddNewRecord(dr);
                }
            }
            return(entity);
        }
Exemplo n.º 4
0
        /// ****************************************************************************
        /// <summary>
        /// 数据加载
        /// </summary>
        /// ****************************************************************************
        private void LoadData(bool Flag)
        {
            if (this.ApplicationCode != "")
            {
                string OpinionText = "";
                string OpinionUser = "";
                string OpinionDate = "";
                DAL.QueryStrategy.PurchaseFlowOpinionStrategyBuilder sb = new RmsPM.DAL.QueryStrategy.PurchaseFlowOpinionStrategyBuilder();
                sb.AddStrategy(new Strategy(DAL.QueryStrategy.PurchaseFlowOpinionStrategyName.ObjectCode, this.ApplicationCode));
                sb.AddStrategy(new Strategy(DAL.QueryStrategy.PurchaseFlowOpinionStrategyName.OpinionType, this.OpinionType));

                string     sql    = sb.BuildMainQueryString();
                QueryAgent QA     = new QueryAgent();
                EntityData entity = QA.FillEntityData("PurchaseFlowOpinion", sql);
                if (entity.HasRecord())
                {
                    OpinionText = entity.CurrentRow["OpinionText"].ToString();
                    OpinionUser = entity.CurrentRow["OpinionUser"].ToString();
                    OpinionDate = entity.GetDateTimeOnlyDate("OpinionDate");
                }

                QA.Dispose();
                entity.Dispose();

                if (Flag)
                {
                    if (this.IsTextBox)
                    {
                        this.txtOpinion.Value = OpinionText;
                    }
                    else
                    {
                        if (this.textareaOpinion.Value == "")
                        {
                            this.textareaOpinion.Value = OpinionText;
                        }
                        this.OpinionUser.InnerHtml = ((User)Session["User"]).UserName;
                        this.OpinionDate.InnerHtml = DateTime.Now.ToShortDateString();
                    }
                }
                else
                {
                    if (this.IsTextBox)
                    {
                        this.lblOpinion.Text = OpinionText;
                    }
                    else
                    {
                        this.divOpinion.InnerHtml  = OpinionText.Replace("\n", "<br>");
                        this.OpinionUser.InnerHtml = OpinionUser;
                        this.OpinionDate.InnerHtml = OpinionDate;
                    }
                }
            }
            else
            {
                if (Flag)
                {
                    if (this.IsTextBox)
                    {
                        this.txtOpinion.Value = "";
                    }
                    else
                    {
                        if (this.textareaOpinion.Value == "")
                        {
                            this.textareaOpinion.Value = "";
                        }
                        this.OpinionUser.InnerHtml = ((User)Session["User"]).UserName;
                        this.OpinionDate.InnerHtml = DateTime.Now.ToShortDateString();
                    }
                }
            }
        }