當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript parse.Parse.Object類代碼示例

本文整理匯總了TypeScript中parse.Parse.Object的典型用法代碼示例。如果您正苦於以下問題:TypeScript Parse.Object類的具體用法?TypeScript Parse.Object怎麽用?TypeScript Parse.Object使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Parse.Object類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: userIsBack

    userIsBack(user:any) : any
    {
           var today = new Date();
           var tommorrow = new Date();

           today.setHours(0,0,0,0);        
           tommorrow.setDate(today.getDate()+1);
           tommorrow.setHours(0,0,0,0);

           var ParseClass = Parse.Object.extend("Users");
           var query = new Parse.Query(ParseClass);
           query.equalTo("User", user);
           query.greaterThan("createdAt", today);
           query.lessThan("createdAt", tommorrow);
           query.descending("createdAt");
           query.find({
               success: (query:any) => {
                   var objectId = query[0].id;
                   ParseClass = Parse.Object.extend("Users");
                   var update = new Parse.Query(ParseClass);
                   update.get(objectId, {
                       success: (update:any)=> {
                           update.set("Time", 0); 
                           update.save();    
                       },
                       error: (object:any, error:any) => {
                       }
                   }); 
               },
               error: (object:any, error:any) => {
               }

           });
    }
開發者ID:saulmadi,項目名稱:acklen-slackbot,代碼行數:34,代碼來源:parseDB.ts

示例2: saveUser

  saveUser() {
    let self = this;
    var User = Parse.Object.extend("User");
    let user = new User();
    var data = {
      email: this.email,
      password: this.password,
      phone: this.phone,
      username: this.username,
      type: this.name,
      status: "NEW"
    };

    user.save(data, {
      success: function(user) {
        console.log("1");
        // let alert = self.alertCtrl.create({
        //   title: "Check your email",
        //   subTitle: "Verification email has sent successful",
        //   buttons: ["OK"]
        // });
        // alert.present();
        console.log("2");

        console.log("created");
      },
      error: function(user, error) {
        console.log("error");
      }
    });
  }
開發者ID:cybriz,項目名稱:ionic-projects,代碼行數:31,代碼來源:summary.ts

示例3: saveStates

 saveStates() {
   let self= this;
   var States = Parse.Object.extend("States");
   var states= new States;
   var query = new Parse.Query("States");
   var innerQuery = new Parse.Query(States);
   innerQuery.exists(self.state);
   query.matchesQuery("Name", innerQuery);
   query.find({
     success: function(object){
       console.log('notexist' + self.state)
       var States = Parse.Object.extend('States');
       var states = new States();
        var data={
         Name:self.state
           };
           states.save(data,{
             success: function(user){
               console.log('created states')
             },
             error: function(user, error){
               console.log(error)
             }
           })
     } , error : function(){
       console.log(' exist')
     } 
   });
 }
開發者ID:cybriz,項目名稱:ionic-projects,代碼行數:29,代碼來源:summary.ts

示例4: function

 success: function(products) {
     var pro = Parse.Object.extend("Products");
     var query = new Parse.Query(pro);
     query.equalTo("category", products[0]);
     query.find({
         success: function(products) {
             success(products);
         }
     });
 }
開發者ID:valero90,項目名稱:Angular2-Parse,代碼行數:10,代碼來源:ParseManager.ts

示例5: getProductsCategory

 getProductsCategory(success: (products) => void)
 {
     var catClass = Parse.Object.extend("ProductsCategory");
     var query = new Parse.Query(catClass);
     query.find({
     success: function(categories) {
         success(categories);
     }
     });
 }
開發者ID:valero90,項目名稱:Angular2-Parse,代碼行數:10,代碼來源:ParseManager.ts

示例6: checkIsAbscent

	checkIsAbscent(messageSender:any, user:any): any{
		var today = new Date();
       var tommorrow = new Date();

       today.setHours(0,0,0,0);
       tommorrow.setDate(today.getDate()+1);
       tommorrow.setHours(0,0,0,0);

       var Class = Parse.Object.extend("Users");
       var query = new Parse.Query(Class);
       query.equalTo("User", user);
       query.greaterThan("createdAt", today);
       query.lessThan("createdAt", tommorrow);
       query.descending("createdAt");
       query.find({
           success: (result:any) => {
               var format = result[0].attributes.Format;

               if(format == 'min')
               {
                   today = new Date();
                   var abscenceStartTime = result[0].createdAt;
                   var abscenceEndTime = this.addMinutes(abscenceStartTime,result[0].attributes.Time);

                   if(today> abscenceStartTime && today<abscenceEndTime)
                   {
                       var date = new Date(abscenceEndTime.toString());
                       messageSender.send( result[0].attributes.User + " is abscent, will be back around " + moment(date).format('h:mm A'));
                   }

               }else if(format == 'hour')
               {
                   today = new Date();
                   var abscenceStartTime = result[0].createdAt;
                   var abscenceEndTime = this.addHours(abscenceStartTime,result[0].attributes.Time);

                   if(today> abscenceStartTime && today<abscenceEndTime)
                   {
                       var date = new Date(abscenceEndTime.toString());
                       messageSender.send(result[0].attributes.User + " is abscent, will be back around " + moment(date).format('h:mm A'));
                   }

               }else if(format == 'day')
               {

               }


           },
               error: (error:any) => {
                console.log(error.message);
           }
       });
	}
開發者ID:saulmadi,項目名稱:acklen-slackbot,代碼行數:54,代碼來源:parseDB.ts

示例7:

 success: (query:any) => {
     var objectId = query[0].id;
     ParseClass = Parse.Object.extend("Users");
     var update = new Parse.Query(ParseClass);
     update.get(objectId, {
         success: (update:any)=> {
             update.set("Time", 0); 
             update.save();    
         },
         error: (object:any, error:any) => {
         }
     }); 
 },
開發者ID:saulmadi,項目名稱:acklen-slackbot,代碼行數:13,代碼來源:parseDB.ts

示例8: createCategory

    createCategory(name: String, success:(category)=>void)
    {
        var CategoryClass = Parse.Object.extend("ProductsCategory");
        var cat = new CategoryClass();

        cat.set("name",name);

        cat.save(null,{
          success:function(category) { 
            success(category);
          },
          error:function(error) {
            console.log('parse saving error');
          }
        });
    }
開發者ID:valero90,項目名稱:Angular2-Parse,代碼行數:16,代碼來源:ParseManager.ts

示例9: function

 success: function(object){
   console.log('notexist' + self.state)
   var States = Parse.Object.extend('States');
   var states = new States();
    var data={
     Name:self.state
       };
       states.save(data,{
         success: function(user){
           console.log('created states')
         },
         error: function(user, error){
           console.log(error)
         }
       })
 } , error : function(){
開發者ID:cybriz,項目名稱:ionic-projects,代碼行數:16,代碼來源:summary.ts

示例10: saveAbscence

	saveAbscence(command:any):any{
       var ParseClass = Parse.Object.extend("Users");
       var parseClass = new ParseClass();

       parseClass.set("User", command.User);
       parseClass.set("Command", command.Command);
       parseClass.set("Time", parseInt(command.Time));
       parseClass.set("Format", command.Format);

        parseClass.save(null, {
           success: function(parseClass) {
               return parseClass.id;
           },
           error: function(parseClass, error) {
               return error.message;
           }});
       return '';
	}
開發者ID:saulmadi,項目名稱:acklen-slackbot,代碼行數:18,代碼來源:parseDB.ts


注:本文中的parse.Parse.Object類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。