Ejemplo n.º 1
0
        public SingleRsp CreateContact(ContactReq contact)
        {
            var     res = new SingleRsp();
            Contact c   = new Contact();

            c.FullName    = contact.FullName;
            c.Email       = contact.Email;
            c.PhoneNumber = contact.PhoneNumber;
            c.Message     = contact.Message;

            res = _rep.CreateContact(c);
            return(res);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取联系人列表
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public ContactRes GetContacts(ContactReq req)
        {
            var res = new ContactRes();

            if (req == null)
            {
                res.isErrMsg = true;
                res.errMsg   = "参数错误";
                return(res);
            }
            res.ContactList = cbDal.GetContacts(req);
            return(res);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 获取联系人列表
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        public List <ContactListItem> GetContacts(ContactReq req)
        {
            var retList = new List <ContactListItem>();

            using (var context = WDbContext())
            {
                string strSql = @"select u.User_Name,u.User_ID,u.User_Code,i.PropertyInstance_Value as MobliePhoneNo,o.Organization_Name,o.Organization_Code
                                    from 
                                    Base_UserInfo u left join Base_StaffOrganize s on u.User_ID=s.User_ID
                                    left join Base_Organization o on o.Organization_ID=s.Organization_ID
                                    left join Base_AppendPropertyInstance i on u.User_ID=i.PropertyInstance_Key and i.Property_Control_ID='User_Telphone'
                                    where u.DeleteMark=1 and o.DeleteMark=1
                                     order by o.Organization_Code asc,u.User_Code";
                retList = context.Sql(strSql)
                          .QueryMany <ContactListItem>();
                return(retList);
            }
        }
Ejemplo n.º 4
0
        public IActionResult CreateContact([FromBody] ContactReq req)
        {
            var res = _svc.CreateContact(req);

            return(Ok(res));
        }