Example #1
0
app.post('/create',yz , form, function(req, res){
    if (req.errmsg) {
        res.render('new.html',{errmsg:req.errmsg});
    }else{
       req.formdata.user = req.session.loginuser.loginname;
       doctype.save(req.formdata, function(){
            res.redirect('/doctype');
       });  
    }
});
Example #2
0
 contact.get(new ObjectID(req.params.id), function(data){
     if(data){
         contact.update(new ObjectID(req.params.id), req.formdata, function(){
             res.send("success");
         });
     }else{
         contact.save(req.formdata, function(){
             res.send("success");
         });                
     }
 });
Example #3
0
app.post('/create',yz,form,function(req, res){
    if (req.errmsg) {
        res.render('new.html',{
            layout:false,
            validatnum:req.validatnum,
            errmsg:req.errmsg,
            photofolder:req.formdata});
    }else{
       req.formdata.user = req.session.loginuser.loginname;
       photofolder.save(req.formdata, function(){
            res.send("success");
       });  
    }
});