예제 #1
0
        /// <summary>
        /// 获取通讯录列表
        /// </summary>
        /// <param name="context"></param>
        /// <param name="msg"></param>
        /// <param name="P1"></param>
        /// <param name="P2"></param>
        /// <param name="UserInfo"></param>
        public void GETUSERTXLLIST_PAGE(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            string strWhere = string.Format(" txl.CRUser='******'  and txl.ComId={1}", UserInfo.User.UserName, UserInfo.User.ComId);

            if (P1 != "")
            {
                strWhere += string.Format(" And txl.LXName like  '%{0}%'", P1);
            }
            if (P2 != "")
            {
                strWhere += string.Format(" And txl.TagName='{0}'", P2);
            }
            int page = 0;

            int.TryParse(context.Request["p"] ?? "1", out page);
            int       total = 0;
            DataTable dt    = new SZHL_TXLB().GetDataPager("SZHL_TXL  txl inner join JH_Auth_UserCustomData data on txl.TagName=data.ID", "txl.*,data.DataContent", 8, page, " txl.CRDate desc", strWhere, ref total);

            msg.Result  = dt;
            msg.Result1 = Math.Ceiling(total * 1.0 / 8);
        }
예제 #2
0
        /// <summary>
        /// 添加记事本
        /// </summary>
        /// <param name="context"></param>
        /// <param name="msg"></param>
        /// <param name="P1"></param>
        /// <param name="P2"></param>
        /// <param name="UserInfo"></param>
        public void ADDTXL(HttpContext context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            SZHL_TXL TXL = JsonConvert.DeserializeObject <SZHL_TXL>(P1);

            if (TXL.LXName.Trim() == "")
            {
                msg.ErrorMsg = "联系人姓名不能为空";
                return;
            }

            if (TXL.ID == 0)
            {
                List <SZHL_TXL> txl1 = new SZHL_TXLB().GetEntities(d => d.LXHM == TXL.LXHM).ToList();
                if (txl1.Count() > 0)
                {
                    msg.ErrorMsg = "此手机号联系人已存在";
                    return;
                }
                List <SZHL_TXL> txl2 = new SZHL_TXLB().GetEntities(d => d.LXMail == TXL.LXMail).ToList();
                if (txl2.Count() > 0)
                {
                    msg.ErrorMsg = "此邮箱手机号联系人已存在";
                    return;
                }
                TXL.CRDate  = DateTime.Now;
                TXL.CRUser  = UserInfo.User.UserName;
                TXL.UPDDate = DateTime.Now;
                TXL.UPUser  = UserInfo.User.UserName;
                TXL.ComId   = UserInfo.User.ComId;
                new SZHL_TXLB().Insert(TXL);
            }
            else
            {
                TXL.UPDDate = DateTime.Now;
                TXL.UPUser  = UserInfo.User.UserName;
                new SZHL_TXLB().Update(TXL);
            }
            msg.Result = TXL;
        }