示例#1
0
 void Member_BeforeSave(Member sender, umbraco.cms.businesslogic.SaveEventArgs e)
 {
     //DocumentType documentType = DocumentType.GetByAlias("Gymnast");
     //Document document = Document.MakeNew(sender.Text, documentType, new User("admin"), int.Parse(UmbracoCustom.GetParameterValue(Parameter.GymnastDocument)));
     //document.getProperty("member").Value = sender.Id;
     //document.Save();
     //Log.Add(LogTypes.New, int.Parse(UmbracoCustom.GetParameterValue(Parameter.GymnastDocument)), string.Format("Create new user {0} in Member_BeforeSave event", sender.Text));
 }
示例#2
0
    void Document_BeforeSave(Document sender, umbraco.cms.businesslogic.SaveEventArgs e)
    {
        //throw new NotImplementedException();
        //Property SendEmailNotification = sender.getProperty("sendEmailNotification");
        //if (SendEmailNotification.Value.ToString() == "0")
        //{

        //}
        //Property SendPushNotification = sender.getProperty("sendPushNotification");
        //if (SendPushNotification.Value.ToString() == "0")
        //{

        //}
    }
示例#3
0
    void Member_AfterSave(Member sender, umbraco.cms.businesslogic.SaveEventArgs e)
    {
        Document[] documents      = Document.GetChildrenForTree(int.Parse(UmbracoCustom.GetParameterValue(UmbracoType.GymnastNode)));
        Document   documentMember = documents.SingleOrDefault(d => d.Text == sender.Text);
        Property   gymnast        = sender.getProperty("gymnast");

        if (documentMember == null && Roles.GetRolesForUser(sender.LoginName).Any())
        {
            DocumentType documentType = DocumentType.GetByAlias("Gymnast");
            Document     document     = Document.MakeNew(sender.Text, documentType, new User("admin"), int.Parse(UmbracoCustom.GetParameterValue(UmbracoType.GymnastNode)));
            document.getProperty("member").Value = sender.Id;
            document.Save();
            gymnast.Value = document.Id;
            sender.Save();
            //Log.Add(LogTypes.New, int.Parse(UmbracoCustom.GetParameterValue(UmbracoType.GymnastNode)), string.Format("Create new user {0} in Member_AfterSave event", sender.Text));
        }
        else if (gymnast.Value == null && Roles.GetRolesForUser(sender.LoginName).Any())
        {
            gymnast.Value = documentMember.Id;
            sender.Save();
        }
        //sender.Save();
        //if (sender.LoginName != sender.Text && documentMember == null)
    }
示例#4
0
 private void Media_AfterSave(Media sender, umbraco.cms.businesslogic.SaveEventArgs e)
 {
     //ensure that only the providers are flagged to listen execute
     IndexMedia(sender);
 }
示例#5
0
 void Document_AfterSave(Document sender, umbraco.cms.businesslogic.SaveEventArgs e)
 {
     //throw new NotImplementedException();
     //Property SendEmailNotification = sender.getProperty("sendEmailNotification");
     //Property SendPushNotification = sender.getProperty("sendPushNotification");
 }