public string GPSSelect() { List <TerminalBind> ltb = new List <TerminalBind>(); TerminalBind tb = new TerminalBind(); ltb.Add(tb); ltb.Add(tb); ltb.Add(tb); ltb.Add(tb); ltb.Add(tb); ltb.Add(tb); ltb.Add(tb); ltb.Add(tb); ltb.Add(tb); ltb.Add(tb); return(ConvertToJson(ltb, 10)); }
public string AddCarAndTer(TerminalBind tb) { ISqlMapper NewMap = SqlMapper.Instance(); NewMap.BeginTransaction(); try { CarInfo ci = (CarInfo)ExecuteQueryForObjectTrans("CarInfo.SelectCarInfo", tb.CarNo, NewMap); if (ci == null) { ci = new CarInfo(); ci.CarId = System.Guid.NewGuid().ToString(); ci.CarNo = tb.CarNo; ci.Businessdivisionid = tb.DeptId; ci.CarDeptcode = tb.Businessdivisioncode; ci.TypeId = tb.TypeId; ExecuteInsertTrans("CarInfo.InsertCarInfo", ci, NewMap); } TerminalInfo di = (TerminalInfo)ExecuteQueryForObjectTrans("TerminalInfo.SelectTerminalInfo", tb.TerGuid, NewMap); if (di == null) { NewMap.RollBackTransaction(); return(tb.TerNo + " NotExistTer"); } else { TerminalInfo ti = new TerminalInfo(); ti.TerGuid = tb.TerGuid; ti.CarId = ci.CarId; ti.TerCarno = ci.CarNo; ti.DeptId = tb.DeptId; ti.TerDeptcode = tb.Businessdivisioncode; ExecuteUpdateTrans("TerminalInfo.BindTerCar", ti, NewMap); NewMap.CommitTransaction(); return("true"); } } catch (Exception e) { NewMap.RollBackTransaction(); return("false"); } }
public string AddCarAndTer(TerminalBind tb) { UserInfo user = new UserInfo(); user = (UserInfo)Session["LoginUser"]; if (user != null) { if (tb.DeptId != null && tb.DeptId.Trim() == "") { tb.DeptId = user.EnterId; } DeptInfoBLL deptInfoBll = new DeptInfoBLL(); DeptInfo di = deptInfoBll.GetDeptInfo(tb.DeptId); string deptcode = di.Businessdivisioncode; tb.Businessdivisioncode = deptcode; string carinfostr = ""; CarTypeBLL cartypebll = new CarTypeBLL(); CarType ct = cartypebll.GetCarType(tb.TypeId); if (ct != null) { carinfostr = ct.TypeName + "||||||||||||||||||||||||||||||"; } string result = tib.AddCarAndTer(tb); new LogMessage().Save("TerNo:" + tb.TerNo + "。"); if (result == "true") { //绑车接口 Transfers.ClintSendCommData(1107, "50", "", tb.CarNo, "", "", "", "", "", "", "", deptcode, tb.CarNo, carinfostr, "", "", "", "", user.UserName); //刷新车辆 Transfers.ClintSendCommData(1160, "1108", "", "", "", "", "", "", "", "", "", "1", "2", "", "", "", "", "", ""); } return(result); } else { return("false"); } }
public string GetTerBindList(TerminalBind tb, int rows, int page) { UserInfo user = new UserInfo(); user = (UserInfo)Session["LoginUser"]; if (user != null) { tb.StartData = (page - 1) * rows + 1; tb.EndData = tb.StartData + rows; if (tb.DeptId == null || tb.DeptId.Trim() == "") { tb.DeptId = user.EnterId; } IList <TerminalBind> itb = tib.GetTerminalBindPage(tb); int c = tib.GetTerminalBindCount(tb); return(ConvertToJson(itb, c)); } else { return("[]"); } }
public string AddCarAndTer(TerminalBind tib) { return(_iTerminalInfoDao.AddCarAndTer(tib)); }