//图片上传 private void btnUpPic_Click(object sender, EventArgs e) { DialogResult r = this.openFileDialog1.ShowDialog(); if (r != DialogResult.OK) { return; } string fileName = this.openFileDialog1.FileName; //string fileName = "111.jpg"; System.IO.FileStream fs = new FileStream(fileName, FileMode.Open); byte[] bs = new byte[fs.Length]; //MessageBox.Show(bs.Length.ToString()); int count = fs.Read(bs, 0, (int)fs.Length); fs.Close(); string userCode = ApplicationService.Current().LoginInfo.UserCode.ToUpper(); bool isTrue = _PackagingOperationsService.UploadFile(bs, this.IQCNo, userCode); if (isTrue) { this.lblMessage.Text = "上传成功"; BindDataGrid(_PackagingOperationsService.GetDataGridDoc(this.IQCNo)); } else { this.lblMessage.Text = "上传失败"; } }
public FIQCExceptionPicUpload(string iqcNo, Form parent) { if (parent == null) { throw new Exception("必须有一个父窗口!"); } this.parent = parent; InitializeComponent(); this.IQCNo = iqcNo; _PackagingOperationsService = new BenQGuru.eMES.WinCeClient.PackagingOperationsService.PackagingOperationsService(); _PackagingOperationsService.Url = WebServiceFacade.GetWebServiceURL() + "PackagingOperationsService.asmx"; DataTable dt = _PackagingOperationsService.GetDataGridDoc(iqcNo); //this.dataGrid1.DataSource = dt; //this.DataCount = dt.Rows.Count; BindDataGrid(dt); }