示例#1
0
        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();
        }