public string SaveTagsType(string pRequest)
        {
            var rp = pRequest.DeserializeJSONTo <APIRequest <SaveTagsTypeRP> >();
            var loggingSessionInfo = new SessionManager().CurrentUserLoginInfo;
            var rd = new SaveTagsTypeRD();//返回值

            var _TagsTypeInfo = rp.Parameters.TagsTypeInfo;

            if (string.IsNullOrEmpty(_TagsTypeInfo.TypeName))
            {
                throw new APIException("缺少参数【TypeName】或参数值为空")
                      {
                          ErrorCode = 135
                      };
            }
            TagsTypeEntity TagsTypeEn = new TagsTypeEntity();
            bool           isNew      = false;

            if (string.IsNullOrEmpty(_TagsTypeInfo.TypeId))
            {
                _TagsTypeInfo.TypeId = Guid.NewGuid().ToString();
                isNew = true;
            }
            TagsTypeEn.TypeId   = _TagsTypeInfo.TypeId;
            TagsTypeEn.TypeName = _TagsTypeInfo.TypeName;

            TagsTypeEn.LastUpdateBy   = loggingSessionInfo.UserID;
            TagsTypeEn.LastUpdateTime = DateTime.Now;
            TagsTypeEn.IsDelete       = 0;
            string error = "";
            //service.SaveProp(propInfo, ref error);
            TagsTypeBLL TagsTypeBLL = new TagsTypeBLL(loggingSessionInfo);

            if (isNew)
            {
                TagsTypeEn.CreateBy   = loggingSessionInfo.UserID;
                TagsTypeEn.CreateTime = DateTime.Now;
                TagsTypeBLL.Create(TagsTypeEn);
            }
            else
            {
                TagsTypeBLL.Update(TagsTypeEn, false);
            }
            TagsBLL TagsBLL = new TagsBLL(loggingSessionInfo);

            if (!isNew)//不是新的
            {
                string propIds = "";
                foreach (var itemInfo in _TagsTypeInfo.TagsList)//数组,更新数据
                {
                    if (!string.IsNullOrEmpty(itemInfo.TagsId))
                    {
                        if (propIds != "")
                        {
                            propIds += ",";
                        }
                        propIds += "'" + itemInfo.TagsId + "'";
                    }
                }
                //删除不在这个里面的
                if (!string.IsNullOrEmpty(propIds))
                {
                    TagsBLL.DeleteByIds(propIds, TagsTypeEn);
                }
            }


            foreach (var itemInfo in _TagsTypeInfo.TagsList)//数组,更新数据
            {
                TagsEntity TagsEn = new TagsEntity();

                TagsEn.TagsName       = itemInfo.TagsName;
                TagsEn.TagsDesc       = itemInfo.TagsName;
                TagsEn.LastUpdateBy   = rp.UserID;
                TagsEn.LastUpdateTime = DateTime.Now;
                TagsEn.IsDelete       = 0;
                TagsEn.CustomerId     = loggingSessionInfo.ClientID;
                TagsEn.TypeId         = TagsTypeEn.TypeId;

                if (string.IsNullOrEmpty(itemInfo.TagsId))
                {
                    TagsEn.TagsId     = Guid.NewGuid().ToString();
                    TagsEn.CreateBy   = rp.UserID;
                    TagsEn.CreateTime = DateTime.Now;
                    TagsBLL.Create(TagsEn);
                }
                else
                {
                    TagsEn.TagsId = itemInfo.TagsId;
                    TagsBLL.Update(TagsEn, false);
                }
            }



            var rsp = new SuccessResponse <IAPIResponseData>(rd);

            return(rsp.ToJSON());
        }