Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            EmpVoiceAskQuestion ent = null;

            switch (this.RequestAction)
            {
            case RequestActionEnum.Delete:
                ent = this.GetTargetData <EmpVoiceAskQuestion>();
                ent.DoDelete();
                this.SetMessage("删除成功!");
                break;

            default:
                if (RequestActionString == "batchdelete")
                {
                    DoBatchDelete();
                }
                else if (RequestActionString == "ischeck")
                {
                    Ischeck();
                }
                else
                {
                    DoSelect();
                }
                break;
            }
        }
        private void Doselect()
        {
            EmpVoiceAskQuestion ent = null;

            if (op != "c" && op != "cs")
            {
                if (!String.IsNullOrEmpty(id))
                {
                    ent = EmpVoiceAskQuestion.Find(id);
                }
                this.SetFormData(ent);
            }
            else
            {
                var Ent = SysUser.FindFirstByProperties("UserID", UserInfo.UserID);
                //公司与部门
                string SQL = @"select B.GroupID As CompanyId,B.Name As CompanyName,C.GroupID AS DeptId,C.Name As DeptName
                        from  sysuser As A
	                        left join sysgroup As B
	                        on A.pk_corp=B.groupID
                        left join sysgroup As C
	                        on C.GroupID=A.pk_deptdoc
                        where A.UserID='{0}'";
                SQL = string.Format(SQL, UserInfo.UserID);
                DataTable Dt1 = DataHelper.QueryDataTable(SQL);

                string CompanyName = string.Empty, CompanyId = string.Empty;
                string DeptName = string.Empty, DeptId = string.Empty;

                if (Dt1.Rows.Count > 0)
                {
                    CompanyName = Dt1.Rows[0]["CompanyName"].ToString();
                    CompanyId   = Dt1.Rows[0]["CompanyId"].ToString();
                    DeptId      = Dt1.Rows[0]["DeptId"].ToString();
                    DeptName    = Dt1.Rows[0]["DeptName"].ToString();
                }

                if (Ent != null)
                {
                    var Obj = new
                    {
                        UserId     = Ent.UserID,
                        UserName   = Ent.Name,
                        Sex        = Ent.Sex,
                        Age        = Ent.Wage,
                        WorkNo     = Ent.WorkNo,
                        IndutyData = Ent.Indutydate,

                        CorpName = CompanyName,
                        CorpId   = CompanyId,
                        DeptId   = DeptId,
                        DeptName = DeptName,
                    };
                    this.SetFormData(Obj);
                }
            }

            this.PageState.Add("QuestionEnum", SysEnumeration.GetEnumDict("QuestionType"));
        }
Beispiel #3
0
 /// <summary>
 /// 查询
 /// </summary>
 private void DoSelect()
 {
     SearchCriterion.SetSearch("CreateId", UserInfo.UserID);
     SearchCriterion.SetOrder("CreateTime", false);
     ents = EmpVoiceAskQuestion.FindAll(SearchCriterion);
     this.PageState.Add("DataList", ents);
     this.PageState.Add("QuestionEnum", SysEnumeration.GetEnumDict("QuestionType"));
 }
        private void DoBatchDelete()
        {
            IList <object> idList = RequestData.GetList <object>("IdList");

            if (idList != null && idList.Count > 0)
            {
                EmpVoiceAskQuestion.DoBatchDelete(idList.ToArray());
            }
        }
Beispiel #5
0
        private void DoCreate()
        {
            string Anonymity  = RequestData.Get("Anonymity") + "";
            string Answer     = RequestData.Get("Answer") + "";
            string QuestionId = RequestData.Get("QuestionId") + "";

            var QEnt = EmpVoiceAskQuestion.Find(QuestionId);

            if (QEnt != null)
            {
                QEnt.AnswerCount = QEnt.AnswerCount.GetValueOrDefault() + 1;
                QEnt.DoUpdate();
            }

            ent           = this.GetPostedData <EmpVoiceAnswerInfo>();
            ent.Anonymity = Anonymity;

            ent.DoCreate();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            op       = RequestData.Get <string>("op");
            id       = RequestData.Get <string>("id");
            type     = RequestData.Get <string>("type");
            Question = this.RequestData.Get("QuestionId") + "";
            EmpVoiceAskQuestion ent = null;

            switch (RequestActionString)
            {
            case "Reply":
                DoRepply();
                break;

            case "GetCommentPg":
                GetCommentPg();
                break;

            case "GetReplyPg":
                GetReplyPg();
                break;

            case "RendReply":    //默认回复
                GetDefaultReply();
                break;

            default:
                DoSelect();
                break;
                //if (op != "c" && op != "cs")
                //{
                //    if (!String.IsNullOrEmpty(id))
                //    {
                //        ent = EmpVoiceAskQuestion.Find(id);
                //    }

                //    this.SetFormData(ent);
                //}
            }
        }
        string type = String.Empty; // 对象类型

        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            op   = RequestData.Get <string>("op");
            id   = RequestData.Get <string>("id");
            type = RequestData.Get <string>("type");

            EmpVoiceAskQuestion ent = null;

            switch (this.RequestAction)
            {
            case RequestActionEnum.Update:
                ent = this.GetMergedData <EmpVoiceAskQuestion>();
                ent.DoUpdate();
                this.PageState.Add("Ent", ent);
                break;

            case RequestActionEnum.Insert:
            case RequestActionEnum.Create:
                string Anonymity = this.RequestData.Get("Anonymity") + "";
                ent           = this.GetPostedData <EmpVoiceAskQuestion>();
                ent.Anonymity = Anonymity;     //1 表示匿名
                ent.DoCreate();

                break;

            case RequestActionEnum.Delete:
                ent = this.GetTargetData <EmpVoiceAskQuestion>();
                ent.DoDelete();

                return;

            default:
                Doselect();
                break;
            }
        }
Beispiel #8
0
 /// <summary>
 /// 查询
 /// </summary>
 private void DoSelect()
 {
     ents = EmpVoiceAskQuestion.FindAll(SearchCriterion);
     this.PageState.Add("EmpVoiceAskQuestionList", ents);
 }