/// <summary>
        /// 图像以及车辆信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dbGrid_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            DataRow      drv   = this.dbGrid.GetDataRow(e.RowHandle);
            FrmInParkPic frmIn = new FrmInParkPic();
            string       img   = this.dbGrid.GetDataRow(e.RowHandle)["入场图片"].ToString();

            BindManager.SetControlValue(drv, frmIn, "fld", null);
            frmIn.ShowDialog();
        }
        private void dbGrid_DoubleClick(object sender, EventArgs e)
        {
            if (this.dbGrid.RowCount == 0)
            {
                return;
            }
            DataRow      drv   = this.dbGrid.GetDataRow(this.dbGrid.FocusedRowHandle);
            FrmInParkPic frmIn = new FrmInParkPic();
            string       img   = this.dbGrid.GetDataRow(this.dbGrid.FocusedRowHandle)["入场图片"].ToString();

            BindManager.SetControlValue(drv, frmIn, "fld", null);
            frmIn.ShowDialog();
        }
Beispiel #3
0
        private void dbGrid_RowCellClick_1(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            DataRow drv = this.dbGrid.GetDataRow(e.RowHandle);
            FrmInParkPic frmIn = new FrmInParkPic();
            string img = this.dbGrid.GetDataRow(e.RowHandle)["入场图片"].ToString();

            //Billy
            byte[] byData1 = new byte[100];
            char[] charData1 = new char[1000];
            FileStream sFile1 = null;

            try
            {
                sFile1 = new FileStream(img, FileMode.Open, FileAccess.Read);
                sFile1.Seek(55, SeekOrigin.Begin);
                sFile1.Read(byData1, 0, 100); //第一个参数是被传进来的字节数组,用以接受FileStream对象中的数据,第2个参数是字节数组中开始写入数据的位置,它通常是0,表示从数组的开端文件中向数组写数据,最后一个参数规定从文件读多少字符.
            }
            catch
            {
                MessageBox.Show("读取图片失败");
                return;
            }
            Decoder d1 = Encoding.UTF8.GetDecoder();
            d1.GetChars(byData1, 0, byData1.Length, charData1, 0);
            picpark.BackgroundImage = Image.FromStream(sFile1);

            return;

            string server = DataAccRes.AppSettings("服务器");

            if (server != "127.0.0.1")
            {
                string pic = img;
                if (string.IsNullOrEmpty(pic)) return;
                string[] sArray = pic.Split('\\');
                string path = "\\\\" + server + @"\D$" + @"\images";

                string[] test = Directory.GetFiles(path);
                string strResult = string.Empty;
                string sss = "\\\\" + server + @"\D$" + @"\images\" + sArray[2].ToString();
                if (Array.IndexOf(test, sss) != -1)
                {
                    byte[] byData = new byte[100];
                    char[] charData = new char[1000];
                    FileStream sFile = null;

                    try
                    {
                        sFile = new FileStream(sss, FileMode.Open, FileAccess.Read);
                        sFile.Seek(55, SeekOrigin.Begin);
                        sFile.Read(byData, 0, 100); //第一个参数是被传进来的字节数组,用以接受FileStream对象中的数据,第2个参数是字节数组中开始写入数据的位置,它通常是0,表示从数组的开端文件中向数组写数据,最后一个参数规定从文件读多少字符.
                    }
                    catch
                    {
                        MessageBox.Show("读取图片失败");
                        return;
                    }
                    Decoder d = Encoding.UTF8.GetDecoder();
                    d.GetChars(byData, 0, byData.Length, charData, 0);
                    picpark.BackgroundImage = Image.FromStream(sFile);
                }
            }
        }
 /// <summary>
 /// 图像以及车辆信息
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dbGrid_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
     DataRow drv = this.dbGrid.GetDataRow(e.RowHandle);
     FrmInParkPic frmIn = new FrmInParkPic();
     string img = this.dbGrid.GetDataRow(e.RowHandle)["入场图片"].ToString();
     BindManager.SetControlValue(drv, frmIn, "fld", null);
     frmIn.ShowDialog();
 }
 private void dbGrid_DoubleClick(object sender, EventArgs e)
 {
     if (this.dbGrid.RowCount == 0)
         return;
     DataRow drv = this.dbGrid.GetDataRow(this.dbGrid.FocusedRowHandle);
     FrmInParkPic frmIn = new FrmInParkPic();
     string img = this.dbGrid.GetDataRow(this.dbGrid.FocusedRowHandle)["入场图片"].ToString();
     BindManager.SetControlValue(drv, frmIn, "fld", null);
     frmIn.ShowDialog();
 }
Beispiel #6
0
        private void dbGrid_RowCellClick_1(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            DataRow      drv   = this.dbGrid.GetDataRow(e.RowHandle);
            FrmInParkPic frmIn = new FrmInParkPic();
            string       img   = this.dbGrid.GetDataRow(e.RowHandle)["入场图片"].ToString();

            //Billy
            byte[]     byData1   = new byte[100];
            char[]     charData1 = new char[1000];
            FileStream sFile1    = null;

            try
            {
                sFile1 = new FileStream(img, FileMode.Open, FileAccess.Read);
                sFile1.Seek(55, SeekOrigin.Begin);
                sFile1.Read(byData1, 0, 100); //第一个参数是被传进来的字节数组,用以接受FileStream对象中的数据,第2个参数是字节数组中开始写入数据的位置,它通常是0,表示从数组的开端文件中向数组写数据,最后一个参数规定从文件读多少字符.
            }
            catch
            {
                MessageBox.Show("读取图片失败");
                return;
            }
            Decoder d1 = Encoding.UTF8.GetDecoder();

            d1.GetChars(byData1, 0, byData1.Length, charData1, 0);
            picpark.BackgroundImage = Image.FromStream(sFile1);

            return;

            string server = DataAccRes.AppSettings("服务器");

            if (server != "127.0.0.1")
            {
                string pic = img;
                if (string.IsNullOrEmpty(pic))
                {
                    return;
                }
                string[] sArray = pic.Split('\\');
                string   path   = "\\\\" + server + @"\D$" + @"\images";


                string[] test      = Directory.GetFiles(path);
                string   strResult = string.Empty;
                string   sss       = "\\\\" + server + @"\D$" + @"\images\" + sArray[2].ToString();
                if (Array.IndexOf(test, sss) != -1)
                {
                    byte[]     byData   = new byte[100];
                    char[]     charData = new char[1000];
                    FileStream sFile    = null;

                    try
                    {
                        sFile = new FileStream(sss, FileMode.Open, FileAccess.Read);
                        sFile.Seek(55, SeekOrigin.Begin);
                        sFile.Read(byData, 0, 100); //第一个参数是被传进来的字节数组,用以接受FileStream对象中的数据,第2个参数是字节数组中开始写入数据的位置,它通常是0,表示从数组的开端文件中向数组写数据,最后一个参数规定从文件读多少字符.
                    }
                    catch
                    {
                        MessageBox.Show("读取图片失败");
                        return;
                    }
                    Decoder d = Encoding.UTF8.GetDecoder();
                    d.GetChars(byData, 0, byData.Length, charData, 0);
                    picpark.BackgroundImage = Image.FromStream(sFile);
                }
            }
        }