74 lines
2.3 KiB
C#
74 lines
2.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using GZTW.AyaNova.BLL;
|
|
|
|
namespace AyaNova.Plugin.RepairTekCPC
|
|
{
|
|
public partial class CopyDataForm : Form
|
|
{
|
|
public CopyDataForm(Workorder w)
|
|
{
|
|
InitializeComponent();
|
|
|
|
StringBuilder sbFirst = new StringBuilder();
|
|
sbFirst.AppendLine(DateTime.Now.ToString("yyyy-MM-dd"));//current date yyyy-mm-dd format
|
|
sbFirst.Append("Assigned RMA # ");
|
|
sbFirst.AppendLine(w.WorkorderService.ServiceNumber.ToString());
|
|
tbFirst.Text = sbFirst.ToString();
|
|
|
|
StringBuilder sbSecond = new StringBuilder();
|
|
|
|
//FIRST LINE
|
|
sbSecond.AppendLine(DateTime.Now.ToString("yyyy-MM-dd"));//current date yyyy-mm-dd format
|
|
|
|
//SECOND LINE
|
|
sbSecond.Append("Received PDT S/N ");
|
|
//get unit serial number
|
|
|
|
|
|
UnitPickList upl = UnitPickList.GetListOfOneSpecificUnit(w.WorkorderItems[0].UnitID);
|
|
sbSecond.AppendLine(upl[0].Serial);
|
|
|
|
//THIRD LINE
|
|
sbSecond.Append("Replacement PDT S/N ");
|
|
sbSecond.AppendLine(w.WorkorderItems[0].TechNotes);
|
|
|
|
//FOURTH LINE
|
|
sbSecond.Append("Tracking # ");
|
|
sbSecond.AppendLine(w.InternalReferenceNumber);
|
|
|
|
tbSecond.Text = sbSecond.ToString();
|
|
|
|
}
|
|
|
|
private void btnClose_Click(object sender, EventArgs e)
|
|
{
|
|
this.Close();
|
|
}
|
|
|
|
|
|
//copy text to clipboard. Note, some people have reported threading issues with this method of doing so
|
|
//But it worked fine here in testing so just in case for ref:
|
|
//http://stackoverflow.com/questions/899350/how-to-copy-the-contents-of-a-string-to-the-clipboard-in-c
|
|
|
|
private void btnCopyFirst_Click(object sender, EventArgs e)
|
|
{
|
|
System.Windows.Forms.Clipboard.SetText(tbFirst.Text);
|
|
}
|
|
|
|
private void btnCopySecond_Click(object sender, EventArgs e)
|
|
{
|
|
System.Windows.Forms.Clipboard.SetText(tbSecond.Text);
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|