public EnterInfo GetApplicationStatistic(int IDApp) { // нужно: учесть ЦКП (они занимают места первыми) EnterInfo res = new EnterInfo(); res.Application = GetAppData(IDApp); using (DataLayer.AbitDataContext ctx = new DataLayer.AbitDataContext(conn)) { res.AvgBall = ctx.GetAbitAverageBall(IDApp); int?[] AVGBalls = ctx.AbitAverageBalls.Where(p => (p.ik_type_kat == res.Application.CatEntryTypeKey)&&(p.NNrecord == res.Application.NumRecord)).Select(x => x.AVGBall).OrderByDescending(p => p.Value).ToArray(); int? PassCount = null; if (res.Application.CatEntryTypeKey == 1) PassCount = ctx.ABIT_Diapazon_spec_facs.Where(p => p.NNrecord == res.Application.NumRecord).Select(x => x.MestBudjet).Single(); if (PassCount != null) { if ((PassCount > AVGBalls.Length) || (PassCount == 0) && (res.Application.CatEntryTypeKey == 3)) res.PassBall = ctx.ABIT_proh_balls.Where(p => (p.NNrecord == res.Application.NumRecord) && (p.ik_kat_zach == res.Application.CatEntryKey)).Select(x => x.Ball).Single(); res.PassBall = AVGBalls[(int)PassCount - 1]; } else res.PassBall = ctx.ABIT_proh_balls.Where(p => (p.NNrecord == res.Application.NumRecord) && (p.ik_kat_zach == res.Application.CatEntryKey)).Select(x => x.Ball).Single(); return res; } }
/// <summary> /// 添加抄送人 /// Created:20170527(ChengMengjia) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAddCC_Click(object sender, EventArgs e) { EnterInfo dlg = new EnterInfo(); dlg.StartPosition = FormStartPosition.CenterParent; DialogResult dr = dlg.ShowDialog(); if (dlg.DialogResult == DialogResult.OK) { string Addr = dlg.GetVaule().Trim(); if (CommonHelper.CheckEmail(Addr)) { txtCC.Text += Addr + ";"; } } }
public void ParseDoorInfos() { JsonData controlData = JsonMapper.ToObject(Resources.Load <TextAsset>("DoorData/doors").text); foreach (JsonData item in controlData) { DoorInfo doorInfo = new DoorInfo(); doorInfo.id = (int)item["id"]; doorInfo.switchId = (int)item["switchId"]; doorInfo.colorType = (ColorType)(int)item["type"]; JsonData dt = item["rooms"]; for (int i = 0; i < dt.Count; i++) { doorInfo.roomList.Add((int)dt[i]); } doorInfoDict[doorInfo.id] = doorInfo; } JsonData normalData = JsonMapper.ToObject(Resources.Load <TextAsset>("DoorData/switches").text); foreach (JsonData item in normalData) { SwitchInfo switchInfo = new SwitchInfo(); switchInfo.id = (int)item["id"]; switchInfo.colorType = (ColorType)(int)item["type"]; switchInfoDict[switchInfo.id] = switchInfo; } JsonData enterData = JsonMapper.ToObject(Resources.Load <TextAsset>("DoorData/enters").text); foreach (JsonData item in enterData) { EnterInfo enterInfo = new EnterInfo(); enterInfo.id = (int)item["id"]; JsonData dt = item["rooms"]; for (int i = 0; i < dt.Count; i++) { enterInfo.roomList.Add((int)dt[i]); } enterInfoDict[enterInfo.id] = enterInfo; } initFinish = true; }
public static List <EnterInfo> GetList(DataTable excelTable) { List <EnterInfo> list = new List <EnterInfo>(); foreach (DataRow row in excelTable.Rows) { EnterInfo model = new EnterInfo(); var key = row.ItemArray; for (int i = 0; i < key.Length; i++) { switch (i) { case 0: model.MedicineID = row[i].ToString(); continue; case 1: if (!RegexHelper.IsNumber(row[i].ToString())) { //ErrorHelper.ErrorInfo(); break; } model.MarketNumber = Convert.ToInt32(row[i]); continue; case 2: model.EnterCompanyID = Convert.ToInt32(row[i]); continue; case 3: model.EnterDate = Convert.ToDateTime(row[i]); continue; case 4: model.EnterPrice = Convert.ToInt32(row[i]); continue; } } list.Add(model); } return(list); }
public int GetDestScene(int curRoomId) { EnterInfo info = GameController.manager.doorMan.GetEnterInfoById(id); return(Util.roomToSceneDict[info.GetDestRoomId(curRoomId)]); }
public EnterInfo GetInfo() { EnterInfo info = GameController.manager.doorMan.GetEnterInfoById(id); return(info); }
private void ParsePayload(byte[] memory, int size) { using (MemoryStream ms = new MemoryStream(memory, 0, size)) using (TCPBinaryReader br = new TCPBinaryReader(ms)) { TcpHeader header = br.ReadObj <TcpHeader>(); HParam type = (HParam)header.PacketNumber; if (type == HParam.CharacterCreate)//캐릭터 생성 구간. { CharInfo info = br.ReadObj <CharInfo>(); string name = Translate.GetTranslate(info.Name.Split('_')[2]); byte grade = info.Grade; ConsoleColor color = ConsoleColor.White; if (grade >= 4) { color = ConsoleColor.Yellow; CLI.ShowToast("PCAP", "캐릭터 획득", $"{(Grade)grade} 등급 {name} 획득했다!", ""); } CLI.PrintQueueLog(Channel.One, $"{(Grade)grade} 등급 {name} 획득했다!", color); if (RewardChar.ContainsKey(name) == true) { RewardChar[name]++; } else { RewardChar[name] = 1; } } else if (type == HParam.CheckNetwork || type == HParam.Ping || type == HParam.SetAuto || type == HParam.Packet || type == HParam.BattleLoginSuccess || type == HParam.BattleLogout || type == HParam.QUESTUPDATENTF || type == HParam.EnterStageSuccess) { //무시해도 되는 부분. } else if (type == HParam.ChangeWave)//웨이브 클리어 했을때. { BuffList.Clear(); byte NextWaveStep = br.ReadByte(); CurrentWave = NextWaveStep; RewardInfo ClearRewardInfo = br.ReadObj <RewardInfo>(); List <CharEXPLevel> pcExpAndLevelupList = br.ReadList <CharEXPLevel>(); List <CharSkillExpLevelInfo> SkillExpAndLevelupList = br.ReadList <CharSkillExpLevelInfo>(); byte IsApplyOpenUI = br.ReadByte(); ulong OpenUI_ActorID = br.ReadUInt64(); byte WaveClearRank = br.ReadByte(); CLI.PrintQueueLog(Channel.One, $"다음 웨이브 : {NextWaveStep + 1} ", ConsoleColor.White); ClearRewardInfo.RewardCharList.ForEach(element => { CLI.PrintQueueLog(Channel.One, element.CharString, ConsoleColor.Cyan); }); ClearRewardInfo.RewardItemList.ForEach(element => { CLI.PrintQueueLog(Channel.One, element.ItemString + " : " + element.StackCount, ConsoleColor.Cyan); }); pcExpAndLevelupList.ForEach(element => { CLI.PrintQueueLog(Channel.One, PIDMap[element.CharID] + " Level UP " + element.BeforeLevel + " =>" + element.AfterLevel, ConsoleColor.Cyan); }); SkillExpAndLevelupList.ForEach(element => { element.SkillInfo.ForEach(skill => { if (skill.IsLevelUp == 1) { CLI.PrintQueueLog(Channel.One, PIDMap[element.CharID] + " : " + skill.SkillString + " SkillLevel UP " + skill.BeforeLevel + " =>" + skill.AfterLevel, ConsoleColor.Cyan); } }); }); CLI.PrintQueueLog(Channel.One, new string('─', CLI.channelGap), ConsoleColor.White, ConsoleColor.Black, false); } //else if (type == HParam.CharInfo){} else if (type == HParam.Exp) { var PID = br.ReadUInt64(); var Exp = br.ReadUInt32(); var Offset = br.ReadUInt32(); CLI.PrintQueueLog(Channel.One, $"{PIDMap[PID].Name} {Exp}경험치 ({Offset}상승)"); } else if (type == HParam.LevelUp) { var PID = br.ReadUInt64(); var Level = br.ReadByte(); var NextExp = br.ReadInt32(); var MaxEnchant = br.ReadUInt16(); CLI.PrintQueueLog(Channel.One, $"{PIDMap[PID].Name} {Level}으로 레벨업! 다음 경험치 : {NextExp}"); } else if (type == HParam.FavorPoint) { var ActorID = br.ReadUInt64(); var CurrentFavorPoint = br.ReadUInt32(); var OffSet = br.ReadInt32(); CLI.PrintQueueLog(Channel.One, $"{LoadedMap[ActorID].Name} 호감도 {CurrentFavorPoint/100.0} {OffSet/100.0} 상승"); } else if (type == HParam.StageClear) { foreach (var kv in RewardChar) { CLI.PrintQueueLog(Channel.Zero, $"{kv.Key} {kv.Value} 개 얻음."); } } else if (type == HParam.StageClearUpdate) { var UID = br.ReadUInt64(); var StageKeyString = br.ReadString(); var ClearCount = br.ReadInt32(); var MissionInfoList = br.ReadList <MissionInfo>(); CLI.CleanQueue(Channel.Zero); CLI.PrintQueueLog(Channel.Zero, $"{StageKeyString}클리어! ({ClearCount}회 클리어됨.)"); } else if (type == HParam.GiveBuffList) { List <GiveBuffInfo> infoList = br.ReadList <GiveBuffInfo>(); // GUI.PrintQueueLog(Channel.Zero, new string('─', GUI.channelGap), ConsoleColor.White, false); BuffList.AddRange(infoList); /*infoList.ForEach(element => * { * if ((BuffType)element.AttrType != BuffType.MAX) * { * GUI.PrintQueueLog(Channel.Zero, LoadedMap[element.FromID].Name + " Buffed " + LoadedMap[element.ToID].Name + " " + * (BuffType)element.AttrType + " : " + element.AttrValue * 100 + $"% ({element.LeftRoundCount})Left ", ConsoleColor.Yellow); * } * });*/ ParseBuffList(); } else if (type == HParam.GiveBuff) { GiveBuffInfo info = br.ReadObj <GiveBuffInfo>(); BuffList.Add(info); //GUI.PrintQueueLog(Channel.Zero, new string('─', GUI.channelGap), ConsoleColor.White, false); /*if ((BuffType)info.AttrType != BuffType.MAX) * { * GUI.PrintQueueLog(Channel.Zero, LoadedMap[info.FromID].Name + " Buffed " + LoadedMap[info.ToID].Name + " " + * (BuffType)info.AttrType + " : " + info.AttrValue * 100 + $"% ({info.LeftRoundCount})Left ", ConsoleColor.Yellow); * }*/ ParseBuffList(); } else if (type == HParam.RemoveBuffList) { List <RemoveBuffInfo> infoList = br.ReadList <RemoveBuffInfo>(); //GUI.PrintQueueLog(Channel.Zero, new string('─', GUI.channelGap), ConsoleColor.White, false); infoList.ForEach(element => { BuffList.Remove(BuffList.Find(buff => buff.BuffID == element.BuffID)); //GUI.PrintQueueLog(Channel.Zero, LoadedMap[element.FromID].Name + " Buff Removed " + LoadedMap[element.ToID].Name, ConsoleColor.Red); }); ParseBuffList(); } else if (type == HParam.RemoveBuff) { RemoveBuffInfo info = br.ReadObj <RemoveBuffInfo>(); BuffList.Remove(BuffList.Find(buff => buff.BuffID == info.BuffID)); } else if (type == HParam.Hp) { ulong Trid = br.ReadUInt64(); ulong Aid = br.ReadUInt64(); int HP = br.ReadInt32(); int MaxHP = br.ReadInt32(); int Damage = br.ReadInt32(); ulong Aid_From = br.ReadUInt64(); byte DamageType = br.ReadByte(); byte BuffEffectType = br.ReadByte(); byte IsCri = br.ReadByte(); CLI.PrintQueueLog(Channel.One, $"{LoadedMap[Aid_From].Name} 피해 입힘 => {LoadedMap[Aid].Name} Dmg : {Damage}{(IsCri == 1 ? "치명타!" : "")}", IsCri == 1 ? ConsoleColor.Red : ConsoleColor.White); if (HP <= 0) { Console.ForegroundColor = ConsoleColor.Red; } else if (((double)HP / MaxHP) <= 0.25 && LoadedMap[Aid].TeamId == 0) { Console.ForegroundColor = ConsoleColor.Yellow; } else { Console.ForegroundColor = ConsoleColor.White; } if (LoadedMap[Aid].TeamId == 1)//적군 { MonsterEnterInfo mob = LoadedMap[Aid] as MonsterEnterInfo; byte wave = mob.WaveStep; var xPos = CLI.tableWidth * (wave + 1) + CLI.alt + CLI.gap * wave; CLI.RemoveCharacter(xPos, 0, mob.GridPosIndex, 0, 1); CLI.PrintCharacter(xPos, 0, mob.GridPosIndex, HP + " / " + MaxHP, 0, 1); } else { CharEnterInfo pc = LoadedMap[Aid] as CharEnterInfo; CLI.RemoveCharacter(0, 0, pc.GridPosIndex, 0, 1); CLI.PrintCharacter(0, 0, pc.GridPosIndex, HP + " / " + MaxHP, 0, 1); } Console.ForegroundColor = ConsoleColor.White; } else if (type == HParam.AttackTarget) { List <AttackTargetInfo> AttackTargetList = br.ReadList <AttackTargetInfo>(); byte IsNotRemove = br.ReadByte(); byte TargetGridPos = br.ReadByte(); } else if (type == HParam.StartTurn) { byte CurrentRound = br.ReadByte(); int CurrentGlobalTurn = br.ReadInt32(); List <TurnInfo> TurnList = br.ReadList <TurnInfo>(); List <TurnInfo> DisplayTurnList = br.ReadList <TurnInfo>();//실제로 보이는 행동력 리스트 byte IsSkillSelectTurn = br.ReadByte(); byte isReconnect = br.ReadByte(); DisplayTurnList.ForEach(element => { EnterInfo info = LoadedMap[element.Aid]; double prev = element.PreTurnPos; double turn = element.TurnPos; int x = 0; int grid = 0; //GUI.PrintQueueLog($"{prev} {turn}", ConsoleColor.Blue); Console.ForegroundColor = ConsoleColor.White; if (turn < 10) { Console.ForegroundColor = ConsoleColor.Red; } else if (turn >= 20) { Console.ForegroundColor = ConsoleColor.Blue; } if (info.TeamId == 1)//적군 { MonsterEnterInfo mob = info as MonsterEnterInfo; byte wave = mob.WaveStep; x = CLI.tableWidth * (wave + 1) + CLI.alt + CLI.gap * wave; grid = mob.GridPosIndex; } else if (info.TeamId == 0) { grid = info.GridPosIndex; } CLI.RemoveCharacter(x, 0, grid, 0, -1); CLI.PrintCharacter(x, 0, grid, turn.ToString("0.0AP"), 0, -1); Console.ForegroundColor = ConsoleColor.White; }); } else if (type == HParam.ItemCreate) { byte UpdateType = br.ReadByte(); ItemInfo Info = br.ReadObj <ItemInfo>(); CLI.PrintQueueLog(Channel.One, $"{Info.ItemString} 획득했다! 현재 {Info.StackCount}개 있음.", ConsoleColor.White); } else if (type == HParam.LoadResource) { string StageKeyString = br.ReadString(); CurrentWave = 0; List <CharEnterInfo> PCEnterInfoList = br.ReadList <CharEnterInfo>(); List <MonsterEnterInfo> MonsterEnterInfoList = br.ReadList <MonsterEnterInfo>(); LoadedMap.Clear(); PIDMap.Clear(); CLI.RemoveRange(0, 0, CLI.tableWidth / 2); Console.ForegroundColor = ConsoleColor.White; CLI.PrintGrid(0, 0); CLI.PrintQueueLog(Channel.One, $"스테이지 : {StageKeyString} 입장.", ConsoleColor.White); CLI.PrintQueueLog(Channel.One, new string('─', CLI.channelGap), ConsoleColor.White, ConsoleColor.Black, false); PCEnterInfoList.ForEach(element => { string name = Translate.GetTranslate(element.Name.Split('_')[2]); element.Name = name; PIDMap[element.CharacterID] = element; LoadedMap[element.InstanceID] = element; //GUI.PrintQueueLog(Channel.Zero, $"Char ID : {element.InstanceID} Name: {name} Added { element.GridPosIndex} Grid", ConsoleColor.Cyan); Console.ForegroundColor = ConsoleColor.White; CLI.PrintCharacter(0, 0, element.GridPosIndex, name); if (((double)element.HP / element.MaxHP) <= 0.25) { Console.ForegroundColor = ConsoleColor.Yellow; } CLI.PrintCharacter(0, 0, element.GridPosIndex, element.HP + " / " + element.MaxHP, 0, 1); Console.ForegroundColor = ConsoleColor.White; CLI.PrintCharacter(0, 0, element.GridPosIndex, element.MaxAP.ToString(), 0, -1); CLI.PrintCharacter(0, 0, element.GridPosIndex, (Grade)element.Grade + " " + element.Level, 0, -2); }); int lastWave = -1; List <(string, int)> SameName = new List <(string, int)>(); Dictionary <(string, int), int> SameIndex = new Dictionary <(string, int), int>(); MonsterEnterInfoList.ForEach(element => { SameName.Add((element.Name, element.WaveStep)); SameIndex[(element.Name, element.WaveStep)] = 0; }
public void ProcessRequest(HttpContext context) { ReturnInfo res = new ReturnInfo(); ParaInfo Info = new ParaInfo(); var jsonString = String.Empty; context.Request.InputStream.Position = 0; using (var inputStream = new StreamReader(context.Request.InputStream)) { jsonString = inputStream.ReadToEnd(); } if (jsonString != null && jsonString != "") { try { List <EnterInfo> list = new List <EnterInfo>(); jsonString = utf8_gb2312(jsonString); WriteMsg("打印进入信息查询参数:" + jsonString); Info = JsonConvert.DeserializeAnonymousType(jsonString, Info); if (!String.IsNullOrEmpty(Info.CommunityID.Trim()) && !String.IsNullOrEmpty(Info.SubdistrictID.Trim())) { DbHelperSQL.connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["XQCRDB"].ToString(); string sql = "select a.*,b.Mobile,c.name as Community,d.name as Subdistrict,b.Address,b.ResidentOrVisitor " + " from XQCR_EnterList a left join XQCR_Personnel_Info b " + " on a.UserID = b.ID left join XQCR_CommunityDistrict c " + " on a.CommunityID = c.code left join XQCR_CommunityDistrict d " + " on a.SubdistrictID = d.code where 1=1 and a.CommunityID=@CommunityID and a.SubdistrictID=@SubdistrictID "; List <SqlParameter> paras = new List <SqlParameter>(); SqlParameter para1 = new SqlParameter("@CommunityID", Info.CommunityID.Trim()); SqlParameter para2 = new SqlParameter("@SubdistrictID", Info.SubdistrictID.Trim()); paras.Add(para1); paras.Add(para2); //常驻 或 访客 if (!String.IsNullOrEmpty(Info.ResidentOrVisitor.Trim())) { sql += " and b.ResidentOrVisitor=@ResidentOrVisitor "; SqlParameter paran = new SqlParameter("@ResidentOrVisitor", Info.ResidentOrVisitor.Trim()); paras.Add(paran); } //反馈结果 if (!String.IsNullOrEmpty(Info.Status.Trim())) { sql += " and a.Status=@Status "; SqlParameter paran = new SqlParameter("@Status", Info.Status.Trim()); paras.Add(paran); } //进入时间 if (!String.IsNullOrEmpty(Info.Date.Trim())) { sql += " and convert(nvarchar (50),a.CreateDate,23)=@Date "; SqlParameter paran = new SqlParameter("@Date", Info.Date.Trim()); paras.Add(paran); } //关键词 查的是 姓名、身份证、手机号码、详细住址 if (!String.IsNullOrEmpty(Info.keys.Trim())) { sql += " and ( a.Name like @keys or a.CertificateID like @keys or b.Mobile like @keys or b.Address like @keys ) "; SqlParameter paran = new SqlParameter("@keys", "%" + Info.keys.Trim() + "%"); paras.Add(paran); } sql += " order by a.CreateDate desc"; DataSet ds = DbHelperSQL.Query(sql, paras.ToArray()); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { EnterInfo info = new EnterInfo(); info.ID = ds.Tables[0].Rows[i]["ID"].ToString(); info.UserID = ds.Tables[0].Rows[i]["UserID"].ToString(); info.CommunityID = ds.Tables[0].Rows[i]["CommunityID"].ToString(); info.Community = ds.Tables[0].Rows[i]["Community"].ToString(); info.SubdistrictID = ds.Tables[0].Rows[i]["SubdistrictID"].ToString(); info.Subdistrict = ds.Tables[0].Rows[i]["Subdistrict"].ToString(); info.Name = ds.Tables[0].Rows[i]["Name"].ToString(); info.Certificate = ds.Tables[0].Rows[i]["Certificate"].ToString(); info.CertificateID = ds.Tables[0].Rows[i]["CertificateID"].ToString(); info.Mobile = ds.Tables[0].Rows[i]["Mobile"].ToString(); info.Address = ds.Tables[0].Rows[i]["Address"].ToString(); info.ResidentOrVisitor = ds.Tables[0].Rows[i]["ResidentOrVisitor"].ToString(); info.Status = ds.Tables[0].Rows[i]["Status"].ToString(); info.Date = ds.Tables[0].Rows[i]["CreateDate"].ToString(); list.Add(info); } res.ret = 0; res.list = list; res.msg = "信息列表"; } else { res.ret = 1; res.list = null; res.msg = "参数为空"; } } catch (Exception ex) { res.ret = 2; res.list = null; res.msg = "出现异常"; } } string returnStr = JsonConvert.SerializeObject(res); context.Response.ContentType = "text/plain"; context.Response.Write(returnStr); }