//获取新建或更新后的终端数据 private PosInfo GetNewTerminalInfo() { var TerminalInfo = new PosInfo(); TerminalInfo.Type = this.tbType.SelectedValue; TerminalInfo.Brand = this.tbBrand.Text; TerminalInfo.Model = this.tbModel.Text; TerminalInfo.Code = this.tbCode.Text; TerminalInfo.SN = this.tbSN.Text; //TerminalInfo.PurchaseDate = this.tbPurchaseDate.Text; //修改为html服务器控件的value TerminalInfo.PurchaseDate = this.tbPurchaseDate.Value; TerminalInfo.InsuranceDate = this.tbInsuranceDate.Value; //TerminalInfo.InsuranceDate = this.tbInsuranceDate.Text; TerminalInfo.Remark = this.tbRemark.Text.Trim(); if (Convert.ToInt32(ViewState["action"]) == 2) { TerminalInfo.HoldType = "2"; //TerminalInfo.SoftwareVersion = tbSoftwareVersion.Text; //TerminalInfo.DBVersion = tbDBVersion.Text; //TerminalInfo.WS = tbWS.Text; //TerminalInfo.WS2 = tbWS2.Text; TerminalInfo.CreateUserID = loggingSessionInfo.CurrentUser.User_Id; TerminalInfo.CreateTime = DateTime.Now; } else { //TerminalInfo.HoldType = this.cbHoldType.SelectedValue; TerminalInfo.ModifyUserID = loggingSessionInfo.CurrentUser.User_Id; TerminalInfo.ModifyTime = DateTime.Now; } TerminalInfo.HaveCashbox = Convert.ToInt32(this.chkCashBox.Checked); TerminalInfo.CashboxNo = this.tbCashNo.Text; TerminalInfo.HavePrinter = Convert.ToInt32(this.chkPrinter.Checked); TerminalInfo.PrinterNo = this.tbPrinterNo.Text; TerminalInfo.HaveClientDisplay = Convert.ToInt32(this.chkClientDisplay.Checked); TerminalInfo.ClientDisplayNo = this.tbClientDisplayNo.Text; TerminalInfo.HaveScanner = Convert.ToInt32(this.chkScanner.Checked); TerminalInfo.ScannerNo = this.tbScannerNo.Text; TerminalInfo.HaveEcard = Convert.ToInt32(this.chkEcard.Checked); TerminalInfo.EcardNo = tbEcardNo.Text; TerminalInfo.HaveHolder = Convert.ToInt32(chkHolder.Checked); TerminalInfo.HolderNo = tbHolderNo.Text; TerminalInfo.HaveOtherDevice = Convert.ToInt32(chkOtherDevice.Checked); TerminalInfo.OtherDeviceNo = tbOtherDeviceNo.Text; TerminalInfo.ModifyUserName = loggingSessionInfo.CurrentUser.User_Name; TerminalInfo.ModifyTime = DateTime.Now; //TerminalInfo.SystemModifyStamp = DateTime.Now; //TerminalInfo.e //todo:检查 //TerminalInfo.SystemModifyStamp = DateTime.Now; TerminalInfo.SoftwareVersion = this.tbSoftwareVersion.Text; TerminalInfo.DBVersion = this.tbDBVersion.Text; TerminalInfo.WS = this.tbWS.Text; TerminalInfo.WS2 = this.tbWS2.Text; return(TerminalInfo); }
private void canvas_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { var data = new PosInfo { point = new ccPoint((int)e.GetPosition(canvas).X, (int)e.GetPosition(canvas).Y) }; if (points.Any(p => { return(Math.Abs(p.point.x - data.point.x) < 10 && Math.Abs(p.point.y - data.point.y) < 10); })) { return; } points.Add(data); Ellipse ele = new Ellipse(); ele.Width = 10; ele.Height = 10; ele.Fill = Brushes.Aqua; canvas.Children.Add(ele); Canvas.SetLeft(ele, data.point.x - (ele.Width / 2)); Canvas.SetTop(ele, data.point.y - (ele.Height / 2)); ele.MouseLeftButtonUp += Ele_MouseLeftButtonUp; var store = new GPInfo { pinfo = data, fill = ele }; gpInfo.Add(store); }
public bool SetPosInfo(string posInfo, string customerID, int type) { this.log(LogLevel.DEBUG, "AuthBsWebServices", "SetPosInfo", "Params", "pos=" + posInfo); this.log(LogLevel.DEBUG, "AuthBsWebServices", "SetPosInfo", "Params", "customer_id=" + customerID); this.log(LogLevel.DEBUG, "AuthBsWebServices", "SetPosInfo", "Params", "type=" + type.ToString()); cPos.Service.PosService pos_service = new PosService(); if (string.IsNullOrEmpty(posInfo)) { throw new ArgumentNullException("posInfo"); } if (string.IsNullOrEmpty(customerID)) { throw new ArgumentNullException("customerID"); } if (type < 1 || type > 2) { throw new ArgumentOutOfRangeException("type"); } //todo:解密 string decrypt_pos_info = posInfo; PosInfo pos = (PosInfo)cPos.Service.cXMLService.Deserialize(decrypt_pos_info, typeof(PosInfo)); if (pos == null) { throw new ArgumentException("posInfo"); } if (string.IsNullOrEmpty(pos.ID)) { throw new ArgumentNullException("terminal_id"); } if (string.IsNullOrEmpty(pos.SN)) { throw new ArgumentNullException("terminal_sn"); } if (string.IsNullOrEmpty(pos.HoldType)) { throw new ArgumentNullException("terminal_hold_type"); } if (string.IsNullOrEmpty(pos.Type)) { throw new ArgumentNullException("terminal_type"); } switch (type) { case 1: return(pos_service.InsertPosFromAP(pos, customerID)); case 2: return(pos_service.ModifyPosFromAP(pos, customerID)); default: return(false); } }
/// <summary> /// 插入一个终端 /// </summary> /// <param name="loggingSession">当前用户的登录信息</param> /// <param name="pos">终端信息</param> /// <returns></returns> public bool InsertPos(PosInfo pos) { if (string.IsNullOrEmpty(pos.ID)) { pos.ID = this.NewGuid(); } pos.CreateUserID = loggingSessionInfo.CurrentUser.User_Id; pos.CreateUserName = loggingSessionInfo.CurrentUser.User_Name; bool bReturn = posService.InsertPos(pos); if (bReturn) { DataSet ds = new DataSet(); ds = posService.GetPosInfoById(pos.ID); if (ds != null && ds.Tables != null && ds.Tables.Count > 0) { pos = DataTableToObject.ConvertToObject <PosInfo>(ds.Tables[0].Rows[0]); //交至管理平台 this.synPosToAP(this.loggingSessionInfo.CurrentLoggingManager.Customer_Id, 1, pos); } } return(true); }
private bool SetPosInsert(PosInfo posInfo, IDbTransaction pTran) { #region string sql = " insert into t_pos(pos_id, pos_hold_type, pos_type, pos_brand, pos_model, pos_code, pos_sn, " + " pos_purchase_date, pos_insurance_date, " + " pos_ws, pos_ws2, pos_software_version, pos_db_version, " + " pos_have_cashbox, pos_cashbox_no, pos_have_ecard, pos_ecard_no, pos_have_scanner, pos_scanner_no, " + " pos_have_client_display, pos_client_display_no, pos_have_printer, pos_printer_no, " + " pos_have_other_device, pos_other_device_no, pos_have_holder, pos_holder_no, " + " pos_remark, create_user_id, create_user_name, create_time) " + " values('" + posInfo.ID + "', '2', '" + posInfo.Type + "', '" + posInfo.Brand + "', '" + posInfo.Model + "', '" + posInfo.Code + "', '" + posInfo.SN + "', " + " '" + posInfo.PurchaseDate + "', '" + posInfo.InsuranceDate + "', " + " 'http://192.168.0.55:8101','http://192.168.0.55:8101','1.1.1000','20120827080808', " + " '" + posInfo.HaveCashbox + "', '" + posInfo.CashboxNo + "', '" + posInfo.HaveEcard + "', '" + posInfo.EcardNo + "', '" + posInfo.HaveScanner + "', '" + posInfo.ScannerNo + "', " + " '" + posInfo.HaveClientDisplay + "', '" + posInfo.ClientDisplayNo + "', '" + posInfo.HavePrinter + "', '" + posInfo.PrinterNo + "', " + " '" + posInfo.HaveOtherDevice + "', '" + posInfo.OtherDeviceNo + "', '" + posInfo.HaveHolder + "', '" + posInfo.HolderNo + "', " + " '" + posInfo.Remark + "', '" + posInfo.CreateUserID + "', '" + posInfo.CreateUserName + "', getdate())"; #endregion if (pTran != null) { this.SQLHelper.ExecuteNonQuery((SqlTransaction)pTran, CommandType.Text, sql.ToString(), null); } else { this.SQLHelper.ExecuteNonQuery(sql); } return(true); }
/// <summary> /// 修改一个终端 /// </summary> /// <param name="loggingSession">当前用户的登录信息</param> /// <param name="pos">终端信息</param> /// <returns></returns> public bool ModifyPos(LoggingSessionInfo loggingSession, PosInfo pos) { //保存 cSqlMapper.Instance(loggingSession.CurrentLoggingManager).Update("Pos.Pos.Update", pos); //提交至管理平台 return(this.synPosToAP(loggingSession.CurrentLoggingManager.Customer_Id, 2, pos)); }
private void OnEnable() { EventManager.instance.AddHandler <CallBackToSelectLevel>(OnBackToSelectLevel); EventManager.instance.AddHandler <UpdateConfig>(OnUpdateConfig); GetComponent <AudioSource>().volume = GameManager.CurrentConfig.SoundEffectVol; SelfPosInfo = new PosInfo(transform.localPosition); }
/// <summary> /// 治疗 /// </summary> /// <param name="singleEffect"></param> /// <param name="game"></param> /// <returns></returns> public static List <string> RunEffect(EffectDefine singleEffect, Client.GameManager game, List <String> PosList) { List <String> Result = new List <string>(); int HealthPoint = singleEffect.ActualEffectPoint; //处理对象 //ME#POS foreach (var PosInfo in PosList) { var PosField = PosInfo.Split(CardUtility.strSplitMark.ToCharArray()); if (PosField[0] == CardUtility.strMe) { if (PosField[1] == Card.Client.BattleFieldInfo.HeroPos.ToString()) { game.MySelf.RoleInfo.HealthPoint += HealthPoint; if (game.MySelf.RoleInfo.HealthPoint > PlayerBasicInfo.MaxHealthPoint) { game.MySelf.RoleInfo.HealthPoint = PlayerBasicInfo.MaxHealthPoint; } Result.Add(Card.Server.ActionCode.strHealth + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + game.MySelf.RoleInfo.HealthPoint.ToString()); } else { //位置从1开始,数组从0开始 game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值 += HealthPoint; if (game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值 > game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值上限) { game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值 = game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值上限; } Result.Add(Card.Server.ActionCode.strHealth + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值.ToString()); } } else { if (PosField[1] == Card.Client.BattleFieldInfo.HeroPos.ToString()) { game.YourInfo.HealthPoint += HealthPoint; if (game.YourInfo.HealthPoint > PlayerBasicInfo.MaxHealthPoint) { game.YourInfo.HealthPoint = PlayerBasicInfo.MaxHealthPoint; } Result.Add(Card.Server.ActionCode.strHealth + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + game.YourInfo.HealthPoint.ToString()); } else { //位置从1开始,数组从0开始 game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值 += HealthPoint; if (game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值 > game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值上限) { game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值 = game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值上限; } Result.Add(Card.Server.ActionCode.strHealth + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1].实际生命值.ToString()); } } } return(Result); }
public void AnalyzeTokenInfo(Stream input) { foreach (var line in input.ReadLines(Encoding)) { var entry = Parse(line); var dictionaryEntry = MakeGenericDictionaryEntry(entry); PosInfo.MapFeatures(dictionaryEntry.PartOfSpeechFeatures); } }
/// <summary> /// /// </summary> /// <param name="singleEffect"></param> /// <param name="game"></param> /// <returns></returns> public static List <string> RunEffect(EffectDefine singleEffect, Client.GameManager game, List <String> PosList) { List <String> Result = new List <string>(); //处理对象 //ME#POS foreach (var PosInfo in PosList) { var PosField = PosInfo.Split(CardUtility.strSplitMark.ToCharArray()); if (PosField[0] == CardUtility.strMe) { if (PosField[1] == Card.Client.BattleFieldInfo.HeroPos.ToString()) { switch (singleEffect.AddtionInfo) { case strFreeze: game.MySelf.RoleInfo.冰冻状态 = CardUtility.EffectTurn.效果命中; break; default: break; } } else { //位置从1开始,数组从0开始 var myMinion = game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1]; RunStatusEffect(myMinion, singleEffect.AddtionInfo); } } else { if (PosField[1] == Card.Client.BattleFieldInfo.HeroPos.ToString()) { switch (singleEffect.AddtionInfo) { case strFreeze: game.YourInfo.冰冻状态 = CardUtility.EffectTurn.效果命中; break; default: break; } } else { //位置从1开始,数组从0开始 var yourMinion = game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1]; RunStatusEffect(yourMinion, singleEffect.AddtionInfo); } } //STATUS#ME#1#FREEZE Result.Add(Card.Server.ActionCode.strStatus + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + singleEffect.AddtionInfo); } return(Result); }
public MDTester(MarkdownNode root) { var posInfo = new PosInfo() { parent = root, currentIndex = -1 }; _stack.Push(posInfo); }
public MDTester(Markdown md) { var posInfo = new PosInfo() { parent = md.Root, currentIndex = -1 }; _stack.Push(posInfo); }
/// <summary> /// 修改一个终端 /// </summary> /// <param name="loggingSession">当前用户的登录信息</param> /// <param name="pos">终端信息</param> /// <returns></returns> public bool ModifyPos(PosInfo pos) { if (posService.UpdatePos(pos)) { //提交至管理平台 return(this.synPosToAP(this.loggingSessionInfo.CurrentLoggingManager.Customer_Id, 2, pos)); } else { return(false); } }
public static void Init(FSMForm f) { form = f; picPlane = form.getPicPlane(); lstStates = form.getLstStates(); txtDist = form.getTxtDist(); txtLrnSteps = form.getTxtLrnSteps(); X = new PosInfo(25, 0, picPlane.Size.Width, picPlane.Size.Width / 2); Y = new PosInfo(25, 0, picPlane.Size.Height, picPlane.Size.Height / 2); Reset(); }
public void SetDestination(PosInfo posInfo, float rateT) { //Log.Info("SetDestination","posInfo:"+posInfo.TargetPos+",rateT:"+rateT); if (gameObject.activeInHierarchy == false) { //Log.Info("SetDestination", "gameObject.activeInHierarchy == false"); return; } this.rate = rateT; this.posInfo = posInfo; //这里设置坐标信息,然后到Update->UpdatePosition 执行移动坐标 }
/// <summary> /// 根据终端ID,获取终端信息 /// </summary> /// <param name="loggingSession">当前用户的登录信息</param> /// <param name="posID">终端ID</param> /// <returns></returns> public PosInfo GetPosByID(LoggingSessionInfo loggingSession, string posID) { PosInfo pos = new PosInfo(); DataSet ds = new DataSet(); ds = posService.GetPosInfoById(posID); if (ds != null && ds.Tables != null && ds.Tables.Count > 0) { pos = DataTableToObject.ConvertToObject <PosInfo>(ds.Tables[0].Rows[0]); } return(pos); }
public RevertablePosChange(TransformChangeInfos transformChangeInfos) { posInfos = new PosInfo[transformChangeInfos.changedPositions]; int i = 0; foreach (TransformChangeInfo info in transformChangeInfos.infos) { if (info.position.HasValue) { posInfos[i++] = new PosInfo(info.obj, info.part, info.position.Value); } } }
private PosInfo[] buildArray(int[] nums) { PosInfo[] arr = new PosInfo[nums.Length]; for (int i = 0; i < nums.Length; i++) { arr[i] = new PosInfo() { Num = nums[i], Pos = i } } ; return(arr); }
public void Push() { var node = tryGetCurrent(); if (node != null) { var posInfo = new PosInfo() { parent = node, currentIndex = -1 }; _stack.Push(posInfo); } }
private void initializePosInfos() { lastPacman = new PosInfo(104, 204, Comm.COLOR_PACMAN, gs.Pacman); lastBlue = new PosInfo(89, 133, Comm.COLOR_BLUE, gs.Blue); lastBrown = new PosInfo(121, 133, Comm.COLOR_BROWN, gs.Brown); lastPink = new PosInfo(105, 133, Comm.COLOR_PINK, gs.Pink); lastRed = new PosInfo(105, 109, Comm.COLOR_RED, gs.Red); entityPosInfos = new PosInfo[5]; entityPosInfos[0] = lastPacman; entityPosInfos[1] = lastBlue; entityPosInfos[2] = lastBrown; entityPosInfos[3] = lastPink; entityPosInfos[4] = lastRed; }
public void ReadTokenInfo(Stream input) { var entryCount = PosInfo.EntryCount; foreach (var line in input.ReadLines(Encoding)) { var entry = Parse(line); var dictionaryEntry = MakeGenericDictionaryEntry(entry); var leftId = dictionaryEntry.LeftId; var rightId = dictionaryEntry.RightId; var wordCost = dictionaryEntry.WordCost; var allPosFeatures = dictionaryEntry.PartOfSpeechFeatures; var posFeatureIds = PosInfo.MapFeatures(allPosFeatures); var featureList = dictionaryEntry.OtherFeatures; var otherFeatureIds = OtherInfo.MapFeatures(featureList); var bufferEntry = new BufferEntry(); bufferEntry.TokenInfo.Add(leftId); bufferEntry.TokenInfo.Add(rightId); bufferEntry.TokenInfo.Add(wordCost); if (EntriesFitInAByte(entryCount)) { var posFeatureIdBytes = CreatePosFeatureIds(posFeatureIds); bufferEntry.PosInfo.AddRange(posFeatureIdBytes); } else { foreach (var posFeatureId in posFeatureIds) { bufferEntry.TokenInfo.Add((short)posFeatureId); } } bufferEntry.Features.AddRange(otherFeatureIds); BufferEntries.Add(bufferEntry); Surfaces.Add(dictionaryEntry.Surface); if (DictionaryEntries != null) { DictionaryEntries.Add(dictionaryEntry); } } }
/// <summary> /// 插入一个终端 /// </summary> /// <param name="loggingSession">当前用户的登录信息</param> /// <param name="pos">终端信息</param> /// <returns></returns> public bool InsertPos(LoggingSessionInfo loggingSession, PosInfo pos) { if (string.IsNullOrEmpty(pos.ID)) { pos.ID = this.NewGuid(); } pos.CreateUserID = loggingSession.CurrentUser.User_Id; pos.CreateUserName = loggingSession.CurrentUser.User_Name; //保存 cSqlMapper.Instance(loggingSession.CurrentLoggingManager).Insert("Pos.Pos.Insert", pos); //从数据库查询出 pos = (PosInfo)cSqlMapper.Instance(loggingSession.CurrentLoggingManager).QueryForObject <PosInfo>("Pos.Pos.SelectPosByID", pos.ID); //提交至管理平台 return(this.synPosToAP(loggingSession.CurrentLoggingManager.Customer_Id, 1, pos)); }
private bool synPosToAP(string customerID, int type, PosInfo pos) { //#if SYN_AP //提交至管理平台 //cPos.WebServices.CustomerDataExchangeWebService.CustomerDataExchangeService service = new WebServices.CustomerDataExchangeWebService.CustomerDataExchangeService(); //service.Url = System.Configuration.ConfigurationManager.AppSettings["ap_url"] + "/customer/CustomerDataExchangeService.asmx"; //this.Log(LogLevel.DEBUG, "bs", "service", "synPosToAP", "url", service.Url); //string s = cXMLService.Serialiaze(pos); //this.Log(LogLevel.DEBUG, "bs", "service", "synPosToAP", "pos", s); //bool ret = service.SynTerminal(customerID, type, s); //return ret; //#else return(true); //#endif }
private NameLevel GetStructureName(PosInfo loc, List <CommandInfo> results) { string[] tags = new string[] { GoldMine, ElixirCollector, TownHall, GoldStorage, ElixirStorage, Barracks, ArmyCamp, Laboratory, ClanCastle, }; var bottom = results.FirstOrDefault(r => r.command == "RecoResult_INFO_Bottom"); string best = ""; string bestTag = ""; if (bottom != null) { foreach (var tag in tags) { var res = LCS.LongestCommonSubsequence(tag.ToLower(), bottom.Text.ToLower()); if (res.Length > best.Length) { best = res; bestTag = tag; } } int bestDiff = bestTag.Length - best.Length; context.vdcontroller.Log("info", $" at {loc.point.x},{loc.point.y} got {bottom.command}:{bottom.Text} diff {bestDiff}"); if (bestDiff < 2) { { var fullTxt = bottom.Text; context.vdcontroller.Log("info", "BESTTAG====> " + bestTag + " " + best); int levelInd = fullTxt.IndexOf("level") + 5; int endInd = fullTxt.IndexOf(")", levelInd); string level = ""; if (levelInd > 0 && endInd > levelInd) { level = fullTxt.Substring(levelInd, endInd - levelInd); } return(new NameLevel { name = bestTag, level = level, }); } } } return(null); }
public Tuple <IEnumerable <BPiaoBaoTPos.Domain.Models.PosInfo>, int> GetPosList(string code, string key, string posNo, string businessmanName, bool?isAssign, int startIndex, int count) { CashbagHelper ch = new CashbagHelper(WebUrlTPos + "QueryPOS", "GET"); Dictionary <string, string> dictionary = new Dictionary <string, string>(); dictionary.Add("code", code); dictionary.Add("key", key); dictionary.Add("CompanyName", businessmanName); if (isAssign.HasValue) { dictionary.Add("Status", isAssign.Value == true ? "1" : "0"); } dictionary.Add("POSNumber", posNo); var page = Math.Ceiling((double)startIndex / count) + 1; dictionary.Add("CurrentPage", page.ToString()); dictionary.Add("PageSize", count.ToString()); dictionary.Add("currentTime", DateTime.Now.ToString("yyyyMMddHHmmss")); string data = ch.ParamsURLEncode(dictionary); var result = ch.GetBackJsonData(data); if (result.status == false) { throw new CustomException(500, result.message.ToString()); } List <PosInfo> list = new List <PosInfo>(); var rows = JArray.FromObject(result.result.rows); int totalcount = result.result.total; foreach (var item in rows) { PosInfo posinfo = new PosInfo() { BusinessmanName = item.PosCompany, PosNo = item.PosNumber, PosRate = item.posRate, Status = item.Status == 1 ? true : false, StatusStr = item.StatusStr, CompanyID = item.CompanyID }; list.Add(posinfo); } Tuple <IEnumerable <PosInfo>, int> tuple = new Tuple <IEnumerable <PosInfo>, int>(list, totalcount); return(tuple); }
/// <summary> /// 修改pos信息 /// </summary> /// <param name="posInfo"></param> /// <returns></returns> public bool UpdatePos(PosInfo posInfo) { try { #region string sql = " update t_pos set " + " pos_type = '" + posInfo.Type + "', " + " pos_brand = '" + posInfo.Brand + "', " + " pos_model = '" + posInfo.Model + "', " + " pos_code = '" + posInfo.Code + "', " + " pos_sn = '" + posInfo.SN + "', " + " pos_purchase_date = '" + posInfo.PurchaseDate + "', " + " pos_insurance_date = '" + posInfo.InsuranceDate + "', " + " pos_ws = '" + posInfo.WS + "', " + " pos_ws2 = '" + posInfo.WS2 + "', " + " pos_db_version = '" + posInfo.DBVersion + "', " + " pos_software_version = '" + posInfo.SoftwareVersion + "', " + " pos_have_cashbox = '" + posInfo.HaveCashbox + "', " + " pos_cashbox_no = '" + posInfo.CashboxNo + "', " + " pos_have_ecard = '" + posInfo.HaveEcard + "', " + " pos_ecard_no = '" + posInfo.EcardNo + "', " + " pos_have_scanner = '" + posInfo.HaveScanner + "', " + " pos_scanner_no = '" + posInfo.ScannerNo + "', " + " pos_have_client_display = '" + posInfo.HaveClientDisplay + "', " + " pos_client_display_no = '" + posInfo.ClientDisplayNo + "', " + " pos_have_printer = '" + posInfo.HavePrinter + "', " + " pos_printer_no = '" + posInfo.PrinterNo + "', " + " pos_have_other_device = '" + posInfo.HaveOtherDevice + "', " + " pos_other_device_no = '" + posInfo.OtherDeviceNo + "', " + " pos_have_holder = '" + posInfo.HaveHolder + "', " + " pos_holder_no = '" + posInfo.HolderNo + "', " + " pos_remark = '" + posInfo.Remark + "', " + " modify_user_id= '" + posInfo.ModifyUserID + "', " + " modify_user_name = '" + posInfo.ModifyUserName + "', " + " modify_time = getdate() " + " where pos_id = '" + posInfo.ID + "'"; #endregion this.SQLHelper.ExecuteNonQuery(sql); return(true); } catch (Exception ex) { throw (ex); } }
/// <summary> /// 修改从管理平台发过来的终端 /// </summary> /// <param name="pos">终端信息</param> /// <param name="customerID">客户ID</param> /// <returns></returns> public bool ModifyPosFromAP(PosInfo pos, string customerID) { //LoggingSessionInfo ls = new LoggingSessionInfo(); //ls.CurrentLoggingManager = new cLoggingManager().GetLoggingManager(customerID); ////未找到,则插入,否则修改 //PosInfo pp = this.GetPosByID(ls, pos.ID); //if (pp == null) //{ // cSqlMapper.Instance(ls.CurrentLoggingManager).Insert("Pos.Pos.InsertPosFromAP", pos); // return true; //} //else //{ // int ret = cSqlMapper.Instance(ls.CurrentLoggingManager).Update("Pos.Pos.UpdatePosFromAP", pos); // return ret == 1; //} return(false); }
/// <summary> /// 修改从管理平台发过来的终端 /// </summary> /// <param name="pos">终端信息</param> /// <param name="customerID">客户ID</param> /// <returns></returns> public bool ModifyPosFromAP(PosInfo pos, string customerID) { LoggingSessionInfo ls = new LoggingSessionInfo(); ls.CurrentLoggingManager = new cLoggingManager().GetLoggingManager(customerID); //未找到,则插入,否则修改 PosInfo pp = this.GetPosByID(ls, pos.ID); if (pp == null) { cSqlMapper.Instance(ls.CurrentLoggingManager).Insert("Pos.Pos.InsertPosFromAP", pos); return(true); } else { int ret = cSqlMapper.Instance(ls.CurrentLoggingManager).Update("Pos.Pos.UpdatePosFromAP", pos); return(ret == 1); } }
static string CreateInfoText(string tag) { if (string.IsNullOrEmpty(tag) || !mTagInfo.ContainsKey(tag[0])) { return(tag); } PosInfo posInfo = mTagInfo[tag[0]]; string infoText = tag[0] + " = " + posInfo.mPosCat; for (int i = 1; i < tag.Length; i++) { AttrInfo attrInfo = posInfo.mAttrInfo[i - 1]; if (attrInfo.mAttrValInfo.ContainsKey(tag[i])) { infoText += string.Format("\n{0} = {1} = {2}", tag[i], attrInfo.mAttrName, attrInfo.mAttrValInfo[tag[i]]); } } return(infoText); }
static void LoadTagInfo() { string[] lines = File.ReadAllLines(Global.mServer.MapPath("~\\App_Data\\tagExpl.txt")); foreach (string line in lines) { string[] data = line.Split('\t'); if (!mTagInfo.ContainsKey(data[0][0])) { mTagInfo.Add(data[0][0], new PosInfo(data[1])); } PosInfo posInfo = mTagInfo[data[0][0]]; if (data[3] != "") { int idx = Convert.ToInt32(data[3]) - 1; if (posInfo.mAttrInfo.Count - 1 < idx) { posInfo.mAttrInfo.Add(new AttrInfo(data[4])); } AttrInfo attrInfo = posInfo.mAttrInfo.Last; attrInfo.mAttrValInfo.Add(data[2][0], data[5]); } } }
/// <summary> /// /// </summary> /// <param name="singleEffect"></param> /// <param name="game"></param> /// <returns></returns> public static List <string> RunEffect(EffectDefine singleEffect, Client.GameManager game, List <String> PosList) { List <String> Result = new List <string>(); int AttackPoint = singleEffect.ActualEffectPoint; //处理对象 foreach (var PosInfo in PosList) { var PosField = PosInfo.Split(CardUtility.strSplitMark.ToCharArray()); if (PosField[0] == CardUtility.strMe) { //位置从1开始,数组从0开始 RunPointEffect(game.MySelf.RoleInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1], singleEffect.AddtionInfo); } else { //位置从1开始,数组从0开始 RunPointEffect(game.YourInfo.BattleField.BattleMinions[int.Parse(PosField[1]) - 1], singleEffect.AddtionInfo); } Result.Add(Card.Server.ActionCode.strPoint + Card.CardUtility.strSplitMark + PosInfo + Card.CardUtility.strSplitMark + singleEffect.AddtionInfo); } return(Result); }
//判断该位置有没有砖块,如果有,返回这个位置的方位 private Direction haveBlock(PosInfo pi) { for (int i=0; i<blockList.Count; i++) { if (blockList [i].transform.position == pi.Pos) { return pi.Direction; } } return Direction.Error; }
/// <summary> /// Метод, преобразующий "человеческие" координаты в пиксели. /// </summary> /// <param name = "posInfo">Структура с данными о специфике преобразования.</param> /// <param name = "coord">"Человеческая" координата.</param> private static int CoordToPos(PosInfo posInfo, int coord, int size) { if (posInfo == X) return posInfo.Zero + coord * posInfo.Step - size / 2; else return posInfo.Zero - coord * posInfo.Step - size / 2; }