/// <summary> /// 保存参数按钮 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Save_Click(object sender, EventArgs e) { ParaService ppService = ParaService.Install(); ppService.form = this; Control con = sender as Control; string name = con.Name; switch (name) { case "SaveSerialPort": ppService.SetInfo(this.SerialPortPara); break; case "SaveEquipment": ppService.SetInfo(this.EquipmentInfo); break; case "bt_Software": string node = cb_Software.Text; Form1.form1.AddInformation("保存" + node + "号程序参数."); progressBar_Setting.Maximum = gb_Software.Controls.Count / 2; progressBar_Setting.Visible = true; INIHelper.Write(cb_Software.Text, "REMARK", tb_remark.Text, ParaService._iniSoftwarePath); ppService.SetATQPara(port, ReadXML.paraList, this.gb_Software, Pattern, node); ppService.SetSoftware(this.gb_Software, Pattern, node); progressBar_Setting.Visible = false; break; } MessageBox.Show("保存成功", "提示"); }
/// <summary> /// Uploads a text based file for ticket actions. You need to pass a string, and the mime type of a text based file (html, text, etc...). /// </summary> /// <param name="text"> /// The content of the text based file. ///</param> /// <param name="creds"> /// The parature credentials class for the APIs. /// </param> /// <param name="contentType"> /// The type of content being uploaded, you have to make sure this is the right text. /// </param> /// <param name="fileName"> /// The name you woule like the attachment to have. ///</param> public void AddAttachment(ParaService service, string text, string contentType, string fileName) { var encoding = new ASCIIEncoding(); var bytes = encoding.GetBytes(text); AddAttachment(service, bytes, contentType, fileName); }
private void bt_Click(object sender, EventArgs e) { LabelX bt = sender as LabelX; switch (bt.Name) { case "btn_Home": //加载备注 lb_Remark.Text = INIHelper.Read(tb_code.Text, "REMARK", "", ParaService._iniSoftwarePath); MainMenuPageChange(bt, Home); break; case "btn_DataAna": MainMenuPageChange(bt, DataAna); break; case "btn_Manual": MainMenuPageChange(bt, Manual); break; case "btn_MStatus": MainMenuPageChange(bt, MachinStatus); break; case "btn_ParaSet": MainMenuPageChange(bt, ParaSet); ParaService.Install().GetInfo(this.tabCTLPara); break; case "btn_Alarm": MainMenuPageChange(bt, Alarm); break; } }
/// <summary> /// Uploads a text based file to the current ticket. You need to pass a string, and the mime type of a text based file (html, text, etc...). /// </summary> /// <param name="text"> /// The content of the text based file. ///</param> /// <param name="creds"> /// The parature credentials class for the APIs. /// </param> /// <param name="contentType"> /// The type of content being uploaded, you have to make sure this is the right text. /// </param> /// <param name="fileName"> /// The name you woule like the attachment to have. ///</param> public void AddAttachment(ParaService service, string text, string contentType, string fileName) { var encoding = new ASCIIEncoding(); var bytes = encoding.GetBytes(text); Ticket_Attachments.Add(service.UploadFile <Ticket>(bytes, contentType, fileName)); }
/// <summary> /// Uploads a text based file to the current Download. You need to pass a string, and the mime type of a text based file (html, text, etc...). /// </summary> /// <param name="text"> /// The content of the text based file. ///</param> /// <param name="paracredentials"> /// The parature credentials class for the APIs. /// </param> /// <param name="contentType"> /// The type of content being uploaded, you have to make sure this is the right text. /// </param> /// <param name="FileName"> /// The name you woule like the attachment to have. ///</param> public void AddAttachment(ParaService service, string text, string contentType, string fileName) { var encoding = new ASCIIEncoding(); var bytes = encoding.GetBytes(text); Attachment = service.UploadFile <Download>(bytes, contentType, fileName); Guid = Attachment.Guid; }
public static bool PurgeCustomer(long customerID) { bool isSuccess; Service = new ParaService(CredentialProvider.Creds); var purgeResponse = Service.Delete <Customer>(customerID, true); isSuccess = !purgeResponse.HasException; return(isSuccess); }
public static ParaEntityList<Account> searchAccountsByField(long fieldID, string fieldValue) { var accountQuery = new AccountQuery(); accountQuery.RetrieveAllRecords = true; accountQuery.AddCustomFieldFilter(fieldID, ParaEnums.QueryCriteria.Equal, fieldValue); Service = new ParaService(CredentialProvider.Creds); var accounts = Service.GetList<Account>(accountQuery); return accounts; }
public static bool PurgeCustomer(long customerID) { bool isSuccess; Service = new ParaService(CredentialProvider.Creds); var purgeResponse = Service.Delete<Customer>(customerID, true); isSuccess = !purgeResponse.HasException; return isSuccess; }
public static ParaEntityList <Account> searchAccountsByField(long fieldID, string fieldValue) { var accountQuery = new AccountQuery(); accountQuery.RetrieveAllRecords = true; accountQuery.AddCustomFieldFilter(fieldID, ParaEnums.QueryCriteria.Equal, fieldValue); Service = new ParaService(CredentialProvider.Creds); var accounts = Service.GetList <Account>(accountQuery); return(accounts); }
public static ParaEntityList<ParatureSDK.ParaObjects.Account> getAccountsByView(long viewID) { //field value would be option ID var accountQuery = new AccountQuery(); accountQuery.RetrieveAllRecords = true; accountQuery.View = viewID; Service = new ParaService(CredentialProvider.Creds); var accounts = Service.GetList<Account>(accountQuery); return accounts; }
public static ParaEntityList <ParatureSDK.ParaObjects.Account> getAccountsByView(long viewID) { //field value would be option ID var accountQuery = new AccountQuery(); accountQuery.RetrieveAllRecords = true; accountQuery.View = viewID; Service = new ParaService(CredentialProvider.Creds); var accounts = Service.GetList <Account>(accountQuery); return(accounts); }
public static ParaEntityList <Account> searchAccountsByName(string accountName) { var accountQuery = new AccountQuery(); accountQuery.RetrieveAllRecords = true; //There is a difference between static fields and custom fields accountQuery.AddStaticFieldFilter(AccountQuery.AccountStaticFields.AccountName, ParaEnums.QueryCriteria.Equal, accountName); Service = new ParaService(CredentialProvider.Creds); var accounts = Service.GetList <Account>(accountQuery); return(accounts); }
public JsonResult GetDevicePara(string ServerID, string CommunicateID, string DeviceID, string GroupID) { var myList = DeviceGroupService.GetByWhere(" where GroupId=" + GroupID); var selectItems = myList.Where(x => x.IO_SERVER_ID == ServerID && x.IO_COMM_ID == CommunicateID && x.IO_DEVICE_ID == DeviceID); var myItem = selectItems.First(); if (myItem != null) { List <string> ids = myItem.IOPARAS.ToString().Split(',').ToList(); List <string> titles = myItem.IOPARATITLES.ToString().Split(',').ToList(); var paras = ParaService.GetByWhere(" where IO_SERVER_ID='" + ServerID + "' and IO_COMM_ID='" + CommunicateID + "' and IO_DEVICE_ID='" + DeviceID + "'"); foreach (var item in paras) { int index = ids.FindIndex(x => x == item.IO_ID); if (index >= 0) { if (index < titles.Count) { item.IO_ALIASNAME = titles[index]; } item.LAY_CHECKED = true; } else { item.IO_ALIASNAME = item.IO_LABEL; item.LAY_CHECKED = false; } } var result = new { code = 0, count = paras.Count(), data = paras }; return(Json(result, JsonRequestBehavior.AllowGet)); } else { return(Json(null, JsonRequestBehavior.AllowGet)); } }
/// <summary> /// 程序号下拉 or 刷新 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void RefreshGroupBox(object sender, EventArgs e) { tb_remark.Text = INIHelper.Read(cb_Software.Text, "REMARK", "", ParaService._iniSoftwarePath); if ((Control)sender is ComboBox) { //读取设备中的参数,并保存在INI中。 ParaService.Install().ReadATQToINI(port, (cb_Software.SelectedIndex + 1).ToString()); Pattern.Checked = ParaService.Install().LoadPattern(Pattern, cb_Software.Text.Trim()); //根据参数文档中 pattern 来选择模式 if (Pattern.Checked) { InitializeGroupBox(true, 1); //爆破 burst } else { InitializeGroupBox(true, 2); //泄漏 leak } gb_Software.Refresh(); //设置参数读取进度条的最大值 progressBar_Setting.Maximum = ReadXML.paraList.Count; } else { //根据参数文档中 pattern 来选择模式 if (Pattern.Checked) { InitializeGroupBox(true, 1); //爆破 burst } else { InitializeGroupBox(true, 2); //泄漏 leak } gb_Software.Refresh(); ParaService.Install().LoadParaToGroupBox(gb_Software, Pattern, cb_Software.Text.Trim(), false); } }
private static ParaEntityList <ParaObjects.Chat> FillList(ParaCredentials creds, Boolean includeTranscripts, ChatQuery query) { if (query == null) { query = new ChatQuery(); } var chatList = new ParaEntityList <ParaObjects.Chat>(); // Checking if the system needs to recursively call all of the data returned. if (query.RetrieveAllRecords) { chatList = RetrieveAllEntitites(creds, query); } else { var ar = ApiCallFactory.ObjectGetList <ParaObjects.Chat>(creds, query.BuildQueryArguments()); if (ar.HasException == false) { chatList = ParaEntityParser.FillList <ParaObjects.Chat>(ar.XmlReceived); } chatList.ApiCallResponse = ar; } if (includeTranscripts) { var service = new ParaService(creds); //Fetch transcripts for each chat. Each request is another API call... foreach (var chat in chatList) { chat.Transcript = service.GetChatTranscript(chat.Id); } } return(chatList); }
/// <summary> /// 实时状态 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void timer_Real_Tick(object sender, EventArgs e) { //启动 mx.GetDevice("M385", out data); if (data == 1) { AddInformation("爆破机台启动"); mx.SetDevice("M385", 0); StartTest(); } if (queueReal.Count > 0) //实时结果 { RealTimeData rData = queueReal.Dequeue(); double Nowtime = m_StopWatch.ElapsedMilliseconds / 1000.0; cshow.AddData(queueData, Nowtime, Convert.ToDouble(rData.PressureValue)); cshow.ShowChart(View_Burst, queueData); for (int i = 0; i < listConReal.Count; i++) { string[] realString = listConReal[i].Name.Split('_'); Type tp = rData.GetType(); PropertyInfo p = tp.GetProperty(realString[1]); string value = p.GetValue(rData, null).ToString(); listConReal[i].Text = value; } } if (queueLast.Count > 0) //最终结果 { FinalResult finalResult = queueLast.Dequeue(); for (int i = 0; i < listConLast.Count; i++) { string[] lastString = listConLast[i].Name.Split('_'); Type tp = finalResult.GetType(); PropertyInfo p = tp.GetProperty(lastString[1]); string value = p.GetValue(finalResult, null).ToString(); listConLast[i].Text = value; } Last_LValueAndUnit.Text = finalResult.LeakValue + finalResult.LeakUnit; Last_PValueAndUnit.Text = finalResult.PressureValue + finalResult.PressureUnit; ExcelUtil excelUtil = ExcelUtil.Instance(); finalResult.Product = tb_product.Text; excelUtil.SaveData(finalResult); switch (finalResult.Result) { case "OK": mx.SetDevice("M386", 1); in_OK++; break; case "NG": mx.SetDevice("M387", 1); in_NG++; break; } ShowToDayYield(); } if (isClear) //清空 { isClear = false; ClearGBReal(); } if (PortServcie.queueParaBuff.Count > 0) //暂存区有数据 =》 发送 =》 解析数据设置到INI文件 { PortServcie.paraBuff = PortServcie.queueParaBuff.Dequeue(); SetIndex++; ProcessBarDisplay(SetIndex); string address = PortServcie.paraBuff.Read; string readword = PortServcie.paraBuff.ReadWord; string temp1 = "FF03" + address + readword; PortServcie.IsReadMode = false; m_PortParaServcie.WriteByte(port, temp1 + mbtool.CRC(temp1)); if (PortServcie.queueParaBuff.Count == 0) { SetIndex = 0; ProcessBarDisplay(progressBar_Setting.Maximum + 1); } } if (isRefresh) //刷新仪器参数 { isRefresh = false; ParaService.Install().LoadParaToGroupBox(gb_Software, Pattern, cb_Software.Text.Trim(), true); } }
Exercise07GetSchemas() { Service = new ParaService(CredentialProvider.Creds); }
/// <summary> /// Uploads a text based file to the current ticket. You need to pass a string, and the mime type of a text based file (html, text, etc...). /// </summary> /// <param name="text"> /// The content of the text based file. ///</param> /// <param name="creds"> /// The parature credentials class for the APIs. /// </param> /// <param name="contentType"> /// The type of content being uploaded, you have to make sure this is the right text. /// </param> /// <param name="fileName"> /// The name you woule like the attachment to have. ///</param> public void AddAttachment(ParaService service, string text, string contentType, string fileName) { var encoding = new ASCIIEncoding(); var bytes = encoding.GetBytes(text); Ticket_Attachments.Add(service.UploadFile<Ticket>(bytes, contentType, fileName)); }
/// <summary> /// Updates the current download attachment with a text based file. You need to pass a string, and the mime type of a text based file (html, text, etc...). /// </summary> /// <param name="text"> /// The content of the text based file. ///</param> /// <param name="paracredentials"> /// The parature credentials class for the APIs. /// </param> /// <param name="contentType"> /// The type of content being uploaded, you have to make sure this is the right text. /// </param> /// <param name="FileName"> /// The name you woule like the attachment to have. ///</param> public void UpdateAttachment(ParaService service, string text, string contentType, string fileName) { var encoding = new ASCIIEncoding(); var bytes = encoding.GetBytes(text); Attachment = service.UploadFile<Download>(bytes, contentType, fileName); Guid = Attachment.Guid; Name = fileName; }
public Exercise12TicketAttachments() { Service = new ParaService(CredentialProvider.Creds); }
static ChatTranscriptExample() { Service = new ParaService(CredentialProvider.Creds); }
public Exercise05ListArticles() { Service = new ParaService(CredentialProvider.Creds); }
/// <summary> /// Uploads an attachment for ticket action /// The attachment will also be added to the current Ticket's attachments collection. /// </summary> /// <param name="attachment"> /// The binary Byte array of the attachment you would like to add. /// </param> /// <param name="fileName"></param> public void AddAttachment(ParaService service, Byte[] attachment, string contentType, string fileName) { Action_Attachments.Add(service.UploadFile<Ticket>(attachment, contentType, fileName)); }
public Exercise04ListKBFolders() { Service = new ParaService(CredentialProvider.Creds); }
public Exercise03ListCustomers() { Service = new ParaService(CredentialProvider.Creds); }
static TicketExamples() { Service = new ParaService(CredentialProvider.Creds); }
public Exercise02ListAccounts() { Service = new ParaService(CredentialProvider.Creds); }
public Exercise11TicketActions() { Service = new ParaService(CredentialProvider.Creds); }
/// <summary> /// If you have an attachment and would like to replace the file, use this method. It will actually delete /// the existing attachment, and then add a new one to replace it. /// </summary> public void UpdateAttachment(ParaService service, Byte[] attachment, string attachmentGuid, string contentType, string fileName) { DeleteAttachment(attachmentGuid); Ticket_Attachments.Add(service.UploadFile <Ticket>(attachment, contentType, fileName)); }
public Exercise09UpdateObjects() { Service = new ParaService(CredentialProvider.Creds); }
/// <summary> /// Uploads an attachment for ticket action /// The attachment will also be added to the current Ticket's attachments collection. /// </summary> /// <param name="attachment"> /// The binary Byte array of the attachment you would like to add. /// </param> /// <param name="fileName"></param> public void AddAttachment(ParaService service, Byte[] attachment, string contentType, string fileName) { Action_Attachments.Add(service.UploadFile <Ticket>(attachment, contentType, fileName)); }
/// <summary> /// If you have a download file and would like to replace the file, use this method. It will actually delete /// the existing attachment, and then add a new one to replace it. /// </summary> public void UpdateAttachment(ParaService service, byte[] attachment, string contentType, string fileName) { this.Attachment = service.UploadFile<Download>(attachment, contentType, fileName); Guid = this.Attachment.Guid; Name = fileName; }
static ArticleKeywordsExamples() { Service = new ParaService(CredentialProvider.Creds); }
/// <summary> /// Uploads a file to the Parature system, from a standard System.Net.Mail.Attachment object, in case you use this from an email. /// </summary> /// <param name="EmailAttachment"> /// The email attachment to upload. /// </param> public void AddAttachment(ParaService service, System.Net.Mail.Attachment EmailAttachment) { Attachment = service.UploadFile<Download>(EmailAttachment); Guid = Attachment.Guid; }
/// <summary> /// Uploads a file to the Parature system, from a standard System.Net.Mail.Attachment object, in case you use this from an email. /// </summary> /// <param name="EmailAttachment"> /// The email attachment to upload. /// </param> public void AddAttachment(ParaService service, System.Net.Mail.Attachment EmailAttachment) { Attachment = service.UploadFile <Download>(EmailAttachment); Guid = Attachment.Guid; }
/// <summary> /// If you have an attachment and would like to replace the file, use this method. It will actually delete /// the existing attachment, and then add a new one to replace it. /// </summary> public void UpdateAttachment(ParaService service, Byte[] attachment, string attachmentGuid, string contentType, string fileName) { AttachmentsDelete(attachmentGuid); Ticket_Attachments.Add(service.UploadFile<Ticket>(attachment, contentType, fileName)); }
public static ParaEntityList<Account> searchAccountsByName(string accountName) { var accountQuery = new AccountQuery(); accountQuery.RetrieveAllRecords = true; //There is a difference between static fields and custom fields accountQuery.AddStaticFieldFilter(AccountQuery.AccountStaticFields.AccountName, ParaEnums.QueryCriteria.Equal, accountName); Service = new ParaService(CredentialProvider.Creds); var accounts = Service.GetList<Account>(accountQuery); return accounts; }
/// <summary> /// If you have a download file and would like to replace the file, use this method. It will actually delete /// the existing attachment, and then add a new one to replace it. /// </summary> public void UpdateAttachment(ParaService service, byte[] attachment, string contentType, string fileName) { this.Attachment = service.UploadFile <Download>(attachment, contentType, fileName); Guid = this.Attachment.Guid; Name = fileName; }
public Exercise06RetrieveObjects() { Service = new ParaService(CredentialProvider.Creds); }
static DownloadExamples() { Service = new ParaService(CredentialProvider.Creds); }