protected void btnAddToPage_Click(object sender, EventArgs e) { try { SubjectProperties subjectProperties = new SubjectProperties(pSubjectID, Convert.ToInt32(ddlProperties.SelectedValue)); if (subjectProperties.RowCount.Equals(0)) { subjectProperties.AddNew(); subjectProperties.pIDSubject = pSubjectID; subjectProperties.pIDProperty = Convert.ToInt32(ddlProperties.SelectedValue); subjectProperties.pIsSearchable = chbIsSearchable.Checked; subjectProperties.Save(); pMessage.Clear(); pMessage.Add(Farschidus.Translator.AppTranslate["general.message.success"], Farschidus.Web.UI.Message.MessageTypes.Success); mLoadAllGroupProperties(); } else { pMessage.Add(Farschidus.Translator.AppTranslate["property.popup.message.alreadyExist"], Farschidus.Web.UI.Message.MessageTypes.Information); } } catch (Exception ex) { pMessage.Clear(); pMessage.Add(ex.Message, Farschidus.Web.UI.Message.MessageTypes.Error); } finally { mShowMessage(pMessage); } }
public string mIsSearchable(object IDProperty) { string result = string.Empty; SubjectProperties subjectProperties = new SubjectProperties(pSubjectID, (int)IDProperty); if (subjectProperties.RowCount > 0) { if (subjectProperties.pIsSearchable) { result = Global.Constants.HTML_IMAGE_CHECK; } else { result = Global.Constants.HTML_IMAGE_ERROR; } } else { result = "N/A"; } return(result); }
protected void btnRemoveFromPage_Click(object sender, EventArgs e) { try { pMessage.Clear(); bool hasSelect = false; int item; SubjectProperties subjectProperties = new SubjectProperties(); foreach (GridViewRow grvRow in grvGroupPropeties.Rows) { if (((CheckBox)grvRow.FindControl("chkPageList")).Checked) { item = Convert.ToInt32(grvGroupPropeties.DataKeys[grvRow.RowIndex][SubjectProperties.ColumnNames.IDProperty].ToString()); subjectProperties.LoadByPrimaryKey(pSubjectID, item); if (subjectProperties.RowCount > 0) { subjectProperties.MarkAsDeleted(false); subjectProperties.Save(); hasSelect = true; } } } if (hasSelect) { //reorderMediaSubjects(subjectProperties); mLoadAllGroupProperties(); pMessage.Add(Farschidus.Translator.AppTranslate["general.message.deleted"], Farschidus.Web.UI.Message.MessageTypes.Success); } } catch (Exception ex) { pMessage.Add(ex.Message, Farschidus.Web.UI.Message.MessageTypes.Error); } finally { mShowMessage(pMessage); } }
private bool mValidateDelete(int iDProperty) { //pMessage.Clear(); bool isValid = true; SubjectProperties subjectProperties = new SubjectProperties(); subjectProperties.LoadByIDProperty(iDProperty); if (subjectProperties.RowCount > 0) { isValid = false; pMessage.Add(Farschidus.Translator.AppTranslate["propertyManaging.default.message.subjectPropertyRelation"], Farschidus.Web.UI.Message.MessageTypes.Warning); Subjects subject = new Subjects(); do { subject.LoadByIDSubjectAndIDLanguage(subjectProperties.pIDSubject, pLanguageID); if (subject.RowCount > 0) { pMessage.Add(subject.pAlias, Farschidus.Web.UI.Message.MessageTypes.Information); } }while (subjectProperties.MoveNext()); } return(isValid); }