private void upload() { OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.Title = strings.BROWSE_YOUR_DOCUMENTS; openFileDialog1.Filter = "PDF Files|*.pdf|Office Files|*.doc;*.docx;*.xls;*.xlsx;*.ppt;*.pptx|txt files (*.txt)|*.txt|Image Files(*.BMP;*.JPG;*.JPEG;*.PNG;*.GIF)|*.BMP;*.JPG;*.JPEG;*.PNG;*.GIF|All files (*.*)|*.*"; openFileDialog1.CheckFileExists = true; openFileDialog1.CheckPathExists = true; openFileDialog1.Multiselect = true; openFileDialog1.FilterIndex = 5; if (openFileDialog1.ShowDialog() == DialogResult.OK) { foreach (String file in openFileDialog1.FileNames) { try { string name = Path.GetFileName(file); string path = file; Image img = file.GetThumbnail(); CLSFiles addfile = new CLSFiles(); addfile.id = 1; addfile.name = name; addfile.docNumber = "0"; addfile.operation_Name = opName; addfile.operation_ID = opid; addfile.Path = path; addfile.thumb_Blob = img; addfile.Status = 1; files.Add(addfile); }catch (Exception ex) { Msg.Show("", ex.ToString(), 0); } } } cLSFilesBindingSource.DataSource = files.ToList(); DocViews.FocusedRowHandle = DocViews.DataRowCount - 1; loadRecordData(); }
public List<CLSFiles> files = new List<CLSFiles>();
public class CLSFiles { private int _id; private string _name; private string _docNumber; private string _operation_Name; private int? _operation_ID; private Nullable<sbyte> _Deafult; private string _Deafult_String; private Nullable<sbyte> _Status; private string _Status_String; private Image _thumb_Blob; private string _Path; public int id { get { return this._id; } set { this._id = value; } } public string name { get { return this._name; } set { this._name = value; } } public string docNumber { get { return this._docNumber; } set { this._docNumber = value; } } public string operation_Name { get { return this._operation_Name; } set { this._operation_Name = value; } } public int? operation_ID { get { return this._operation_ID; } set { this._operation_ID = value; } } public sbyte? Deafult { get { return this._Deafult; } set { this._Deafult = value; } } public string Deafult_String { get { return this._Deafult_String; } set { this._Deafult_String = value; } } public sbyte? Status { get { return this._Status; } set { this._Status = value; } } public string Status_String { get { return this._Status_String; } set { this._Status_String = value; } } public Image thumb_Blob { get { return this._thumb_Blob; } set { this._thumb_Blob = value; } } public string Path { get { return this._Path; } set { this._Path = value; } } }
files
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)