コード例 #1
0
ファイル: AddDataMemo.aspx.cs プロジェクト: windygu/XiaZhou
        /// <summary>
        /// 初始化数据
        /// </summary>
        private void IntoData()
        {
            BIndividual bllBIndividual = new BIndividual();

            #region 初始化修改实体
            string memoid = Utils.GetQueryStringValue("Id");
            hidid.Value = memoid;
            if (!string.IsNullOrEmpty(memoid))
            {
                MMemo modelMMemo = new MMemo();
                modelMMemo = bllBIndividual.GetMemo(Utils.GetInt(memoid));
                if (modelMMemo != null)
                {
                    txtMemoTitle.Text            = modelMMemo.MemoTitle;
                    txtMemoTime.Text             = modelMMemo.MemoTime.ToShortDateString();
                    txtMemoText.Text             = modelMMemo.MemoText;
                    dropMemoState.SelectedValue  = ((int)modelMMemo.MemoState).ToString();
                    dropMemoUrgent.SelectedValue = ((int)modelMMemo.UrgentType).ToString();
                }
            }
            #endregion

            #region 绑定列表
            IList <MMemo> list = bllBIndividual.GetMemoLst(0, SiteUserInfo.UserId, Utils.GetDateTimeNullable(hidstart.Value), Utils.GetDateTimeNullable(hidstart.Value));
            if (list != null && list.Count > 0)
            {
                rptList.DataSource = list;
                rptList.DataBind();
            }
            #endregion
        }
コード例 #2
0
ファイル: AddDataMemo.aspx.cs プロジェクト: windygu/XiaZhou
        private void AddMemo()
        {
            string      result         = "";
            BIndividual bllBIndividual = new BIndividual();
            MMemo       modelMMemo     = new MMemo();

            if (!string.IsNullOrEmpty(hidid.Value))
            {
                modelMMemo = bllBIndividual.GetMemo(Utils.GetInt(hidid.Value));
            }
            #region 备忘录属性
            //备忘时间
            string txtMemoTime = Utils.GetFormValue("txtMemoTime");
            //事件紧急程度
            string dropUrgentType = Utils.GetFormValue("dropMemoUrgent");
            //完成状态
            string dropMemoState = Utils.GetFormValue("dropMemoState");
            //事件标题
            string txtMemoTitle = Utils.GetFormValue("txtMemoTitle");
            //事件详细
            string txtMemoText = Utils.GetFormValue("txtMemoText");
            #endregion
            modelMMemo.MemoTime   = Utils.GetDateTime(txtMemoTime);
            modelMMemo.UrgentType = (MemoUrgent)Utils.GetInt(dropUrgentType);
            modelMMemo.MemoState  = (MemoState)Utils.GetInt(dropMemoState);
            modelMMemo.MemoTitle  = txtMemoTitle;
            modelMMemo.MemoText   = txtMemoText;
            if (!string.IsNullOrEmpty(hidid.Value))
            {
                if (bllBIndividual.UpdateMemo(modelMMemo))
                {
                    result = UtilsCommons.AjaxReturnJson("true", "修改成功");
                }
                else
                {
                    result = UtilsCommons.AjaxReturnJson("false", "修改失败");
                }
            }
            else
            {
                modelMMemo.OperatorId = SiteUserInfo.UserId;
                modelMMemo.IssueTime  = DateTime.Now;
                modelMMemo.CompanyId  = SiteUserInfo.CompanyId;
                if (bllBIndividual.AddMemo(modelMMemo))
                {
                    result = UtilsCommons.AjaxReturnJson("true", "添加成功");
                }
                else
                {
                    result = UtilsCommons.AjaxReturnJson("false", "添加失败");
                }
            }

            Response.Clear();
            Response.Write(result);
            Response.End();
        }
コード例 #3
0
ファイル: MemoInfo.aspx.cs プロジェクト: windygu/XiaZhou
        /// <summary>
        /// 初始化数据
        /// </summary>
        private void IntoDate(string id)
        {
            BIndividual bllBIndividual = new BIndividual();

            #region 初始化修改实体
            if (!string.IsNullOrEmpty(id))
            {
                MMemo modelMMemo = new MMemo();
                modelMMemo = bllBIndividual.GetMemo(Utils.GetInt(id));
                if (modelMMemo != null)
                {
                    //时间
                    litTime.Text = modelMMemo.IssueTime.ToString();
                    //备忘录状态
                    litMemoState.Text = modelMMemo.MemoState.ToString();
                    //备忘录内容
                    litMemoText.Text = modelMMemo.MemoText;
                    //备忘录标题
                    littitle.Text = modelMMemo.MemoTitle;
                    //备忘录紧急程度
                    litMemoUrgent.Text = modelMMemo.UrgentType.ToString();
                }
                else
                {
                    Response.Clear();
                    Response.Write("数据为空");
                    Response.End();
                }
            }
            else
            {
                Response.Clear();
                Response.Write("参数为空");
                Response.End();
            }
            #endregion
        }