コード例 #1
0
            /// <summary>
            /// 组织架构变更通知
            /// </summary>
            /// <param name="sdkEntity"></param>
            /// <returns></returns>
            internal static OrganizationModify GetOrganizationModify(MsOrganizationModify sdkEntity)
            {
                if (sdkEntity == null)
                {
                    return(null);
                }
                var sdkreceivemsgtypeValue = (long)sdkEntity.MsgType;
                var antsdkreceivemsgType   = (AntSdkMsgType)sdkreceivemsgtypeValue;
                var antsdkEntity           = new OrganizationModify
                {
                    MsgType     = antsdkreceivemsgType,
                    dataVersion = sdkEntity.dataVersion,
                    attr        = sdkEntity.attr
                };

                return(antsdkEntity);
            }
コード例 #2
0
        public ApiResult Modify([FromBody] OrganizationModify model)
        {
            result = AccessToken.Check(model.access_token, "api/org/modify");
            if (result == null)
            {
                result = ParameterCheck.CheckParameters(model);
                if (result == null)
                {
                    #region 参数验证
                    #endregion

                    #region 逻辑操作
                    T_Organization orgModel = db.T_Organization.Find(model.OrgID);
                    if (orgModel != null)
                    {
                        try
                        {
                            orgModel.Name = model.Name;
                            db.SaveChanges();
                            return(Success("修改成功"));
                        }
                        catch
                        {
                            return(Success("修改失败,请检查参数是否正确"));
                        }
                    }
                    else
                    {
                        return(Error("数据错误,无法查找到此条记录"));
                    }
                    #endregion
                }
                return(result);
            }
            return(result);
        }