public Shapes MakeShapes() { XmlProvider provider = new XmlProvider(XmlFileName); Shapes mainShapes = new Shapes(); Railyard railyard = MakeRailyard(); // till work with one railYard Shapes shapes = new Shapes(); // shapes in railYard //shapes.RailTracksList = makeListOfTracks(); //shapes.RailroadSwitchesList = makeListOfSwitches(); railyard.Shapes = shapes; mainShapes.RailyardsList.Add(railyard); // have in a view that only one railyard will be in mainShapes //foreach (ObjectId acObjId in _blockTableRecord) //{ // // can use it in debug // //acDoc.Editor.WriteMessage("\n" + acObjId.ObjectClass.Name + " - " + acObjId + " - " + acObjId.ObjectClass.DxfName); // switch (acObjId.ObjectClass.DxfName) // see object type // { // // work with PolyLines // case "LWPOLYLINE": // { // DBObject dbObject = acObjId.GetObject(OpenMode.ForRead); // Polyline pln = dbObject as Polyline; // int vn = pln.NumberOfVertices; // StringBuilder stringForWriteInFile = new StringBuilder($"track{++_counterForTracks}: "); // for (int i = 0; i < vn; i++) // { // // Could also get the 3D point here // Point2d pt = pln.GetPoint2dAt(i); // acDoc.Editor.WriteMessage("\n" + pt.X + " - " + pt.Y); // stringForWriteInFile.Append($"{pt.X:0.00} {pt.Y:0.00} "); // } // file.WriteLine(stringForWriteInFile.ToString()); // write information about next polyline // break; // } // // work with dots // case "POINT": // { // DBObject dbObject = acObjId.GetObject(OpenMode.ForRead); // // use reflextion to get point // PropertyInfo positionProperty = dbObject.GetType().GetProperty("Position"); // Point3d point3d = (Point3d)positionProperty.GetValue(dbObject); // // write information in file // string stringForWriteInFile = $"switch{++_counterForSwitches}: {point3d.X:0.00} {point3d.Y:0.00}"; // acDoc.Editor.WriteMessage("\n" + point3d.X + " - " + point3d.Y); // file.WriteLine(stringForWriteInFile); // break; // } // } // nCnt = nCnt + 1; //} return(null); }
//判断是否为司机 public string isDriver(string _account) { XmlDocument _result = XmlProvider.Document("data"); string _sql = readXml("getDriver"); //判断司机表是否存在该用户 using (SqlCommand _cmd = new SqlCommand()) { _cmd.Connection = SQLConfig.Connection(this.conn); _cmd.CommandText = _sql; SqlParameter _driverAccount = new SqlParameter("DriverAccount", SqlDbType.NVarChar, 50); _driverAccount.Value = _account; _cmd.Parameters.Add(_driverAccount); _result = SQLProvider.GetData(_cmd); } if (_result.DocumentElement.SelectSingleNode("SchemaTable") != null) { return(_result.DocumentElement.SelectSingleNode("SchemaTable/Player").InnerText.Trim()); } else { return(""); } }
/// <summary> /// 插入车辆状态更改记录 /// </summary> /// <param name="_parGuid"></param> /// <param name="_parLicenseID"></param> /// <param name="_parState"></param> /// <returns></returns> public XmlDocument insertChangeState(string _parLicenseID, string _parState) { result = XmlProvider.Document("configdata"); string _sql = readXml("insertChangeState"); using (SqlCommand _cmd = new SqlCommand()) { _cmd.Connection = SQLConfig.Connection(this.conn); _cmd.CommandText = _sql; SqlParameter _guid = new SqlParameter("Guid", SqlDbType.NVarChar, 50); _guid.Value = Provider.GUID; _cmd.Parameters.Add(_guid); SqlParameter _licenseid = new SqlParameter("LicenseID", SqlDbType.NVarChar, 50); _licenseid.Value = _parLicenseID; _cmd.Parameters.Add(_licenseid); SqlParameter _state = new SqlParameter("NewCarState", SqlDbType.NVarChar, 50); _state.Value = _parState; _cmd.Parameters.Add(_state); SqlParameter _datetime = new SqlParameter("ChangeDatetime", SqlDbType.NVarChar, 50); _datetime.Value = DateTime.Now; _cmd.Parameters.Add(_datetime); result = SQLProvider.Transcation(_cmd); } return(this.result); }
public static void Test() { var xml = XmlProvider.GetXml(); // Returns the long XML string from the post. var matchSet = XmlSerializationHelper.LoadFromXML <matchset>(xml); Debug.WriteLine(matchSet.GetXml()); }
/// <summary> /// 查询某车牌的车辆在某天的车辆状态 /// </summary> /// <param name="_LicenseID"></param> /// <param name="_Day"></param> /// <returns></returns> public string getCarStateByLicenseIDAndDay(string _LicenseID, string _Day) { result = XmlProvider.Document("configdata"); string _sql = readXml("getCarStateByLicenseIDAndDay");//Car.xml 中的 查询某车牌的车辆在某天的车辆状态 的标签的 type 为 getCarStateByLicenseIDAndDay using (SqlCommand _cmd = new SqlCommand()) { _cmd.Connection = SQLConfig.Connection(this.conn); _cmd.CommandText = _sql; SqlParameter _dChangeDateTime = new SqlParameter("ChangeDateTime", SqlDbType.NVarChar, 50); _dChangeDateTime.Value = _Day; _cmd.Parameters.Add(_dChangeDateTime); SqlParameter _dLicenseID = new SqlParameter("LicenseID", SqlDbType.NVarChar, 50); _dLicenseID.Value = _LicenseID; _cmd.Parameters.Add(_dLicenseID); result = SQLProvider.GetData(_cmd); } if (this.result.DocumentElement.SelectSingleNode("SchemaTable") == null) { return(""); } else { return(this.result.DocumentElement.SelectSingleNode("SchemaTable/NewCarState").InnerText.ToString().Trim());//车辆状态 } }
internal void RunJsonTasks() { try { ////Import data into the database. //JsonProvider.ImportUsers(); //JsonProvider.ImportProducts(); //JsonProvider.ImportCategories(); //JsonProvider.ImportCategoriesProducts(); ////Export data from the database into Json. //JsonProvider.ExportProductsInPriceRange(); //JsonProvider.ExportSuccessfullySelledProducts(); //JsonProvider.ExportCategoriesByProducts(); //JsonProvider.ExportUsersSoldProducts(); ////Export data from the database into Xml. XmlProvider.ExportProductsInRange(); } catch (Exception ex) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(ex.Message); Console.ForegroundColor = this.color; } }
//司机与车辆绑定 public XmlDocument Bound(string _licenseID, string _account) { result = XmlProvider.Document("data"); string _sql = readXml("Bound"); using (SqlCommand _cmd = new SqlCommand()) { _cmd.Connection = SQLConfig.Connection(this.conn); _cmd.CommandText = _sql; SqlParameter licenseID = new SqlParameter("LicenseID", SqlDbType.NVarChar, 50); licenseID.Value = _licenseID; _cmd.Parameters.Add(licenseID); SqlParameter account = new SqlParameter("DriverAccount", SqlDbType.NVarChar, 50); account.Value = _account; _cmd.Parameters.Add(account); XmlDocument _api = XmlProvider.Document("api"); _api.Load("http://api.qgj.cn/webapi/profile.asmx/GetUser?User="******"ITEM/name").InnerText; SqlParameter name = new SqlParameter("DriverName", SqlDbType.NVarChar, 50); name.Value = _name; _cmd.Parameters.Add(name); result = SQLProvider.Transcation(_cmd); } return(result); }
//更换车辆通知(申请人) public void applychangeCar(XmlDocument _data) { //通知信息参数 string _applyAccount = _data.DocumentElement.SelectSingleNode("SchemaTable/CarAppliedAccount").InnerText.ToString().Trim(); //申请人账号 string _applyName = _data.DocumentElement.SelectSingleNode("SchemaTable/CarAppliedName").InnerText.ToString().Trim(); //申请人姓名 string _place = _data.DocumentElement.SelectSingleNode("SchemaTable/Destination").InnerText.ToString().Trim(); //目的地 string _driAccount = _data.DocumentElement.SelectSingleNode("SchemaTable/COAccount").InnerText.ToString().Trim(); //司机账号 string _driName = _data.DocumentElement.SelectSingleNode("SchemaTable/CarOwner").InnerText.ToString().Trim(); //司机姓名 string _startTime = _data.DocumentElement.SelectSingleNode("SchemaTable/StartTime").InnerText.ToString().Trim(); //开始时间 string _endTime = _data.DocumentElement.SelectSingleNode("SchemaTable/EndTime").InnerText.ToString().Trim(); //结束时间 string _driTel = _data.DocumentElement.SelectSingleNode("SchemaTable/CarTelephone").InnerText.ToString().Trim(); //司机联系方式 string _applyTel = _data.DocumentElement.SelectSingleNode("SchemaTable/AppliedTel").InnerText.ToString().Trim(); //申请人联系方式 string _txt = "车辆更换通知:\r申请人:" + _applyName + "\r目的地:" + _place + "\r您的车辆因为调度员调换的原因被取消,系统将重新为您分配车辆" + "\r通知时间:" + DateTime.Now; //原 腾讯通 通知 //XmlDocument _notify = XmlProvider.Document("api"); //_notify.Load("http://api.qgj.cn/webapi/rtx.asmx/SendNotify?Uids=" + _applyAccount + ";&Title=车辆预约结果&Txt=[" + _txt + "|http://webservices.qgj.cn/cldd/index.html]&Time=20000"); //钉钉通知 string _userid = _applyAccount; sendDingdingMsg(_userid, _txt); //短信提示 XmlDocument _sms = XmlProvider.Document("api"); _sms.Load("http://api.qgj.cn/webapi/sms.asmx/Send?Uids=" + _applyAccount + "&Message=" + _txt); }
//通知调度员审核 public void sendSureApply(XmlDocument _data) { string _sysAccount = getSysAccount(); string _applyAccount = _data.DocumentElement.SelectSingleNode("SchemaTable/CarAppliedAccount").InnerText.ToString().Trim(); //申请人账号 string _applyName = _data.DocumentElement.SelectSingleNode("SchemaTable/CarAppliedName").InnerText.ToString().Trim(); //申请人名字 string _place = _data.DocumentElement.SelectSingleNode("SchemaTable/Destination").InnerText.ToString().Trim(); //目的地 string _startTime = _data.DocumentElement.SelectSingleNode("SchemaTable/StartTime").InnerText.ToString().Trim(); //开始时间 string _endTime = _data.DocumentElement.SelectSingleNode("SchemaTable/EndTime").InnerText.ToString().Trim(); //开始时间 string _reson = _data.DocumentElement.SelectSingleNode("SchemaTable/ApplieReson").InnerText.ToString().Trim(); //申请理由 string _txt = "车辆申请通知:\r" + _applyName + "申请目的地为:" + _place + ";\r开始时间为:" + _startTime + ";\r结束时间为:" + _endTime + "的车辆,\r申请理由为理由为:" + _reson + "\r通知时间:" + DateTime.Now; string _applyTxt = "车辆申请通知:\r 您申请的开始时间为:" + _startTime + "\r 目的地为:" + _place + "\r 的车辆等待管理员的审核\r通知时间:" + DateTime.Now; //钉钉通知 string _userid = _sysAccount; sendDingdingMsg(_userid, _txt); _userid = _applyAccount; sendDingdingMsg(_userid, _applyTxt); //短信提示 XmlDocument _sms = XmlProvider.Document("api"); XmlDocument _smsApply = XmlProvider.Document("api"); _sms.Load("http://api.qgj.cn/webapi/sms.asmx/Send?Uids=" + _sysAccount + "&Message=" + _txt); _smsApply.Load("http://api.qgj.cn/webapi/sms.asmx/Send?Uids=" + _applyAccount + "&Message=" + _txt); }
//延迟归来通知(管理员、部门领导) public void delyApply(XmlDocument _data) { string _sysAccount = getSysAccount(); string _place = _data.DocumentElement.SelectSingleNode("SchemaTable/Destination").InnerText.ToString().Trim(); //目的地 string _startTime = _data.DocumentElement.SelectSingleNode("SchemaTable/StartTime").InnerText.ToString().Trim(); //开始时间 string _txt = "车辆延迟归来通知:\r您预约的目的地为:" + _place + ",开始时间:" + _startTime + "的车辆预约因为该车当前使用者申请延期返回而被取消,系统将为你重新分配车辆。" + "\r通知时间:" + DateTime.Now; string _applyAccount = _data.DocumentElement.SelectSingleNode("SchemaTable/CarAppliedAccount").InnerText.ToString().Trim(); string _leaderAccount = getDepart(_applyAccount); //XmlDocument _notify = XmlProvider.Document("api"); if (_leaderAccount != "") { //钉钉通知 string _userid = _leaderAccount + "," + _sysAccount; sendDingdingMsg(_userid, _txt); //短信提示 XmlDocument _sms = XmlProvider.Document("api"); _sms.Load("http://api.qgj.cn/webapi/sms.asmx/Send?Uids=" + _leaderAccount + "," + _sysAccount + "&Message=" + _txt); } else { //钉钉通知 string _userid = _sysAccount; sendDingdingMsg(_userid, _txt); //短信提示 XmlDocument _sms = XmlProvider.Document("api"); _sms.Load("http://api.qgj.cn/webapi/sms.asmx/Send?Uids=" + _sysAccount + "&Message=" + _txt); } }
//取消预约通知(管理员、申请人、部门领导、司机) public void cancelApplyResult(XmlDocument _data) { //通知信息参数 string _applyName = _data.DocumentElement.SelectSingleNode("SchemaTable/CarAppliedName").InnerText.ToString().Trim(); //申请人姓名 string _place = _data.DocumentElement.SelectSingleNode("SchemaTable/Destination").InnerText.ToString().Trim(); //目的地 string _driAccount = _data.DocumentElement.SelectSingleNode("SchemaTable/COAccount").InnerText.ToString().Trim(); //司机账号 string _driName = _data.DocumentElement.SelectSingleNode("SchemaTable/CarOwner").InnerText.ToString().Trim(); //司机姓名 string _startTime = _data.DocumentElement.SelectSingleNode("SchemaTable/StartTime").InnerText.ToString().Trim(); //开始时间 string _driTel = _data.DocumentElement.SelectSingleNode("SchemaTable/CarTelephone").InnerText.ToString().Trim(); //司机联系方式 string _endTime = _data.DocumentElement.SelectSingleNode("SchemaTable/EndTime").InnerText.ToString().Trim(); //结束时间 string _txt = "车辆预约取消通知:\r申请人:" + _applyName + "\r目的地:" + _place + "\r开始时间:" + _startTime + "\r结束时间:" + _endTime + "\r车辆信息:\r司机:" + _driName + "\r联系方式:" + _driTel + "\r车辆申请已被申请人取消。" + "\r通知时间:" + DateTime.Now; string _applyAccount = _data.DocumentElement.SelectSingleNode("SchemaTable/CarAppliedAccount").InnerText.ToString().Trim(); string _sysAccount = getSysAccount(); string _leaderAccount = getDepart(_applyAccount); //XmlDocument _notify = XmlProvider.Document("api"); if (_leaderAccount != "") { //钉钉通知 string _userid = _applyAccount + "," + _leaderAccount + "," + _sysAccount + "," + _driAccount; sendDingdingMsg(_userid, _txt); //短信提示 XmlDocument _sms = XmlProvider.Document("api"); _sms.Load("http://api.qgj.cn/webapi/sms.asmx/Send?Uids=" + _sysAccount + "," + _leaderAccount + "," + _driAccount + "," + _applyAccount + "&Message=" + _txt); } else { //钉钉通知 string _userid = _applyAccount + "," + _sysAccount + "," + _driAccount; sendDingdingMsg(_userid, _txt); //短信提示 XmlDocument _sms = XmlProvider.Document("api"); _sms.Load("http://api.qgj.cn/webapi/sms.asmx/Send?Uids=" + _sysAccount + "," + _driAccount + "," + _applyAccount + "&Message=" + _txt); } }
public override XmlDocument Response() { this.result = XmlProvider.Document("pagedata"); switch (this.PARAMS["guid"].ToString()) { case "car_mounth_report": reportCarDetail(); break; case "reqcar_mounth_report": reqCarMounthReport(); break; case "print_car_mounth": printCarMounth(); break; } //附加显示样式 XmlElement _template = this.result.CreateElement("template"); _template.SetAttribute("output", "html"); if (File.Exists(Provider.Path("/ui/report/" + this.PARAMS["guid"].ToString() + ".xsl"))) { _template.InnerXml = "/ui/report/" + this.PARAMS["guid"].ToString() + ".xsl"; } else { _template.InnerXml = "/ui/pages/err.xsl"; } this.result.DocumentElement.AppendChild(_template); return(this.result); }
//修改司机 public XmlDocument motifyDriver(string _driverID, string _driverName, string _driverAccount, string _carTelephone, string _licenseID) { result = XmlProvider.Document("configdata"); string _sql = readXml("motifyDriver"); using (SqlCommand _cmd = new SqlCommand()) { _cmd.Connection = SQLConfig.Connection(this.conn); _cmd.CommandText = _sql; SqlParameter driverID = new SqlParameter("DriverID", SqlDbType.NVarChar, 50); driverID.Value = _driverID; _cmd.Parameters.Add(driverID); SqlParameter driverName = new SqlParameter("DriverName", SqlDbType.NVarChar, 50); driverName.Value = _driverName; _cmd.Parameters.Add(driverName); SqlParameter driverAccount = new SqlParameter("DriverAccount", SqlDbType.NVarChar, 50); driverAccount.Value = _driverAccount; _cmd.Parameters.Add(driverAccount); SqlParameter carTelephone = new SqlParameter("CarTelephone", SqlDbType.NVarChar, 50); carTelephone.Value = _carTelephone; _cmd.Parameters.Add(carTelephone); SqlParameter licenseID = new SqlParameter("LicenseID", SqlDbType.NVarChar, 50); licenseID.Value = _licenseID; _cmd.Parameters.Add(licenseID); result = SQLProvider.Transcation(_cmd); } return(result); }
/// <summary> /// 添加一个临时调度员 /// </summary> /// <param name="_permitAccount">临时调度员账号</param> /// <returns></returns> public XmlDocument addLsDispatcher(string _permitAccount) { result = XmlProvider.Document("configdata"); string _sql = readXml("addLsDispather");//Dispather.xml中的添加临时调度员的标签的type为addLsDispather using (SqlCommand _cmd = new SqlCommand()) { _cmd.Connection = SQLConfig.Connection(this.conn); _cmd.CommandText = _sql; SqlParameter resourceID = new SqlParameter("ResourceID", SqlDbType.NVarChar, 50); resourceID.Value = "LSSYSTEM"; _cmd.Parameters.Add(resourceID); SqlParameter resourcePermit = new SqlParameter("ResourcePermit", SqlDbType.NVarChar, 50); resourcePermit.Value = "LSADMIN"; _cmd.Parameters.Add(resourcePermit); SqlParameter resourcePermitLev = new SqlParameter("ResourcePermitLev", SqlDbType.Int); resourcePermitLev.Value = Convert.ToInt32(1); _cmd.Parameters.Add(resourcePermitLev); //临时调度员账号的账号名称 SqlParameter permitAccount = new SqlParameter("PermitAccount", SqlDbType.NVarChar, 50); permitAccount.Value = _permitAccount; _cmd.Parameters.Add(permitAccount); result = SQLProvider.Transcation(_cmd); } return(result); }
public string RollList(string TableName, int NumberOfRolls) { XmlProvider provider = new XmlProvider(Repository.GetCurrentRepository(), _dataFilePath); Repository.Connect(provider); Repository bits = Repository.GetCurrentRepository(); // Perform a number of rolls on the table SortedList <string, int> list = Repository.GetTable(TableName).RollList(NumberOfRolls); // Dump the results into a serializable array ResultItem[] result = new ResultItem[list.Count]; for (int i = 0; i < list.Count; i++) { ResultItem item = new ResultItem(); item.Name = list.Keys[i]; item.Count = list.Values[i]; result[i] = item; } // Return the results as JSON data JavaScriptSerializer js = new JavaScriptSerializer(); return(js.Serialize(result)); }
/// <summary> /// 结束维修 /// </summary> /// <param name="_reqFixID"></param> /// <returns></returns> public XmlDocument endFixedStatue(string _reqFixID) { result = XmlProvider.Document("configdata"); string _sql = readXml("endFixedStatue"); try { using (SqlCommand _cmd = new SqlCommand()) { _cmd.Connection = SQLConfig.Connection(this.conn); _cmd.CommandText = _sql; SqlParameter _guid = new SqlParameter("FixID", SqlDbType.NVarChar, 50); _guid.Value = _reqFixID; _cmd.Parameters.Add(_guid); SqlParameter _endTime = new SqlParameter("EndTime", SqlDbType.NVarChar, 50); _endTime.Value = DateTime.Now.ToString(); _cmd.Parameters.Add(_endTime); result = SQLProvider.Transcation(_cmd); } } catch (Exception _exc) { Provider.LogErr(result, _exc); } return(this.result); }
public override void OnCompleted() { try { // apply license verification UnderlyingJob.Complete(); if (File.Exists(LocalFileName)) { var command = XmlProvider.ReadFromFile <ProductLicenseCommand>( LocalFileName, Encoding.ASCII ); LicenseServices.RegisterLicenseOverrideCommand(command); if (CommandDownloaded != null) { CommandDownloaded(this, new BITSLicenseCommandDownloadEvent { Command = command }); } } } catch { // ServicesProvider.ReportError(error); } finally { if (File.Exists(LocalFileName)) { try { File.Delete(LocalFileName); } catch { } } } }
/// <summary> /// 查询某日某车是否有维修记录 /// </summary> /// <param name="_reqLicenseID">车牌</param> /// <param name="_reqDate">日期</param> /// <returns>维修记录</returns> public XmlDocument getDayFixedByLicense(string _reqLicenseID, string _reqDate) { result = XmlProvider.Document("configdata"); string _sql = readXml("getDayFixedByLicense"); try { using (SqlCommand _cmd = new SqlCommand()) { _cmd.Connection = SQLConfig.Connection(this.conn); _cmd.CommandText = _sql; SqlParameter _licenseID = new SqlParameter("LicenseID", SqlDbType.NVarChar, 50); _licenseID.Value = _reqLicenseID; _cmd.Parameters.Add(_licenseID); SqlParameter _startTime = new SqlParameter("StartTime", SqlDbType.NVarChar, 50); _startTime.Value = Convert.ToDateTime(_reqDate); _cmd.Parameters.Add(_startTime); result = SQLProvider.GetData(_cmd); } } catch (Exception _exc) { Provider.LogErr(result, _exc); } return(this.result); }
//根据车牌查找所有对应的待出车记录 public XmlDocument getListByLicenseID(string _reqLicenseID) { this.result = XmlProvider.Document("sqldata"); try { string _sql = readXml("getListByLicenseID"); //读取数据 using (SqlCommand _cmd = new SqlCommand()) { _cmd.Connection = SQLConfig.Connection(this.conn); _cmd.CommandText = _sql; SqlParameter _appLicenseID = new SqlParameter("LicenseID", SqlDbType.NVarChar, 50); _appLicenseID.Value = _reqLicenseID; _cmd.Parameters.Add(_appLicenseID); result = SQLProvider.GetData(_cmd); } } catch (Exception _exc) { Provider.LogErr(this.result, _exc); } return(this.result); }
public static T DownloadObject <T>(this IFileTransferClient client, string alias) { client.DownloadFile(alias); using (var streamReader = new StreamReader(client.LocalStore.OpenRead(alias))) { return(XmlProvider.Read <T>(streamReader)); } }
//延期返回 public XmlDocument delayApply(string _guid, int _delayDays, DateTime _delyEndTime) { result = XmlProvider.Document("sqldata"); string _sql = readXml("delayApply"); //读取数据 using (SqlCommand _cmd = new SqlCommand()) { _cmd.Connection = SQLConfig.Connection(this.conn); _cmd.CommandText = _sql; SqlParameter _applyID = new SqlParameter("CarAppliedID", SqlDbType.NVarChar, 50); _applyID.Value = _guid; _cmd.Parameters.Add(_applyID); SqlParameter _endTime = new SqlParameter("EndTime", SqlDbType.NVarChar, 50); _endTime.Value = _delyEndTime; _cmd.Parameters.Add(_endTime); SqlParameter _days = new SqlParameter("Days", SqlDbType.Int); _days.Value = _delayDays; _cmd.Parameters.Add(_days); result = SQLProvider.Transcation(_cmd); } return(result); }
//读取XML public string readXml(string _type) { XmlDocument _config = XmlProvider.Document("sqlConfig"); String _sql = ""; //读取xml文件 try { string _path = "/app_data/apply.xml"; _config.Load(Provider.Path(_path)); foreach (XmlNode _section in _config.DocumentElement.SelectNodes("section")) { if (((XmlElement)_section).Attributes["type"].Value.ToString().Trim() == _type) { _sql = _section.SelectSingleNode("sql").InnerText.ToString().Trim(); break; } } } catch (Exception _exc) { Provider.LogErr(this.result, _exc); } return(_sql); }
private void SavePropertyValue(string propertyName, object value) { var key = PropertyNameToKey(propertyName); switch (GetStorageClass(value.GetType())) { case StorageClass.String: NSUserDefaults.StandardUserDefaults.SetString(ConvertExChangeType <string>(value), PropertyNameToKey(propertyName)); break; case StorageClass.Integer: NSUserDefaults.StandardUserDefaults.SetInt(ConvertExChangeType <int>(value), PropertyNameToKey(propertyName)); break; case StorageClass.Bool: NSUserDefaults.StandardUserDefaults.SetBool(ConvertExChangeType <bool>(value), PropertyNameToKey(propertyName)); break; case StorageClass.Float: NSUserDefaults.StandardUserDefaults.SetFloat(ConvertExChangeType <float>(value), PropertyNameToKey(propertyName)); break; case StorageClass.Double: NSUserDefaults.StandardUserDefaults.SetDouble(ConvertExChangeType <double>(value), PropertyNameToKey(propertyName)); break; case StorageClass.XMLSerialized: NSUserDefaults.StandardUserDefaults.SetString(XmlProvider.WriteToString(key), PropertyNameToKey(propertyName)); break; default: throw new Exception("Internal Error 01B66BCD-FDEB-4FCF-B32F-44B2C8A2A81C"); } }
//拒绝预约 public XmlDocument upStauteRefuse(string _guid, string _statue, string _reson) { result = XmlProvider.Document("sqldata"); string _sql = readXml("upStauteRefuse"); //读取数据 using (SqlCommand _cmd = new SqlCommand()) { _cmd.Connection = SQLConfig.Connection(this.conn); _cmd.CommandText = _sql; SqlParameter _applyID = new SqlParameter("CarAppliedID", SqlDbType.NVarChar, 50); _applyID.Value = _guid; _cmd.Parameters.Add(_applyID); SqlParameter _refuseReson = new SqlParameter("RefuseReson", SqlDbType.NVarChar, 200); _refuseReson.Value = _reson; _cmd.Parameters.Add(_refuseReson); SqlParameter _statues = new SqlParameter("AppliedStatue", SqlDbType.NVarChar, 50); _statues.Value = _statue; _cmd.Parameters.Add(_statues); result = SQLProvider.Transcation(_cmd); } return(result); }
//获取总公里数 public void getKm() { this.result = XmlProvider.Document("sqldata"); string _account = this.context.Request.QueryString["account"]; //司机账号 this.result = (XmlDocument)Provider.Invoke("CLDD.Providers.CarDol.getKm", new object[] { this.context }, new object[] { _account }); }
private XmlDocument TokenExecute(string _txt, string _token) { XmlDocument _result = XmlProvider.Document("sqldata"); try { using (SqlCommand _cmd = new SqlCommand()) { _cmd.Connection = SQLConfig.Connection(this.conn); _cmd.CommandText = _txt; SqlParameter _id = new SqlParameter("id", SqlDbType.NVarChar, 50); _id.Value = _token; _cmd.Parameters.Add(_id); SqlParameter _ip = new SqlParameter("ip", SqlDbType.NVarChar, 50); _ip.Value = this.ip; _cmd.Parameters.Add(_ip); SqlParameter _client = new SqlParameter("client", SqlDbType.NVarChar, 50); _client.Value = this.client; _cmd.Parameters.Add(_client); SqlParameter _expired = new SqlParameter("expired", SqlDbType.DateTime); _expired.Value = DateTime.Now.AddHours(1); _cmd.Parameters.Add(_expired); _result = SQLProvider.Transcation(_cmd); } } catch (Exception _exc) { Provider.LogErr(_result, _exc); } return(_result); }
//修改控制车辆数 public void motifyControlNum() { this.result = XmlProvider.Document("sqldata"); int _num = Convert.ToInt32(this.context.Request.QueryString["num"]); this.result = (XmlDocument)Provider.Invoke("CLDD.Providers.CarDol.upControlNum", new object[] { this.context }, new object[] { _num }); }
/// <summary> /// 取消维修状态 /// </summary> public void endFixedStatue() { this.result = XmlProvider.Document("data"); string _fixID = this.context.Request.QueryString["fixID"]; this.result = (XmlDocument)Provider.Invoke("CLDD.Providers.CarDol.endFixedStatue", new object[] { this.context }, new object[] { _fixID }); }
/// <summary> /// 添加维修记录 /// </summary> public void addFixed() { this.result = XmlProvider.Document("sqldata"); string _reqLisenceID = this.context.Request.Form["LicenseID"]; string _reqStartTime = this.context.Request.Form["StartTime"]; string _reqEndTime = this.context.Request.Form["EndTime"]; XmlDocument _fixedResult = (XmlDocument)Provider.Invoke("CLDD.Providers.CarDol.addFixed", new object[] { this.context }, new object[] { _reqLisenceID, _reqStartTime, _reqEndTime }); if (_fixedResult.DocumentElement.Attributes["affect"].Value.ToString() == "1")//维修记录添加成功 { //查找影响的出车记录 int _days = (Convert.ToDateTime(_reqEndTime) - Convert.ToDateTime(_reqStartTime)).Days; XmlDocument _clashList = (XmlDocument)Provider.Invoke("CLDD.Providers.ApplyService.getClashApplyList", new object[] { this.context }, new object[] { _reqLisenceID, _days, Convert.ToDateTime(_reqStartTime) }); //匹配冲突记录 foreach (XmlNode _section in _clashList.DocumentElement.SelectNodes("SchemaTable")) { string _carAppliedID = _section.SelectSingleNode("CarAppliedID").InnerText; //冲突记录ID //插入数据库的记录 XmlDocument _insertData = (XmlDocument)Provider.Invoke("CLDD.Providers.ApplyDol.getApply", new object[] { this.context }, new object[] { _carAppliedID }); //维修预约通知 //Provider.Invoke("CLDD.Providers.Notice.delyFixChangeApply", new object[] { this.context }, new object[] { _insertData }); //派遣司机 Provider.Invoke("CLDD.Providers.ApplyResponse.sendDriver", new object[] { this.context }, new object[] { _carAppliedID }); } } this.result = _fixedResult; }
public override XmlDocument Response() { this.result = XmlProvider.Document("pagedata"); switch (this.PARAMS["guid"].ToString()) { case "getlsdispatcher": getLsDispatcher(); break; //查询临时调度员账号 case "addlsdispatcher": addLsDispatcher(); return(this.result); //添加临时调度员账号 case "dellsdispatcher": delLsDispatcher(); return(this.result); //删除临时调度员账号 } //附加显示样式 XmlElement _template = this.result.CreateElement("template"); _template.SetAttribute("output", "html"); if (File.Exists(Provider.Path("/ui/dispatcher/" + this.PARAMS["guid"].ToString() + ".xsl"))) { _template.InnerXml = "/ui/dispatcher/" + this.PARAMS["guid"].ToString() + ".xsl"; } else { _template.InnerXml = "/ui/pages/err.xsl"; } this.result.DocumentElement.AppendChild(_template); return(this.result); }
// ------------------------------------------------------- // PUBLIC MEMBERS // ------------------------------------------------------- /// <summary> /// Save the connection string to the configuration file /// </summary> /// <param name="connectionString"></param> public void SaveConnectionString(string connectionString) { this._cn = connectionString; XmlProvider xml = new XmlProvider( this._common_app_data_configfile, OpenMode.ForWriting ); xml.ChangeValueInSecondLevel("connectionString", this._cn); }
/// <summary> /// Default Ctor /// </summary> public Configuration() { // create codecs list this._codecs = new List<string>(); this._codecs.Add(Codec.Unknown.ToString()); this._codecs.Add(Codec.DVD.ToString()); this._codecs.Add(Codec.Divx.ToString()); this._codecs.Add(Codec.Xvid.ToString()); this._codecs.Add(Codec.SVCD.ToString()); this._codecs.Add(Codec.VCD.ToString()); this._codecs.Add(Codec.MVCD.ToString()); this._codecs.Add(Codec.MPEG.ToString()); this._codecs.Add(Codec.WMV.ToString()); this._codecs.Add(Codec.VHS.ToString()); this._codecs.Add(Codec.Other.ToString()); // create qualities list this._quality = new List<string>(); this._quality.Add(Quality.PleaseAnnihilateIt_0.ToString()); this._quality.Add(Quality.VeryBad_1.ToString()); this._quality.Add(Quality.Bad_2.ToString()); this._quality.Add(Quality.TVQuality_3.ToString()); this._quality.Add(Quality.OK_4.ToString()); this._quality.Add(Quality.Good_5.ToString()); this._quality.Add(Quality.VeryGood_6.ToString()); this._quality.Add(Quality.Perfect_7.ToString()); this._quality.Add(Quality.DVDQuality_8.ToString()); this._quality.Add(Quality.CinemaQuality_9.ToString()); this._quality.Add(Quality.HighDefinition_10.ToString()); // app path string path = Assembly.GetExecutingAssembly().Location; path = path.Replace( Assembly.GetExecutingAssembly().ManifestModule.Name, "" ); this._common_app_path = path; // get app data path this._common_app_data_path = Environment.GetFolderPath( Environment.SpecialFolder.LocalApplicationData ) + @"\Toenda\MovieMatic\"; //this._common_app_data_path = path; this._common_app_temp_path = _common_app_data_path + @"Temp\"; // create if not exist DirectoryInfo dir = this._fs.GetDirectory(this._common_app_data_path, true); // get config file path FileInfo fi = new FileInfo( this._common_app_data_path + "MovieMatic.xml" ); this._common_app_data_configfile = fi.FullName; // load config if(fi.Exists) { XmlProvider xml = new XmlProvider(fi.FullName, OpenMode.ForReading); if(xml.IsValidXml) { try { this._cn = xml.ReadTag("data", "connectionString"); } catch(Exception ex) { string s = ex.Message; this._cn = ConfigurationManager.ConnectionStrings["mmConnection"].ConnectionString; this._CreateXmlConfigFile(fi.FullName); } } else { this._cn = ConfigurationManager.ConnectionStrings["mmConnection"].ConnectionString; this._CreateXmlConfigFile(fi.FullName); } } else { //this._cn = ConfigurationManager.ConnectionStrings["mmConnection"].ConnectionString; //this._cn = "[INITIAL]"; this._cn = "Server=;Database=MovieMatic;Uid=;Pwd=;"; this._CreateXmlConfigFile(fi.FullName); } }
/// <summary> /// Save the xml /// </summary> public static void SaveXml() { XmlProvider xml = new XmlProvider( _common_app_data_configfile, OpenMode.ForWriting ); xml.ChangeValueInSecondLevel("connectionString", _cn); xml.ChangeValueInSecondLevel("checkForNewVersion", _checkForNewVersion.ToString()); //xml.CloseFile(); }