protected void Page_Load(object sender, EventArgs e) { int imageId = Convert.ToInt32(Request.QueryString["imageid"]); var data = new FunctionalityImageDataModel(); data.FunctionalityImageId = imageId; var dt = FunctionalityImageDataManager.GetDetails(data, SessionVariables.RequestProfile); if (dt.Rows.Count > 0) { var imageData = ((byte[])(dt.Rows[0][FunctionalityImageDataModel.DataColumns.Image])); Response.Clear(); Response.ContentType = "image/pjpeg"; Response.BinaryWrite(imageData); Response.End(); } }
protected override DataTable GetData() { try { SuperKey = ApplicationCommon.GetSuperKey(); SetId = ApplicationCommon.GetSetId(); var selectedrows = new DataTable(); var functionalityImagedata = new FunctionalityImageDataModel(); selectedrows = FunctionalityImageDataManager.GetDetails(functionalityImagedata, SessionVariables.RequestProfile).Clone(); if (!string.IsNullOrEmpty(SuperKey)) { var systemEntityTypeId = (int)PrimaryEntity; var lstEntityKeys = ApplicationCommon.GetSuperKeyDetails(systemEntityTypeId, SuperKey); foreach (var entityKey in lstEntityKeys) { functionalityImagedata.FunctionalityImageId = entityKey; var result = FunctionalityImageDataManager.GetDetails(functionalityImagedata, SessionVariables.RequestProfile); selectedrows.ImportRow(result.Rows[0]); } } else if (SetId != 0) { var key = SetId; functionalityImagedata.FunctionalityImageId = key; var result = FunctionalityImageDataManager.GetDetails(functionalityImagedata, SessionVariables.RequestProfile); selectedrows.ImportRow(result.Rows[0]); } return(selectedrows); } catch (Exception ex) { Response.Write(ex.Message); } return(null); }