protected void btnSavePropertyPreValue_Click(object sender, EventArgs e) { if (SavePropertyPreValueData()) { if (string.IsNullOrEmpty(hdnPropertyPreValueId.Value)) { DInfoPropertyPreValue.ShowMessage("sub category has been added successfully", Enums.MessageType.Successfull); } else { DInfoPropertyPreValue.ShowMessage("sub category has been updated successfully", Enums.MessageType.Successfull); } ResetPropertyPreValueControl(); LoadPropertyPreValueData(false, false); } }
protected void btnPropertyPreValueDelete_Click(object sender, EventArgs e) { string[] arIDs = hdnSelectedIDs.Value.ToString().TrimEnd(',').Split(','); bool IsDelete = false; for (int i = 0; i <= arIDs.Length - 1; i++) { if (!string.IsNullOrEmpty(arIDs.GetValue(i).ToString())) { if (DeletePropertyPreValue(Convert.ToInt32(arIDs.GetValue(i)))) { IsDelete = true; } } } if (IsDelete) { LoadPropertyPreValueData(false, false); } DInfoPropertyPreValue.ShowMessage("Property PreValue has been deleted successfully", Enums.MessageType.Successfull); hdnSelectedIDs.Value = ""; }
private bool SavePropertyPreValueData() { if (hdnPKID.Value != "") { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblPropertyPreValue", tblPropertyPreValue.ColumnNames.AppPreValue, tblPropertyPreValue.ColumnNames.AppPropertyPreValueID, txtPreValue.Text, hdnPropertyPreValueId.Value, tblPropertyPreValue.ColumnNames.AppPropertyID + "=" + hdnPKID.Value)) { DInfoPropertyPreValue.ShowMessage("Pre-Value alredy exits.", Enums.MessageType.Error); return(false); } objPropertyPreValue = new tblPropertyPreValue(); if (!string.IsNullOrEmpty(hdnPropertyPreValueId.Value) && hdnPropertyPreValueId.Value != "") { objPropertyPreValue.LoadByPrimaryKey(Convert.ToInt32(hdnPropertyPreValueId.Value)); } else { objPropertyPreValue.AddNew(); objPropertyPreValue.s_AppCreatedBy = Session[appFunctions.Session.UserID.ToString()].ToString(); objPropertyPreValue.AppCreatedDate = DateTime.Now; objPropertyPreValue.AppDisplayOrder = objCommon.GetNextDisplayOrder("tblPropertyPreValue", tblPropertyPreValue.ColumnNames.AppDisplayOrder, tblPropertyPreValue.ColumnNames.AppPropertyID + "=" + hdnPKID.Value); } objPropertyPreValue.s_AppPropertyID = hdnPKID.Value; objPropertyPreValue.AppPreValue = txtPreValue.Text; objPropertyPreValue.AppIsActive = chkPropertyPreValueIsActive.Checked; objPropertyPreValue.Save(); objPropertyPreValue = null; objCommon = null; return(true); } else { return(false); } }