protected override void ShowData(int applicationUserProfileImageMasterId) { base.ShowData(applicationUserProfileImageMasterId); oDetailButtonPanel.SetId = SetId; Clear(); var dataQuery = new ApplicationUserProfileImageMasterDataModel(); dataQuery.ApplicationUserProfileImageMasterId = applicationUserProfileImageMasterId; var entityList = Framework.Components.ApplicationUser.ApplicationUserProfileImageMasterDataManager.GetEntityDetails(dataQuery, SessionVariables.RequestProfile); if (entityList.Count == 1) { foreach (var entityItem in entityList) { lblApplicationUserProfileImageMasterId.Text = entityItem.ApplicationUserProfileImageMasterId.ToString(); lblTitle.Text = entityItem.Title.ToString(); lblApplication.Text = entityItem.Application.ToString(); imgApplicationUserImage.ImageUrl = "~/Shared/AuthenticationAndAuthorization/ApplicationUserProfileImageMaster/ShowImage.aspx?imageid=" + entityItem.ApplicationUserProfileImageMasterId.ToString(); oUpdateInfo.LoadText(entityItem.UpdatedDate, entityItem.UpdatedBy, entityItem.LastAction); oHistoryList.Setup(PrimaryEntity, applicationUserProfileImageMasterId, "ApplicationUserProfileImageMaster"); } } }
private DataTable GetData() { var data = new ApplicationUserProfileImageMasterDataModel(); var dt = Framework.Components.ApplicationUser.ApplicationUserProfileImageMasterDataManager.Search(data, SessionVariables.RequestProfile); return(dt); }
public override int?Save(string action) { var data = new ApplicationUserProfileImageMasterDataModel(); data.ApplicationUserProfileImageMasterId = ApplicationUserProfileImageMasterId; data.ApplicationId = ApplicationId; data.Image = Image; data.Title = Title; if (action == "Insert") { var dt = Framework.Components.ApplicationUser.ApplicationUserProfileImageMasterDataManager.DoesExist(data, SessionVariables.RequestProfile); if (dt.Rows.Count == 0) { Framework.Components.ApplicationUser.ApplicationUserProfileImageMasterDataManager.Create(data, SessionVariables.RequestProfile); } else { throw new Exception("Record with given ID already exists."); } } else { Framework.Components.ApplicationUser.ApplicationUserProfileImageMasterDataManager.Update(data, SessionVariables.RequestProfile); } // not correct ... when doing insert, we didn't get/change the value of ClientID ? return(data.ApplicationUserProfileImageMasterId); }
protected override DataTable UpdateData() { var UpdatedData = new DataTable(); var data = new ApplicationUserProfileImageMasterDataModel(); UpdatedData = Framework.Components.ApplicationUser.ApplicationUserProfileImageMasterDataManager.Search(data, SessionVariables.RequestProfile).Clone(); for (var i = 0; i < SelectedData.Rows.Count; i++) { data.ApplicationUserProfileImageMasterId = Convert.ToInt32(SelectedData.Rows[i][ApplicationUserProfileImageMasterDataModel.DataColumns.ApplicationUserProfileImageMasterId].ToString()); data.ApplicationId = Convert.ToInt32(SelectedData.Rows[i][ApplicationUserProfileImageMasterDataModel.DataColumns.ApplicationId].ToString()); data.Title = !string.IsNullOrEmpty(CheckAndGetRepeaterTextBoxValue(ApplicationUserProfileImageMasterDataModel.DataColumns.Title)) ? CheckAndGetRepeaterTextBoxValue(ApplicationUserProfileImageMasterDataModel.DataColumns.Title).ToString() : SelectedData.Rows[i][ApplicationUserProfileImageMasterDataModel.DataColumns.Title].ToString(); data.Image = ((byte[])(SelectedData.Rows[i][ApplicationUserProfileImageMasterDataModel.DataColumns.Image])); Framework.Components.ApplicationUser.ApplicationUserProfileImageMasterDataManager.Update(data, SessionVariables.RequestProfile); data = new ApplicationUserProfileImageMasterDataModel(); data.ApplicationUserProfileImageMasterId = Convert.ToInt32(SelectedData.Rows[i][ApplicationUserProfileImageMasterDataModel.DataColumns.ApplicationUserProfileImageMasterId].ToString()); var dt = Framework.Components.ApplicationUser.ApplicationUserProfileImageMasterDataManager.Search(data, SessionVariables.RequestProfile); if (dt.Rows.Count == 1) { UpdatedData.ImportRow(dt.Rows[0]); } } return(UpdatedData); }
public static DataTable DoesExist(ApplicationUserProfileImageMasterDataModel data, RequestProfile requestProfile) { var doesExistRequest = new ApplicationUserProfileImageMasterDataModel(); doesExistRequest.ApplicationId = data.ApplicationId; return(Search(doesExistRequest, requestProfile)); }
protected override DataTable GetEntityData(int?entityKey) { var applicationUserProfileImageMasterdata = new ApplicationUserProfileImageMasterDataModel(); applicationUserProfileImageMasterdata.ApplicationUserProfileImageMasterId = entityKey; var results = Framework.Components.ApplicationUser.ApplicationUserProfileImageMasterDataManager.Search(applicationUserProfileImageMasterdata, SessionVariables.RequestProfile); return(results); }
public static string ToSQLParameter(ApplicationUserProfileImageMasterDataModel data, string dataColumnName) { var returnValue = "NULL"; switch (dataColumnName) { case ApplicationUserProfileImageMasterDataModel.DataColumns.ApplicationUserProfileImageMasterId: if (data.ApplicationUserProfileImageMasterId != null) { returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NUMBER, ApplicationUserProfileImageMasterDataModel.DataColumns.ApplicationUserProfileImageMasterId, data.ApplicationUserProfileImageMasterId); } else { returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, ApplicationUserProfileImageMasterDataModel.DataColumns.ApplicationUserProfileImageMasterId); } break; case ApplicationUserProfileImageMasterDataModel.DataColumns.Title: if (!string.IsNullOrEmpty(data.Title)) { returnValue = string.Format(SQL_TEMPLATE_PARAMETER_STRING_OR_DATE, ApplicationUserProfileImageMasterDataModel.DataColumns.Title, data.Title); } else { returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, ApplicationUserProfileImageMasterDataModel.DataColumns.Title); } break; case ApplicationUserProfileImageMasterDataModel.DataColumns.Image: if (data.Image != null) { returnValue = Convert.ToString(data.Image); } else { returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, ApplicationUserProfileImageMasterDataModel.DataColumns.Image); } break; case ApplicationUserProfileImageMasterDataModel.DataColumns.Application: if (!string.IsNullOrEmpty(data.Application)) { returnValue = string.Format(SQL_TEMPLATE_PARAMETER_STRING_OR_DATE, ApplicationUserProfileImageMasterDataModel.DataColumns.Application, data.Application); } else { returnValue = string.Format(SQL_TEMPLATE_PARAMETER_NULL, ApplicationUserProfileImageMasterDataModel.DataColumns.Application); } break; default: returnValue = BaseDataManager.ToSQLParameter(data, dataColumnName); break; } return(returnValue); }
public static bool DoesExist(ApplicationUserProfileImageMasterDataModel data, RequestProfile requestProfile) { var doesExistRequest = new ApplicationUserProfileImageMasterDataModel(); doesExistRequest.Title = data.Title; var list = GetEntityDetails(doesExistRequest, requestProfile, 0); return(list.Count > 0); }
protected override void Clear() { base.Clear(); var data = new ApplicationUserProfileImageMasterDataModel(); ApplicationUserProfileImageMasterId = data.ApplicationUserProfileImageMasterId; Image = data.Image; Title = data.Title; }
protected override void Update(Dictionary <string, string> values) { var data = new ApplicationUserProfileImageMasterDataModel(); // copies properties from values dictionary object to data object PropertyMapper.CopyProperties(data, values); data.Image = profileImage; Framework.Components.ApplicationUser.ApplicationUserProfileImageMasterDataManager.Update(data, SessionVariables.RequestProfile); base.Update(values); }
public static DataTable GetDetails(ApplicationUserProfileImageMasterDataModel data, RequestProfile requestProfile) { var sql = "EXEC dbo.ApplicationUserProfileImageMasterSearch " + " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) + //", " + ToSQLParameter(BaseDataModel.BaseDataColumns.ReturnAuditInfo,BaseDataManager.ReturnAduitInfoOnDetails) + ", " + ToSQLParameter(data, ApplicationUserProfileImageMasterDataModel.DataColumns.ApplicationUserProfileImageMasterId); var oDT = new DataAccess.DBDataTable("ApplicationUserProfileImageMaster.Details", sql, DataStoreKey); return(oDT.DBTable); }
public static void Update(ApplicationUserProfileImageMasterDataModel data, RequestProfile requestProfile) { var sql = CreateOrUpdate(data, requestProfile, "Update"); var parameters = new List <SqlParameter>(); parameters.Add(new SqlParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId)); parameters.Add(new SqlParameter(BaseDataModel.BaseDataColumns.ApplicationId, data.ApplicationId)); parameters.Add(new SqlParameter(ApplicationUserProfileImageMasterDataModel.DataColumns.Image, data.Image)); DataAccess.DBDML.RunSQLWithParameters("ApplicationUserProfileImageMaster.Insert", sql, parameters.ToArray(), DataStoreKey); }
public static DataTable Search(ApplicationUserProfileImageMasterDataModel data, RequestProfile requestProfile) { // formulate SQL var sql = "EXEC dbo.ApplicationUserProfileImageMasterSearch " + " " + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) + ", " + ToSQLParameter(BaseDataModel.BaseDataColumns.ApplicationMode, requestProfile.ApplicationModeId) + ", " + ToSQLParameter(data, BaseDataModel.BaseDataColumns.ApplicationId) + ", " + ToSQLParameter(data, ApplicationUserProfileImageMasterDataModel.DataColumns.ApplicationUserProfileImageMasterId) + ", " + ToSQLParameter(data, ApplicationUserProfileImageMasterDataModel.DataColumns.Title); var oDT = new DataAccess.DBDataTable("ApplicationUserProfileImageMaster.Search", sql, DataStoreKey); return(oDT.DBTable); }
public static void Delete(ApplicationUserProfileImageMasterDataModel dataQuery, RequestProfile requestProfile) { const string sql = @"dbo.ApplicationUserProfileImageMasterDelete "; var parameters = new { AuditId = requestProfile.AuditId , ApplicationUserProfileImageMasterId = dataQuery.ApplicationUserProfileImageMasterId }; using (var dataAccess = new DataAccessBase(DataStoreKey)) { dataAccess.Connection.Execute(sql, parameters, commandType: CommandType.StoredProcedure); } }
protected void Page_Load(object sender, EventArgs e) { int imageId = Convert.ToInt32(Request.QueryString["imageid"]); var data = new ApplicationUserProfileImageMasterDataModel(); data.ApplicationUserProfileImageMasterId = imageId; var dt = Framework.Components.ApplicationUser.ApplicationUserProfileImageMasterDataManager.GetDetails(data, SessionVariables.RequestProfile); if (dt.Rows.Count > 0) { var imageData = ((byte[])(dt.Rows[0][ApplicationUserProfileImageMasterDataModel.DataColumns.Image])); Response.Clear(); Response.ContentType = "image/pjpeg"; Response.BinaryWrite(imageData); Response.End(); } }
public void LoadData(int applicationUserProfileImageMasterId, bool showId) { // clear UI Clear(); // set up parameters var data = new ApplicationUserProfileImageMasterDataModel(); data.ApplicationUserProfileImageMasterId = applicationUserProfileImageMasterId; // get data var items = Framework.Components.ApplicationUser.ApplicationUserProfileImageMasterDataManager.GetEntityDetails(data, SessionVariables.RequestProfile); // should only have single match -- should log exception. if (items.Count != 1) { return; } var item = items[0]; largeImage = "/Shared/AuthenticationAndAuthorization/ApplicationUserProfileImageMaster/ShowImage.aspx?imageid=" + Convert.ToString(item.ApplicationUserProfileImageMasterId); smallImage = "/Shared/AuthenticationAndAuthorization/ApplicationUserProfileImageMaster/ShowImage.aspx?imageid=" + Convert.ToString(item.ApplicationUserProfileImageMasterId); imgApplicationUserImage.ImageUrl = "~/Shared/AuthenticationAndAuthorization/ApplicationUserProfileImageMaster/ShowImage.aspx?imageid=" + Convert.ToString(item.ApplicationUserProfileImageMasterId); imgApplicationUserImage1.ImageUrl = "~/ApplicationDevelopment/ApplicationUserProfileImageMaster/ShowImage.aspx?imageid=" + Convert.ToString(item.ApplicationUserProfileImageMasterId); //hrfApplicationUserImage.HRef = "~/ApplicationDevelopment/ApplicationUserProfileImageMaster/ShowImage.aspx?imageid=" + Convert.ToString(row[TaskTimeTracker.Components.Module.ApplicationDevelopment.ApplicationUserProfileImageMaster.DataColumns.ApplicationUserProfileImageMasterId]); txtTitle.Text = Convert.ToString(item.Title); CoreControlApplicationId.Text = Convert.ToString(item.ApplicationId); CoreControlddlApplicationId.Text = Convert.ToString(item.ApplicationId); if (!showId) { txtApplicationUserProfileImageMasterId.Text = item.ApplicationUserProfileImageMasterId.ToString(); //PlaceHolderAuditHistory.Visible = true; // only show Audit History in case of Update page, not for Clone. oHistoryList.Setup(PrimaryEntity, applicationUserProfileImageMasterId, PrimaryEntityKey); } else { txtApplicationUserProfileImageMasterId.Text = String.Empty; } oUpdateInfo.LoadText(item.UpdatedDate, item.UpdatedBy, item.LastAction); }
protected void btnDelete_Click(object sender, EventArgs e) { try { string[] deleteIndexList = DeleteIds.Split(','); foreach (string index in deleteIndexList) { var data = new ApplicationUserProfileImageMasterDataModel(); data.ApplicationUserProfileImageMasterId = int.Parse(index); Framework.Components.ApplicationUser.ApplicationUserProfileImageMasterDataManager.Delete(data, SessionVariables.RequestProfile); } DeleteAndRedirect(); } catch (Exception ex) { Response.Write(ex.Message); } }
protected override DataTable GetData() { try { SuperKey = ApplicationCommon.GetSuperKey(); SetId = ApplicationCommon.GetSetId(); var selectedrows = new DataTable(); var applicationUserProfileImageMasterdata = new ApplicationUserProfileImageMasterDataModel(); selectedrows = Framework.Components.ApplicationUser.ApplicationUserProfileImageMasterDataManager.GetDetails(applicationUserProfileImageMasterdata, SessionVariables.RequestProfile).Clone(); if (!string.IsNullOrEmpty(SuperKey)) { var systemEntityTypeId = (int)PrimaryEntity; var lstEntityKeys = ApplicationCommon.GetSuperKeyDetails(systemEntityTypeId, SuperKey); foreach (var entityKey in lstEntityKeys) { applicationUserProfileImageMasterdata.ApplicationUserProfileImageMasterId = entityKey; var result = Framework.Components.ApplicationUser.ApplicationUserProfileImageMasterDataManager.GetDetails(applicationUserProfileImageMasterdata, SessionVariables.RequestProfile); profileImage = ((byte[])(result.Rows[0][ApplicationUserProfileImageMasterDataModel.DataColumns.Image])); selectedrows.ImportRow(result.Rows[0]); } } else { applicationUserProfileImageMasterdata.ApplicationUserProfileImageMasterId = SetId; var result = Framework.Components.ApplicationUser.ApplicationUserProfileImageMasterDataManager.GetDetails(applicationUserProfileImageMasterdata, SessionVariables.RequestProfile); profileImage = ((byte[])(result.Rows[0][ApplicationUserProfileImageMasterDataModel.DataColumns.Image])); selectedrows.ImportRow(result.Rows[0]); } return(selectedrows); } catch (Exception ex) { Response.Write(ex.Message); } return(null); }
private static string CreateOrUpdate(ApplicationUserProfileImageMasterDataModel data, RequestProfile requestProfile, string action) { var sql = "EXEC "; switch (action) { case "Create": sql += "dbo.ApplicationUserProfileImageMasterInsert " + " " + ToSQLParameter(BaseDataModel.BaseDataColumns.ApplicationId, requestProfile.ApplicationId) + ", "; break; case "Update": sql += "dbo.ApplicationUserProfileImageMasterUpdate " + " "; break; default: break; } sql = sql + ToSQLParameter(BaseDataModel.BaseDataColumns.AuditId, requestProfile.AuditId) + ", " + ToSQLParameter(data, ApplicationUserProfileImageMasterDataModel.DataColumns.ApplicationUserProfileImageMasterId) + ", " + ToSQLParameter(data, ApplicationUserProfileImageMasterDataModel.DataColumns.Title) + ", " + ToSQLParameter(data, ApplicationUserProfileImageMasterDataModel.DataColumns.Image); return(sql); }
public static ApplicationUserProfileImageMasterDataModel GetDetails(ApplicationUserProfileImageMasterDataModel data, RequestProfile requestProfile) { var list = GetEntityDetails(data, requestProfile, 1); return(list.FirstOrDefault()); }
public static List <ApplicationUserProfileImageMasterDataModel> GetEntityDetails(ApplicationUserProfileImageMasterDataModel dataQuery, RequestProfile requestProfile, int returnAuditInfo = BaseDataManager.ReturnAuditInfoOnDetails) { const string sql = @"dbo.ApplicationUserProfileImageMasterSearch "; var parameters = new { Title = dataQuery.Title , ApplicationUserProfileImageMasterId = dataQuery.ApplicationUserProfileImageMasterId }; List <ApplicationUserProfileImageMasterDataModel> result; using (var dataAccess = new DataAccessBase(DataStoreKey)) { result = dataAccess.Connection.Query <ApplicationUserProfileImageMasterDataModel>(sql, parameters, commandType: CommandType.StoredProcedure).ToList(); } return(result); }