public async Task<List<string>> DeleteFiles(SingleData<List<string>> request, SystemSession session) { var serviceRequest = new List<Elif>(); request.Data.ForEach(x => serviceRequest.Add(new Elif { FileId = x, Username = session.UserName })); var response = await Task.Factory.StartNew(() => Client.ElifService.deleteFiles(serviceRequest, session.GetSession())).ConfigureAwait(false); return response; }
public async Task<PaginatedResponse<IEnumerable<CompanyReviewResponse>>> GetCompanyReviews(SingleData<int> request, int pageIndex, int pageSize, SystemSession session) { var serviceRequest = new CompanyReview { CompanyId = request.Data, OffSet = pageIndex, PageSize = pageSize }; var response = await Task.Factory.StartNew(() => Client.UserService.getCompanyReviews(serviceRequest, session.GetSession())).ConfigureAwait(false); var result = new PaginatedResponse<IEnumerable<CompanyReviewResponse>> { HasNextPage = response.HasNextPage, Page = response.CompanyReviews.Select( x => new CompanyReviewResponse { CompanyReviewGuid = x.CompanyReviewGUID != null ? Guid.Parse(x.CompanyReviewGUID) : Guid.Empty, User = new UserResponse { UserId = x.UserId, UserName = x.Username, Name = x.Name, Picture = x.PictureUrl }, Star = x.Star, Title = x.Title, Comment = x.Comment, DateCommented = x.DateCommented != null ? Convert.ToDateTime(x.DateCommented) : (DateTime?)null, IsApproved = x.IsApproved }) }; return result; }
public virtual async Task<IEnumerable<BaseInfoResponse>> GetBasicUsersInformation(SingleData<List<string>> request, SystemSession session) { IEnumerable<BaseInfoResponse> response = null; var result = await Task.Factory.StartNew( () => Client.UserService.getUsersInfo(String.Join(",", request.Data), session.GetSession())) .ConfigureAwait(false); if (result.Any()) { response = result.Select(x => new BaseInfoResponse { UserId = Convert.ToInt32(x.UserId), UserName = x.UserName, UserTypeId = (SystemUserType)x.UserTypeId, Picture = x.Picture, Title = x.Title, Email = x.Email, FirstName = x.FirstName, LastName = x.LastName }); } return response; }
public async Task<StatusData<string>> DeleteEmployment(SingleData<int> request, SystemSession session) { var serviceRequest = new Employment { UserId = session.UserId, Mode = (byte)SystemDbStatus.Deleted, PersonEmploymentId = request.Data }; var response = await Task.Factory.StartNew(() => Client.UserService.upsertEmployeementHistory(serviceRequest, session.GetSession())).ConfigureAwait(false); var result = new StatusData<string> { Status = (SystemDbStatus)response.DbStatus.DbStatusCode, Message = response.DbStatus.DbStatusMsg, SubStatus = response.DbStatus.DbSubStatusCode }; return result; }
public async Task<HttpResponseMessage> BasicUsers(SingleData<List<string>> request) { var response = new StatusData<IEnumerable<BaseInfoResponse>> { Status = SystemDbStatus.Unauthorized }; for (var index = 0; index < request.Data.Count; ++index) { var user = request.Data[index]; if (!(user.IsMatch(x => user, RegexPattern.UserName, ActionContext, ModelState) && Validation.StringLength(user, x => user, 6, 30, ActionContext, ModelState)) && !user.IsMatch(x => user, RegexPattern.Numeric, ActionContext, ModelState) && !(user.IsMatch(x => user, RegexPattern.Email, ActionContext, ModelState))) return ActionContext.Response; if (!Validation.Required(user, x => user, ActionContext, ModelState)) return ActionContext.Response; } response.Data = await _profileService.GetBasicUsersInformation(request, Request.GetSession()).ConfigureAwait(false); response.Status = SystemDbStatus.Selected; return Request.SystemResponse(response); }
public Task<StatusData<bool>> SaveProfilePicture(string username, SingleData<string> request) { return _jUnitOfWork.Profile.SaveProfilePicture(username, request); }
public Task<object> GetInstance(SingleData<string> request, SystemSession session) { return _jUnitOfWork.Chat.GetInstance(request, session); }
public Task<StatusData<long>> DeleteRule(SingleData<GeneralKvPair<long, int>> request, SystemSession session) { return _jUnitOfWork.Inbox.DeleteRule(request, session); }
public Task<StatusData<string>> FlushContact(SingleData<GeneralKvPair<long, List<int>>> chatNetworks, SingleData<GeneralKvPair<long, List<long>>> customContacts, SystemSession session) { // return _unitOfWork.Profile.FlushContact(userId, chatNetworks, customContacts); return _jUnitOfWork.Profile.FlushContact(chatNetworks, customContacts, session); }
public Task<StatusData<string>> DeleteEmployment(SingleData<int> request, SystemSession session) { return _jUnitOfWork.ProfilePersonal.DeleteEmployment(request, session); }
void EditorLanguageFieldGUI( ) { if (string.IsNullOrEmpty(selectEditorModuleName)) { return; } if (string.IsNullOrEmpty(m_currentLanguage)) { return; } List <string> languageKeyList = s_languageKeyDict[selectEditorModuleName]; DataTable data = null; if (m_langeuageDataDict.ContainsKey(selectEditorModuleName)) { data = m_langeuageDataDict[selectEditorModuleName]; } EditorGUI.indentLevel++; AddLangeuageFieldGUI(languageKeyList); EditorGUILayout.Space(); EditorDrawGUIUtil.DrawScrollView(languageKeyList, () => { for (int i = 0; i < languageKeyList.Count; i++) { string key = languageKeyList[i]; if (!string.IsNullOrEmpty(searchModuleKey)) { if (!key.Contains(searchModuleKey)) { continue; } } GUILayout.Space(5); GUILayout.BeginVertical("HelpBox"); EditorGUILayout.BeginHorizontal(); string content = ""; if (data != null) { if (!data.ContainsKey(key)) { SingleData sd = new SingleData(); sd.Add(LanguageManager.c_mainKey, key); sd.Add(LanguageManager.c_valueKey, ""); data.AddData(sd); } content = data[key].GetString(LanguageManager.c_valueKey); } if (GUILayout.Button("X", GUILayout.Width(20))) { if (EditorUtility.DisplayDialog("提示", "确定删除key", "OK", "Cancel")) { languageKeyList.RemoveAt(i); data.Remove(key); return; } } GUILayout.Label(key); GUILayout.FlexibleSpace(); if (GUILayout.Button("CopyPath")) { string tempContent = selectEditorModuleName.Replace('_', '/'); tempContent += "/" + key; TextEditor tx = new TextEditor(); tx.text = tempContent; tx.OnFocus(); tx.Copy(); ShowNotification(new GUIContent("已复制")); } EditorGUILayout.EndHorizontal(); content = EditorGUILayout.TextArea(content); if (data != null) { data[key][LanguageManager.c_valueKey] = content; } GUILayout.EndVertical(); } }, "box"); }
public async Task <IEnumerable <EmployeeWorkScheduleResponse> > GetEmploymentWorkSchedule(SingleData <long> request, SystemSession session) { var response = await Task.Factory.StartNew(() => Client.UserService.getEmployeeWorkSchedule(request.Data, session.GetSession())).ConfigureAwait(false); var result = response.Select(x => new EmployeeWorkScheduleResponse { EmployeeType = (SystemEmployeeType)Convert.ToInt32(x.EmployeeType), Day = (SystemDayOfWeek)x.Day, StartTime = TimeSpan.Parse(x.StartTime), EndTime = TimeSpan.Parse(x.EndTime), ScheduleType = x.ScheduleType ? SystemWorkSchedule.Fixed : SystemWorkSchedule.Flexible }); return(result); }
void EditorDataGUI() { m_isEditorFold = EditorGUILayout.Foldout(m_isEditorFold, "编辑数据"); EditorGUI.indentLevel++; if (m_isEditorFold) { List <string> keys = m_currentData.TableKeys; m_EditorPos = EditorGUILayout.BeginScrollView(m_EditorPos, GUILayout.ExpandHeight(false)); for (int i = 0; i < keys.Count; i++) { string key = keys[i]; FieldType type = m_currentData.GetFieldType(key); int EnumTypeIndex = EditorTool.GetAllEnumTypeIndex(m_currentData.GetEnumType(key)); if (i == 0) { EditorGUILayout.LabelField("<主键>字段名", key); EditorGUILayout.LabelField("字段类型", m_currentData.GetFieldType(keys[i]).ToString()); } else { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("字段名", key); if (GUILayout.Button("删除字段")) { if (EditorUtility.DisplayDialog("警告", "确定要删除该字段吗?", "是", "取消")) { DeleteField(m_currentData, key); continue; } } EditorGUILayout.EndHorizontal(); bool isNewType = false; m_editorNoteContent = EditorGUILayout.TextField("注释", m_currentData.GetNote(key)); m_currentData.SetNote(key, m_editorNoteContent); m_editorNewType = (FieldType)EditorGUILayout.EnumPopup("字段类型", type); if (m_editorNewType == FieldType.Enum) { m_editorNewEnumIndex = EditorGUILayout.Popup("枚举类型", EnumTypeIndex, EditorTool.GetAllEnumType()); if (EnumTypeIndex != m_editorNewEnumIndex) { isNewType = true; } } if (type != m_editorNewType) { isNewType = true; } if (isNewType) { //弹出警告并重置数据 if (EditorUtility.DisplayDialog("警告", "改变字段类型会重置该字段的所有数据和默认值\n是否继续?", "是", "取消")) { m_currentData.SetFieldType(key, m_editorNewType, EditorTool.GetAllEnumType()[m_editorNewEnumIndex]); ResetDataField(m_currentData, key, m_editorNewType, EditorTool.GetAllEnumType()[m_editorNewEnumIndex]); type = m_editorNewType; EnumTypeIndex = m_editorNewEnumIndex; content = new SingleData(); } } string newContent; if (type == FieldType.Enum) { newContent = EditorUtilGUI.FieldGUI_Type(type, EditorTool.GetAllEnumType()[EnumTypeIndex], m_currentData.GetDefault(key), "默认值"); } else { newContent = EditorUtilGUI.FieldGUI_Type(type, null, m_currentData.GetDefault(key), "默认值"); } m_currentData.SetDefault(key, newContent); } EditorGUILayout.Space(); } EditorGUILayout.EndScrollView(); AddFieldGUI(); } }
public Task <StatusData <string> > UpdatePushCode(SingleData <string> request, SystemSession session) { return(_jUnitOfWork.Chat.UpdatePushCode(request, session)); }
//public Task<StatusData<string>> SaveGroup(GroupUserRequest request, SystemSession session) //{ // return _jUnitOfWork.Message.SaveGroup(request, session); //} //public Task<IEnumerable<string>> GetGroups(SystemSession session) //{ // return _jUnitOfWork.Message.GetGroups(session); //} public Task <StatusData <string> > BlockUnBlockInstances(SingleData <List <string> > request, SystemSession session) { return(_jUnitOfWork.Chat.BlockUnBlockInstances(request, session)); }
public Task <object> GetInstance(SingleData <string> request, SystemSession session) { return(_jUnitOfWork.Chat.GetInstance(request, session)); }
void EditorLanguageFieldGUI() { if (string.IsNullOrEmpty(selectFullFileName)) { return; } if (currentFileDataTable == null) { return; } DataTable data = currentFileDataTable; List <string> languageKeyList = data.TableIDs; //Debug.Log("languageKeyList :" + languageKeyList.Count); AddLangeuageFieldGUI(languageKeyList); EditorGUILayout.Space(); EditorDrawGUIUtil.DrawScrollView(languageKeyList, () => { for (int i = 0; i < languageKeyList.Count; i++) { string key = languageKeyList[i]; if (!string.IsNullOrEmpty(searchKey)) { if (!key.Contains(searchKey)) { continue; } } GUILayout.Space(5); GUILayout.BeginVertical("HelpBox"); EditorGUILayout.BeginHorizontal(); string content = ""; if (data != null) { if (!data.ContainsKey(key)) { SingleData sd = new SingleData(); sd.Add(LanguageManager.c_mainKey, key); sd.Add(LanguageManager.c_valueKey, ""); data.AddData(sd); } content = data[key].GetString(LanguageManager.c_valueKey); } if (GUILayout.Button("X", GUILayout.Width(20))) { if (EditorUtility.DisplayDialog("提示", "确定删除key", "OK", "Cancel")) { DeleteKey(selectFullFileName, key); Init(); return; } } string showKeyValue = key; if (currentLanguage != config.defaultLanguage) { showKeyValue += ":" + GetLanguageValue(config.defaultLanguage, selectFullFileName, key); } GUIStyle styleLable = "Label"; styleLable.wordWrap = true; styleLable.richText = richText; styleLable.alignment = TextAnchor.MiddleLeft; // EditorGUILayout.SelectableLabel(key, styleLable); EditorGUILayout.SelectableLabel(showKeyValue, styleLable); // GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUIStyle style = "TextArea"; style.wordWrap = true; style.richText = richText; content = EditorGUILayout.TextArea(content, style); if (data != null) { data[key][LanguageManager.c_valueKey] = content; } if (GUILayout.Button("CopyPath", GUILayout.Width(75))) { string tempContent = selectFullFileName; tempContent += "/" + key; TextEditor tx = new TextEditor(); tx.text = tempContent; tx.OnFocus(); tx.Copy(); ShowNotification(new GUIContent("已复制")); } GUILayout.EndHorizontal(); GUILayout.EndVertical(); } }, "box"); }
public string m_SkillAgency; //代放技能 public override void LoadData(string key) { DataTable table = DataManager.GetData("SkillData"); if (!table.ContainsKey(key)) { throw new Exception("SkillDataGenerate LoadData Exception Not Fond key ->" + key + "<-"); } SingleData data = table[key]; m_key = key; m_name = data.GetString("name"); m_info = data.GetString("info"); m_icon = data.GetString("icon"); m_HitFXName = data.GetString("HitFXName"); m_EffectArea = data.GetString("EffectArea"); m_DamageValue = data.GetInt("DamageValue"); m_HurtSFXDelay = data.GetFloat("HurtSFXDelay"); m_HurtSFX = data.GetString("HurtSFX"); m_CanBreak = data.GetBool("CanBreak"); m_BlowFlyID = data.GetString("BlowFlyID"); m_HurtBuff = data.GetStringArray("HurtBuff"); m_CD = data.GetFloat("CD"); m_Moment = data.GetBool("Moment"); m_TriggerSpaceTime = data.GetFloat("TriggerSpaceTime"); m_allowMove = data.GetBool("allowMove"); m_noclip = data.GetBool("noclip"); m_FlyObjectArea = data.GetString("FlyObjectArea"); m_FlyDamageValue = data.GetInt("FlyDamageValue"); m_FlyObjectName = data.GetStringArray("FlyObjectName"); m_flydistance = data.GetFloat("flydistance"); m_uplv = data.GetInt("uplv"); m_nextskill = data.GetString("nextskill"); m_moneytype = data.GetInt("moneytype"); m_moneynum = data.GetInt("moneynum"); m_material = data.GetInt("material"); m_materialnum = data.GetInt("materialnum"); m_BeforeStatus = data.GetString("BeforeStatus"); m_CurrentStatus = data.GetString("CurrentStatus"); m_LaterStatus = data.GetString("LaterStatus"); m_RaiseTime = data.GetFloat("RaiseTime"); m_HitTime = data.GetFloat("HitTime"); m_HitFXCreatPoint = data.GetEnum <HardPointEnum>("HitFXCreatPoint"); m_AreaTexture = data.GetString("AreaTexture"); m_DamagePer = data.GetFloat("DamagePer"); m_RecoverValue = data.GetFloat("RecoverValue"); m_ReValuep = data.GetFloat("ReValuep"); m_HurtCameraShoke = data.GetString("HurtCameraShoke"); m_flydamageper = data.GetFloat("flydamageper"); m_FlyCreatPoint = data.GetEnum <HardPointEnum>("FlyCreatPoint"); m_CanBeBreakInC = data.GetBool("CanBeBreakInC"); m_CanBeBreak = data.GetBool("CanBeBreak"); m_MoveID = data.GetString("MoveID"); m_SelfBuff = data.GetStringArray("SelfBuff"); m_RecoverBuff = data.GetStringArray("RecoverBuff"); m_SummonMonster = data.GetStringArray("SummonMonster"); m_AffectTrap = data.GetBool("AffectTrap"); m_IsAreaTip = data.GetBool("IsAreaTip"); m_SkillAgency = data.GetString("SkillAgency"); }
//public Task<StatusData<string>> SaveGroup(GroupUserRequest request, SystemSession session) //{ // return _jUnitOfWork.Message.SaveGroup(request, session); //} //public Task<IEnumerable<string>> GetGroups(SystemSession session) //{ // return _jUnitOfWork.Message.GetGroups(session); //} public Task<StatusData<string>> BlockUnBlockInstances(SingleData<List<string>> request, SystemSession session) { return _jUnitOfWork.Chat.BlockUnBlockInstances(request, session); }
public Task<StatusData<string>> UpdateLanguages(SingleData<List<LanguageRequest>> request, SystemSession session) { return _jUnitOfWork.ProfilePersonal.UpsertLanguage(request, session); }
SingleData EditorDataGUI(DataTable table, SingleData data) { try { List <string> keys = table.TableKeys; for (int i = 0; i < keys.Count; i++) { string keyTmp = keys[i]; FieldType type = table.GetFieldType(keyTmp); if (i != 0) { bool cancelDefault = false; EditorGUILayout.BeginHorizontal(); if (data.ContainsKey(keyTmp)) { EditorGUILayout.LabelField("[" + keyTmp + "]"); if (GUILayout.Button("使用默认值")) { data.Remove(keyTmp); EditorGUILayout.EndHorizontal(); continue; } } else { EditorGUILayout.LabelField("[" + keyTmp + "] (默认值)"); if (GUILayout.Button("取消默认值")) { cancelDefault = true; } } EditorGUILayout.EndHorizontal(); //EditorGUI.indentLevel++; EditorGUI.indentLevel++; //非默认值情况 if (data.ContainsKey(keyTmp)) { EditorGUILayout.LabelField("字段名", keyTmp); EditorGUILayout.LabelField("注释", table.GetNote(keyTmp)); string newContent = EditorUtilGUI.FieldGUI_TypeValue(type, data[keyTmp], table.GetEnumType(keyTmp)); if (newContent != data[keyTmp]) { data[keyTmp] = newContent; } } //如果是默认值则走这里 else { EditorGUILayout.LabelField("字段名", keyTmp); EditorGUILayout.LabelField("注释", table.GetNote(keyTmp)); string newContent = ""; if (table.m_defaultValue.ContainsKey(keyTmp)) { newContent = new SingleField(type, table.GetDefault(keyTmp), table.GetEnumType(keyTmp)).m_content; } else { newContent = new SingleField(type, null, table.GetEnumType(keyTmp)).m_content; } if (type != FieldType.Enum) { EditorGUILayout.LabelField("字段类型", type.ToString()); } else { EditorGUILayout.LabelField("字段类型", type.ToString() + "/" + table.GetEnumType(keyTmp)); } EditorGUILayout.LabelField("(默认)字段内容", new SingleField(type, newContent, table.GetEnumType(keyTmp)).GetShowString()); if (cancelDefault) { data.Add(keyTmp, newContent); } } EditorGUI.indentLevel--; //EditorGUI.indentLevel--; } EditorGUILayout.Space(); } } catch (Exception e) { EditorGUILayout.TextArea(e.ToString(), EditorGUIStyleData.s_ErrorMessageLabel); } return(data); }
void CreatDataCSharpFile(string dataName, DataTable data) { if (dataName.Contains("/")) { string[] tmp = dataName.Split('/'); dataName = tmp[tmp.Length - 1]; } string className = dataName + "Generate"; string content = ""; content += "using System;\n"; content += "using UnityEngine;\n\n"; content += @"//" + className + "类\n"; content += @"//该类自动生成请勿修改,以避免不必要的损失"; content += "\n"; content += "public class " + className + " : DataGenerateBase \n"; content += "{\n"; content += "\tpublic string m_key;\n"; //type List <string> type = new List <string>(data.m_tableTypes.Keys); Debug.Log("type count: " + type.Count); if (type.Count > 0) { for (int i = 1; i < data.TableKeys.Count; i++) { string key = data.TableKeys[i]; string enumType = null; if (data.m_tableEnumTypes.ContainsKey(key)) { enumType = data.m_tableEnumTypes[key]; } string note = ";"; if (data.m_noteValue.ContainsKey(key)) { note = @"; //" + data.m_noteValue[key]; } content += "\t"; if (data.m_tableTypes.ContainsKey(key)) { //访问类型 + 字段类型 + 字段名 content += "public " + OutPutFieldName(data.m_tableTypes[key], enumType) + " m_" + key + note; } //默认字符类型 else { //访问类型 + 字符串类型 + 字段名 content += "public " + "string" + " m_" + key + note; } content += "\n"; } } content += "\n"; content += "\tpublic override void LoadData(string key) \n"; content += "\t{\n"; content += "\t\tDataTable table = DataManager.GetData(\"" + dataName + "\");\n\n"; content += "\t\tif (!table.ContainsKey(key))\n"; content += "\t\t{\n"; content += "\t\t\tthrow new Exception(\"" + className + " LoadData Exception Not Fond key ->\" + key + \"<-\");\n"; content += "\t\t}\n"; content += "\n"; content += "\t\tSingleData data = table[key];\n\n"; content += "\t\tm_key = key;\n"; if (type.Count > 0) { for (int i = 1; i < data.TableKeys.Count; i++) { string key = data.TableKeys[i]; content += "\t\t"; string enumType = null; if (data.m_tableEnumTypes.ContainsKey(key)) { enumType = data.m_tableEnumTypes[key]; } if (data.m_tableTypes.ContainsKey(key)) { content += "m_" + key + " = data." + OutPutFieldFunction(data.m_tableTypes[key], enumType) + "(\"" + key + "\")"; } //默认字符类型 else { content += "m_" + key + " = data." + OutPutFieldFunction(data.m_tableTypes[key], enumType) + "(\"" + key + "\")"; } content += ";\n"; } } content += "\t}\n"; content += "}\n"; string SavePath = Application.dataPath + "/Script/DataClassGenerate/" + className + ".cs"; ResourceIOTool.WriteStringByFile(SavePath, content.ToString()); }
public Task<IEnumerable<EmployeeWorkScheduleResponse>> GetEmploymentWorkSchedule(SingleData<long> request, SystemSession session) { return _jUnitOfWork.ProfilePersonal.GetEmploymentWorkSchedule(request, session); }
public async Task<StatusData<string>> UpdatePushCode(SingleData<string> request, SystemSession session) { await Task.Factory.StartNew(() => Client.ChatUserInfoService.updatePushCode(request.Data, session.GetSession())).ConfigureAwait(false); var result = new StatusData<string> { Status = SystemDbStatus.Updated }; return result; }
public Task<StatusData<string>> DeleteEducationHistory(SingleData<int> request, SystemSession session) { return _jUnitOfWork.ProfilePersonal.DeleteEducationHistory(request, session); }
public async Task <object> GetInstance(SingleData <string> request, SystemSession session) { var response = await Task.Factory.StartNew(() => Client.ChatUserInfoService.getInstance(request.Data, session.GetSession())).ConfigureAwait(false); return(JsonConvert.DeserializeObject(response)); }
public Task<StatusData<string>> DeleteAwardAndHonor(SingleData<long> request, SystemSession session) { return _jUnitOfWork.ProfilePersonal.DeleteAwardAndHonor(request, session); }
SingleData EditorDataGUI(DataTable table, SingleData data) { try { List<string> keys = table.TableKeys; for (int i = 0; i < keys.Count; i++) { string keyTmp = keys[i]; FieldType type = table.GetFieldType(keyTmp); if (i != 0) { bool cancelDefault = false; EditorGUILayout.BeginHorizontal(); if (data.ContainsKey(keyTmp)) { EditorGUILayout.LabelField("[" + keyTmp + "]"); if (GUILayout.Button("使用默认值")) { data.Remove(keyTmp); EditorGUILayout.EndHorizontal(); continue; } } else { EditorGUILayout.LabelField("[" + keyTmp + "] (默认值)"); if (GUILayout.Button("取消默认值")) { cancelDefault = true; } } EditorGUILayout.EndHorizontal(); //EditorGUI.indentLevel++; EditorGUI.indentLevel++; //非默认值情况 if (data.ContainsKey(keyTmp)) { EditorGUILayout.LabelField("字段名", keyTmp); EditorGUILayout.LabelField("注释", table.GetNote(keyTmp)); string newContent = EditorUtilGUI.FieldGUI_TypeValue(type, data[keyTmp], table.GetEnumType(keyTmp)); if (newContent != data[keyTmp]) { data[keyTmp] = newContent; } } //如果是默认值则走这里 else { EditorGUILayout.LabelField("字段名", keyTmp); EditorGUILayout.LabelField("注释", table.GetNote(keyTmp)); string newContent = ""; if (table.m_defaultValue.ContainsKey(keyTmp)) { newContent = new SingleField(type, table.GetDefault(keyTmp), table.GetEnumType(keyTmp)).m_content; } else { newContent = new SingleField(type, null, table.GetEnumType(keyTmp)).m_content; } if (type != FieldType.Enum) { EditorGUILayout.LabelField("字段类型", type.ToString()); } else { EditorGUILayout.LabelField("字段类型", type.ToString() + "/" + table.GetEnumType(keyTmp)); } EditorGUILayout.LabelField("(默认)字段内容", new SingleField(type, newContent, table.GetEnumType(keyTmp)).GetShowString()); if (cancelDefault) { data.Add(keyTmp, newContent); } } EditorGUI.indentLevel--; //EditorGUI.indentLevel--; } EditorGUILayout.Space(); } } catch(Exception e) { EditorGUILayout.TextArea(e.ToString(),EditorGUIStyleData.s_ErrorMessageLabel); } return data; }
public async Task<StatusData<string>> MuteUsers(SingleData<List<string>> request, SystemSession session) { await Task.Factory.StartNew(() => Client.ChatUserInfoService.saveMuteUserIds(request.Data, session.UserName, session.GetSession())).ConfigureAwait(false); var result = new StatusData<string> { Status = SystemDbStatus.Inserted }; return result; }
void EditorDataGUI() { m_isEditorFold = EditorGUILayout.Foldout(m_isEditorFold, "编辑数据"); EditorGUI.indentLevel ++; if (m_isEditorFold) { List<string> keys = m_currentData.TableKeys; m_EditorPos = EditorGUILayout.BeginScrollView(m_EditorPos, GUILayout.ExpandHeight(false)); for (int i = 0; i < keys.Count; i++) { string key = keys[i]; FieldType type = m_currentData.GetFieldType(key); int EnumTypeIndex = EditorTool.GetAllEnumTypeIndex(m_currentData.GetEnumType(key)); if (i == 0) { EditorGUILayout.LabelField("<主键>字段名", key); EditorGUILayout.LabelField("字段类型", m_currentData.GetFieldType(keys[i]).ToString()); } else { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("字段名", key); if(GUILayout.Button("删除字段")) { if (EditorUtility.DisplayDialog("警告", "确定要删除该字段吗?", "是", "取消")) { DeleteField(m_currentData, key); continue; } } EditorGUILayout.EndHorizontal(); bool isNewType = false; m_editorNoteContent = EditorGUILayout.TextField("注释", m_currentData.GetNote(key)); m_currentData.SetNote(key, m_editorNoteContent); m_editorNewType = (FieldType)EditorGUILayout.EnumPopup("字段类型", type); if (m_editorNewType == FieldType.Enum) { m_editorNewEnumIndex = EditorGUILayout.Popup("枚举类型", EnumTypeIndex, EditorTool.GetAllEnumType()); if (EnumTypeIndex != m_editorNewEnumIndex) { isNewType = true; } } if (type != m_editorNewType) { isNewType = true; } if (isNewType) { //弹出警告并重置数据 if (EditorUtility.DisplayDialog("警告", "改变字段类型会重置该字段的所有数据和默认值\n是否继续?", "是", "取消")) { m_currentData.SetFieldType(key, m_editorNewType, EditorTool.GetAllEnumType()[m_editorNewEnumIndex]); ResetDataField(m_currentData, key, m_editorNewType, EditorTool.GetAllEnumType()[m_editorNewEnumIndex]); type = m_editorNewType; EnumTypeIndex = m_editorNewEnumIndex; content = new SingleData(); } } string newContent; if (type == FieldType.Enum) { newContent = EditorUtilGUI.FieldGUI_Type(type, EditorTool.GetAllEnumType()[EnumTypeIndex], m_currentData.GetDefault(key), "默认值"); } else { newContent = EditorUtilGUI.FieldGUI_Type(type, null, m_currentData.GetDefault(key), "默认值"); } m_currentData.SetDefault(key, newContent); } EditorGUILayout.Space(); } EditorGUILayout.EndScrollView(); AddFieldGUI(); } }
public async Task<object> GetInstance(SingleData<string> request, SystemSession session) { var response = await Task.Factory.StartNew(() => Client.ChatUserInfoService.getInstance(request.Data, session.GetSession())).ConfigureAwait(false); return JsonConvert.DeserializeObject(response); }
public virtual async Task<StatusData<bool>> SaveProfilePicture(string username, SingleData<string> request) { var result = new StatusData<bool> { Data = await Task.Factory.StartNew(() => Client.UserService.saveUserProfilePic(username, request.Data)) .ConfigureAwait(false) }; result.Status = result.Data ? SystemDbStatus.Updated : SystemDbStatus.NotModified; return result; }
public Task<StatusData<string>> DeleteContact(SingleData<long> request, SystemSession session) { //return _unitOfWork.Profile.DeleteContact(request); return _jUnitOfWork.Profile.DeleteContact(request, session); }
public virtual async Task<IEnumerable<EmployeeWorkScheduleResponse>> GetEmploymentWorkSchedule( SingleData<long> request, SystemSession session) { var response = await Task.Factory.StartNew(() => Client.UserService.getEmployeeWorkSchedule(request.Data, session.GetSession())).ConfigureAwait(false); var result = response.Select(x => new EmployeeWorkScheduleResponse { EmployeeType = (SystemEmployeeType)Convert.ToInt32(x.EmployeeType), Day = (SystemDayOfWeek)x.Day, StartTime = TimeSpan.Parse(x.StartTime), EndTime = TimeSpan.Parse(x.EndTime), ScheduleType = x.ScheduleType ? SystemWorkSchedule.Fixed : SystemWorkSchedule.Flexible }); return result; }
public Task<StatusData<string>> DeleteSuggestedContact(SingleData<GeneralKvPair<long, List<long>>> request, SystemSession session) { // return _unitOfWork.Profile.DeleteSuggestedContact(request); return _jUnitOfWork.Profile.DeleteSuggestedContact(request, session); }
public virtual async Task<StatusData<string>> DeleteSuggestedContact( SingleData<GeneralKvPair<long, List<long>>> request, SystemSession session) { var serviceRequest = new UserContactDetails { ContactId = request.Data.Id, ContactCustomIds = string.Join(",", request.Data.Value), UserId = session.UserId, Username = session.UserName, Mode = (byte)SystemDbStatus.Deleted }; var response = await Task.Factory.StartNew( () => Client.UserService.upsertSuggestContacts(0, serviceRequest, session.GetSession())) .ConfigureAwait(false); var data = new StatusData<string> { Status = (SystemDbStatus)response.DbStatus.DbStatusCode, Message = response.DbStatus.DbStatusMsg, SubStatus = response.DbStatus.DbSubStatusCode }; return data; }
public Task<IEnumerable<BaseInfoResponse>> GetBasicUsersInformation(SingleData<List<string>> request, SystemSession session) { // return _unitOfWork.Profile.GetBasicUserInformation(baseUserId, userNameOrUserId); return _jUnitOfWork.Profile.GetBasicUsersInformation(request, session); }
public virtual async Task<StatusData<string>> DeleteContact(SingleData<long> request, SystemSession session) { var serviceRequest = new UserContactDetails { ContactId = request.Data, UserId = session.UserId, Username = session.UserName, Mode = (byte)SystemDbStatus.Deleted }; var response = await Task.Factory.StartNew(() => Client.UserService.upsertContacts(serviceRequest, session.GetSession())) .ConfigureAwait(false); var data = new StatusData<string> { Status = (SystemDbStatus)response.Dbstatus.DbStatusCode, Message = response.Dbstatus.DbStatusMsg, SubStatus = response.Dbstatus.DbSubStatusCode }; return data; }
public Task<StatusData<string>> UpdatePushCode(SingleData<string> request, SystemSession session) { return _jUnitOfWork.Chat.UpdatePushCode(request, session); }
public virtual async Task<StatusData<string>> FlushContact(SingleData<GeneralKvPair<long, List<int>>> chatNetworks, SingleData<GeneralKvPair<long, List<long>>> customContacts, SystemSession session) { var serviceRequest = new UserContactDetails { ContactId = chatNetworks == null ? customContacts.Data.Id : chatNetworks.Data.Id, ContactChatNetworkId = chatNetworks == null ? DBNull.Value.ToString() : string.Join(",", chatNetworks.Data.Value), CustomContactsCustomIds = customContacts == null ? DBNull.Value.ToString() : string.Join(",", customContacts.Data.Value), UserId = session.UserId, Username = session.UserName, Mode = (byte)SystemDbStatus.Flushed }; var response = await Task.Factory.StartNew(() => Client.UserService.upsertContacts(serviceRequest, session.GetSession())) .ConfigureAwait(false); var data = new StatusData<string> { Status = (SystemDbStatus)response.Dbstatus.DbStatusCode, Message = response.Dbstatus.DbStatusMsg, SubStatus = response.Dbstatus.DbSubStatusCode }; return data; }
public Task<StatusData<string>> MuteUsers(SingleData<List<string>> request, SystemSession session) { return _jUnitOfWork.Chat.MuteUsers(request, session); }
public async Task <HttpResponseMessage> Post([FromBody] SingleData <List <long> > request) { var response = await _service.GetNotificationCount(request.Data, Request.GetSession()).ConfigureAwait(false); return(Request.SystemResponse(SystemDbStatus.Selected, response)); }