protected void lbDelete_Click(object sender, CommandEventArgs e) { if (e.CommandName.Equals("doDelete")) { if (Permissions.UserHasAnyPermissionIn(SessionHelper.UserId(), "sys_edit_emails")) { Int64 EmailTemplateId = Convert.ToInt64(e.CommandArgument); string Name = EmailTemplateController.GetItemName(EmailTemplateId) ?? @""; EmailTemplateController.Delete(EmailTemplateId); Master.MessageCenter.DisplaySuccessMessage(string.Format(EmailTemplatesStrings.GetText("MessageTemplateDeleted"), Name.ToHtml()), true); LoadItems(); } else { Master.MessageCenter.DisplayWarningMessage(GlobalStrings.GetText(@"NoPermissionsForAction")); } } }