private void buttonProjectData_Click(object sender, EventArgs e) { OpenFileDialog openXLsFileDialog = new OpenFileDialog(); openXLsFileDialog.Filter = "Excel Files (.xml)|*.xml|All Files (*.*)|*.*"; openXLsFileDialog.FilterIndex = 1; openXLsFileDialog.Multiselect = false; if (DialogResult.OK == openXLsFileDialog.ShowDialog()) { StringBuilder taskID = new StringBuilder(2048); Dictionary <String, String> other = new Dictionary <string, string>(); other["task_param"] = "ProcessByOrderList"; Boolean result = RemoteCall.OrderPartition(_reqSession, openXLsFileDialog.FileName, "CreateProjectData", other, taskID);//processor:"ProcessByOrderList" if (result) { _TaskType = "CreateProjectData"; _TaskID = taskID.ToString(); int idx = _TaskID.IndexOf("#"); if (idx >= 0) { _TaskID = _TaskID.Substring(idx + 1); } _LastTaskID = _TaskID; AppendLog(String.Format("Success: upload orders: {0}, task:{1}", openXLsFileDialog.FileNames.ToString(), _TaskID)); } else { _TaskID = ""; _TaskType = ""; _LastTaskID = ""; this.listBoxLog.Items.Add(String.Format("Failed to upload orders")); } } }
private void buttonOrder_Click(object sender, EventArgs e) { OpenFileDialog openXLsFileDialog = new OpenFileDialog(); openXLsFileDialog.Filter = "Excel Files (.xml)|*.xml|All Files (*.*)|*.*"; openXLsFileDialog.FilterIndex = 1; openXLsFileDialog.Multiselect = false; if (DialogResult.OK == openXLsFileDialog.ShowDialog()) { StringBuilder taskID = new StringBuilder(2048); Boolean result = RemoteCall.OrderPartition(_reqSession, openXLsFileDialog.FileName, "ProcessByOrderList", null, taskID);//processor:"ProcessByOrderList" if (result) { _TaskType = "OrderDirect"; _TaskID = taskID.ToString(); _LastTaskID = ""; AppendLog(String.Format("Success: upload orders: {0}, task:{1}", openXLsFileDialog.FileNames.ToString(), _TaskID)); } else { _TaskID = ""; _TaskType = ""; this.listBoxLog.Items.Add(String.Format("Failed to upload orders")); } } }
private void buttonUpload_Click(object sender, EventArgs e) { OpenFileDialog openXLsFileDialog = new OpenFileDialog(); openXLsFileDialog.Filter = "XML Files (.xml)|*.xml|All Files (*.*)|*.*"; openXLsFileDialog.FilterIndex = 1; openXLsFileDialog.Multiselect = true; if (DialogResult.OK == openXLsFileDialog.ShowDialog()) { //StringBuilder filePath = new StringBuilder(); //Boolean result = RemoteCall.UploadNestingList(openXLsFileDialog.FileNames); //if (result) //{ // AppendLog(String.Format("Success: upload files: {0}", openXLsFileDialog.FileNames.ToString())); //} //else //{ // this.listBoxLog.Items.Add(String.Format("Failed to upload")); //} StringBuilder taskID = new StringBuilder(2048); Dictionary <String, String> other = new Dictionary <string, string>(); other["taskid"] = _LastTaskID; Boolean result = RemoteCall.OrderPartition(_reqSession, openXLsFileDialog.FileName, "ProcessByPartList", other, taskID);//processor:"ProcessByOrderList" if (result) { _TaskType = "PartForm"; _TaskID = taskID.ToString(); _LastTaskID = ""; AppendLog(String.Format("Success: upload part-list: {0}, task:{1}", openXLsFileDialog.FileNames.ToString(), _TaskID)); } else { _TaskID = ""; _TaskType = ""; this.listBoxLog.Items.Add(String.Format("Failed to upload part-list")); } } }