private void repositoryItemButtonEditMandoopImg_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { DataRow row = gridViewData.GetFocusedDataRow(); if (e.Button.Kind == DevExpress.XtraEditors.Controls.ButtonPredefines.Ellipsis) { if (ofd.ShowDialog() != System.Windows.Forms.DialogResult.OK) return; string filename = string.Format("{0}{1}{2}{3}{4}{5}{6}.jpg", DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second, DateTime.Now.Millisecond); File.Copy(ofd.FileName, Program.MandoopImgPath + filename, true); row["MandoopImg"] = filename; } else { if (File.Exists(Program.MandoopImgPath + row["MandoopImg"])) { ImgViewerFrm frm = new ImgViewerFrm(); frm.Img.ImageLocation = Program.MandoopImgPath + row["MandoopImg"]; frm.ShowDialog(); } else MessageBox.Show("الملف غير موجود", "ملف مفقود", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void lueHafzaperson_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { if (e.Button.Kind == DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph) { if (lueHafzaperson.EditValue == null) return; DataSources.dsTeachersUnion.TBLMandoopRow row = (DataSources.dsTeachersUnion.TBLMandoopRow)((DataRowView)lueHafzaperson.GetSelectedDataRow()).Row; if (row.IsNull("MandoopImg")) { MessageBox.Show("لا يوجد صورة", "بيانات غير مكتمله", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (System.IO.File.Exists(Program.MandoopImgPath + row.MandoopImg)) { ImgViewerFrm frm = new ImgViewerFrm(); frm.Img.ImageLocation = Program.MandoopImgPath + row.MandoopImg; frm.ShowDialog(); } else MessageBox.Show("الملف غير موجود", "ملف مفقود", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void repositoryItemButtonEditPic_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { GridView GV = (GridView)gridControlData.MainView; DataSources.dsTeachersUnion.TBLMemberWebRow row = (DataSources.dsTeachersUnion.TBLMemberWebRow)GV.GetFocusedDataRow(); string imgFileName = tblMemberWebTableAdapter.ScalarQueryImagePath(row.MemberId); if (File.Exists(Program.imgPathWeb + imgFileName)) { ImgViewerFrm frm = new ImgViewerFrm(); frm.Img.ImageLocation = Program.imgPathWeb + imgFileName; frm.ShowDialog(); } else { Program.ShowMsg("الملف غير موجود", true, this); Program.Logger.LogThis("الملف غير موجود", Text, FXFW.Logger.OpType.fail, null, null, this); } }